Jump to content

Now to add new type of filesystem for root of armbian image (xfs as example)


iav

Recommended Posts

I did a patch to allow armbian build system produce image with root on xfs filesystem.

Kernel should have build-in filesystem support, and `RELEASE` have to contain required filesystem utilities. Then all need to be done — add filesystem to build process. Patch for builder attached.

Then image have to be build with separate /boot filesystem.

command should look like

./compile.sh BOARD=rockpi-4a BRANCH=current RELEASE=focal BUILD_MINIMAL=no BUILD_DESKTOP=no KERNEL_ONLY=no KERNEL_CONFIGURE=yes BOOTSIZE=250 ROOTFS_TYPE=xfs
Spoiler

diff --git a/lib/configuration.sh b/lib/configuration.sh
index b825ca4b..2a65e075 100644
--- a/lib/configuration.sh
+++ b/lib/configuration.sh
@@ -41,7 +41,7 @@ fi
 ROOT_MAPPER="armbian-root"
 
 [[ -z $ROOTFS_TYPE ]] && ROOTFS_TYPE=ext4 # default rootfs type is ext4
-[[ "ext4 f2fs btrfs nfs fel" != *$ROOTFS_TYPE* ]] && exit_with_error "Unknown rootfs type" "$ROOTFS_TYPE"
+[[ "ext4 f2fs btrfs xfs nfs fel" != *$ROOTFS_TYPE* ]] && exit_with_error "Unknown rootfs type" "$ROOTFS_TYPE"
 
 [[ -z $BTRFS_COMPRESSION ]] && BTRFS_COMPRESSION=zlib # default btrfs filesystem compression method is zlib
 [[ ! $BTRFS_COMPRESSION =~ zlib|lzo|zstd|none ]] && exit_with_error "Unknown btrfs compression method" "$BTRFS_COMPRESSION"
@@ -154,6 +154,8 @@ PACKAGE_LIST="bc cpufrequtils device-tree-compiler fping fake-hwclock psmisc chr
         ncurses-term sysfsutils toilet figlet u-boot-tools usbutils openssh-server \
         nocache debconf-utils python3-apt"
 
+[[ $ROOTFS_TYPE == xfs ]] && PACKAGE_LIST="$PACKAGE_LIST xfsprogs"
+
 # Non-essential packages for minimal build
 PACKAGE_LIST_ADDITIONAL="network-manager wireless-tools lsof htop mmc-utils wget nano sysstat net-tools resolvconf iozone3 jq libcrack2 cracklib-runtime curl"
 
diff --git a/lib/debootstrap.sh b/lib/debootstrap.sh
index f47816ed..ccfd0ac0 100644
--- a/lib/debootstrap.sh
+++ b/lib/debootstrap.sh
@@ -315,6 +315,7 @@ prepare_partitions()
     parttype[fat]=fat16
     parttype[f2fs]=ext4 # not a copy-paste error
     parttype[btrfs]=btrfs
+    parttype[xfs]=xfs
     # parttype[nfs] is empty
 
     # metadata_csum and 64bit may need to be disabled explicitly when migrating to newer supported host OS releases
@@ -327,6 +328,7 @@ prepare_partitions()
     mkopts[ext2]='-q'
     # mkopts[f2fs] is empty
     mkopts[btrfs]='-m dup'
+    # mkopts[xfs] is empty
     # mkopts[nfs] is empty
 
     mkfs[ext4]=ext4
@@ -334,6 +336,7 @@ prepare_partitions()
     mkfs[fat]=vfat
     mkfs[f2fs]=f2fs
     mkfs[btrfs]=btrfs
+    mkfs[xfs]=xfs
     # mkfs[nfs] is empty
 
     mountopts[ext4]=',commit=600,errors=remount-ro'
@@ -341,6 +344,7 @@ prepare_partitions()
     # mountopts[fat] is empty
     # mountopts[f2fs] is empty
     mountopts[btrfs]=',commit=600'
+    # mountopts[xfs] is empty
     # mountopts[nfs] is empty
 
     # default BOOTSIZE to use if not specified

 

add_xfs_root.patch

Link to comment
Share on other sites

  • iav changed the title to Now to add new type of filesystem for root of armbian image (xfs as example)
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines