From 9119922edfd0cd9034aeee3bb375f7ccc650b3ef Mon Sep 17 00:00:00 2001 From: Aster Boese Date: Tue, 16 Dec 2025 23:48:39 -0500 Subject: [PATCH] main/postmarketos-initramfs: add XFS partition support Signed-off-by: Aster Boese Part-of: --- .../postmarketos-initramfs/00-default.modules | 1 + .../00-initramfs-extra-base.files | 3 +++ main/postmarketos-initramfs/APKBUILD | 12 +++++---- main/postmarketos-initramfs/init_functions.sh | 25 ++++++++++++++----- .../init_functions_2nd.sh | 10 +++++++- 5 files changed, 39 insertions(+), 12 deletions(-) diff --git a/main/postmarketos-initramfs/00-default.modules b/main/postmarketos-initramfs/00-default.modules index 02c365c2f..97d8a2db9 100644 --- a/main/postmarketos-initramfs/00-default.modules +++ b/main/postmarketos-initramfs/00-default.modules @@ -23,4 +23,5 @@ usb_f_mass_storage usb_f_rndis usb-storage vfat +xfs xts diff --git a/main/postmarketos-initramfs/00-initramfs-extra-base.files b/main/postmarketos-initramfs/00-initramfs-extra-base.files index 250ae0a55..7abeed45f 100644 --- a/main/postmarketos-initramfs/00-initramfs-extra-base.files +++ b/main/postmarketos-initramfs/00-initramfs-extra-base.files @@ -16,10 +16,12 @@ /sbin/dmsetup /sbin/e2fsck /sbin/fsck.vfat +/sbin/fsck.xfs # Full fat modprobe for compressed modules /sbin/modprobe /sbin/switch_root /sbin/udevd +/sbin/xfs_repair /usr/bin/buffyboard /usr/bin/iskey /usr/lib/libz.so.1 @@ -27,6 +29,7 @@ /usr/sbin/parted /usr/sbin/resize.f2fs /usr/sbin/resize2fs +/usr/sbin/xfs_growfs /usr/share/consolefonts/ter-128n.psf.gz /usr/share/initramfs/init_2nd.sh:/init_2nd.sh /usr/share/initramfs/init_functions_2nd.sh:/init_functions_2nd.sh diff --git a/main/postmarketos-initramfs/APKBUILD b/main/postmarketos-initramfs/APKBUILD index 330e82adb..2db8378b7 100644 --- a/main/postmarketos-initramfs/APKBUILD +++ b/main/postmarketos-initramfs/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Casey Connolly # Co-Maintainer: Clayton Craft pkgname=postmarketos-initramfs -pkgver=3.8.9 +pkgver=3.8.10 pkgrel=0 pkgdesc="Base files for the postmarketOS initramfs / initramfs-extra" url="https://postmarketos.org" @@ -36,6 +36,8 @@ depends=" udev unudhcpd util-linux-misc + xfsprogs + xfsprogs-extra xz " makedepends=" @@ -107,14 +109,14 @@ package() { } sha512sums=" -aeebd94af66782dc1394f6dc06ed3baa19fceb2da337a54e4c1b395ab201617de6e070d5d03750d0ab4d9e980283cc57584e038d9d55c82b8a589a915c8b5c7e 00-default.modules +9d1358886fc2d3eac27c13b11e998458da41ac222c1bfa986ae948970419775b5488ab8b8404a6aa0e21c47717316aa9717b5d5ddc53ec610ad875328ea18e9f 00-default.modules 9c0e8f6f61d5da191e03a1aa9d5d0ceb5baf1eae6dbb9bfb0af59817783525119ac8394b135f303f7b6434a3eab0b49185fb90379e06823db847a4999c75ce33 00-initramfs-base.dirs e268094cbd25e063fdab2226f8cf93885bd8b90455991a53296231a3401a03669440333025ca44b2a8459df98787a5725f7b227ccb9750f8fcad17ef58ba21a1 00-initramfs-base.files -d0f35562365756d93066ce45924d17fb347b54095179c3262daa2f073e12743505cd5d9372ad30485915ca754d95a8edba9a74314e7949e0b3cf6978a87d03a5 00-initramfs-extra-base.files +1bb1930cb5bdb60a074195f772dc015b827487a3efd0d68b51ade52164b6371a756249753fbbdc56e975d18f24ada6a1339ea204d2d8fe7ecd95d7aec8647161 00-initramfs-extra-base.files e90596540805662211bd2a2e427ce7cc38f6a30023267f902e23f2bae136b6cd8f4f4716b8fb611be9d671a964edd2ecce03fa32bc8024e29b8375b0097fde0c init.sh -c8aab3e0d407a413fa35070b800a6fa733ccb691327f9fef9df1d604cd2a019504ad7c447637df218da113199ff25998ca66a192fcabd5ae62b9873a985db1c1 init_functions.sh +653b6e44f165f710fd11af4244fe13de3ca56de0b67e0867be21ab6a0cb12b3e9cbcafca4300b7d735defe5f9e25b5bfe39a7c0588c858fcd94ea860c93c83eb init_functions.sh 6b4881f9b43c90ebcc70d7b7a192d26a2e3ce01c43b8536fe900c2ffaf74ef035803b9aa083e7a9d5c49c75be8ba6ff22997a037ae4f399e6ee5e1978c4b3f9c init_2nd.sh -d7d003e906ee017dacd1e994729ce1c94ac628ea4a36636bc78eedd16125e3f2cf500ecddac144cc11d69cc741fc5f4512510209236c2fda8a893d506773b965 init_functions_2nd.sh +de14f6f678856ae316f28c003a6293a383aa6b7cbb19951b981430eb0e3b91d0634dedf62d29d105845b6e172daa18e6b6e45e03342d72ae806ca611a1236d18 init_functions_2nd.sh 675e7d5bee39b2df7d322117f8dcaccc274d61beaf4d50ead19bbf2109446d64b1c0aa0c5b4f9846eb6c1c403418f28f6364eff4537ba41120fbfcbc484b7da7 mdev.conf ba3275a9af788c7c782322a22a0f144d5e50e3498ea6886486a29331f23ae89cd32d500a3635cfa7cab369afba92edc18aeca64ccbf0cd589061cce23d15b46c unudhcpd.conf " diff --git a/main/postmarketos-initramfs/init_functions.sh b/main/postmarketos-initramfs/init_functions.sh index 22f5b1241..107af1231 100644 --- a/main/postmarketos-initramfs/init_functions.sh +++ b/main/postmarketos-initramfs/init_functions.sh @@ -535,7 +535,13 @@ check_filesystem() { if [ $? -gt 4 ]; then status="fail" fi - + ;; + xfs) + echo "Auto-repair and check 'xfs' filesystem ($partition)" + fsck.xfs -p "$partition" + if [ $? -gt 4 ]; then + status="fail" + fi ;; *) echo "WARNING: fsck not supported for '$type' filesystem ($partition)." ;; esac @@ -582,6 +588,9 @@ mount_boot_partition() { # ext2 might be handled by the ext2 or ext4 kernel module # so let mount detect that automatically by omitting -t ;; + xfs) + modprobe xfs + ;; vfat) modprobe vfat mount_opts="-t vfat $mount_opts,umask=0077,nosymfollow,codepage=437,iocharset=ascii" @@ -680,11 +689,15 @@ mount_root_partition() { type="$(get_partition_type "$partition")" info "Detected $type filesystem" - if ! { [ "$type" = "ext4" ] || [ "$type" = "f2fs" ] || [ "$type" = "btrfs" ]; } then - echo "ERROR: Detected unsupported '$type' filesystem ($partition)." - show_splash "ERROR: unsupported '$type' filesystem ($partition)\\nhttps://postmarketos.org/troubleshooting" - fail_halt_boot - fi + case "$type" in + btrfs|ext4|f2fs|xfs) + ;; + *) + echo "ERROR: Detected unsupported '$type' filesystem ($partition)." + show_splash "ERROR: unsupported '$type' filesystem ($partition)\\nhttps://postmarketos.org/troubleshooting" + fail_halt_boot + ;; + esac if ! modprobe "$type"; then info "Unable to load module '$type' - assuming it's built-in" diff --git a/main/postmarketos-initramfs/init_functions_2nd.sh b/main/postmarketos-initramfs/init_functions_2nd.sh index fefe745d4..7e72beef3 100644 --- a/main/postmarketos-initramfs/init_functions_2nd.sh +++ b/main/postmarketos-initramfs/init_functions_2nd.sh @@ -104,7 +104,7 @@ unlock_root_partition() { fi } -# resize2fs and resize.f2fs are too big +# resize2fs, resize.f2fs, and xfs_growfs are too big resize_root_filesystem() { local partition @@ -126,6 +126,10 @@ resize_root_filesystem() { btrfs) # Resize happens below after mount ;; + xfs) + # Resize happens below after mount + modprobe xfs + ;; *) echo "WARNING: Can not resize '$type' filesystem ($partition)." ;; esac } @@ -145,5 +149,9 @@ resize_filesystem_after_mount() { echo "Resize 'btrfs' filesystem ($mountpoint)" btrfs filesystem resize max "$mountpoint" ;; + xfs) + echo "Resize 'xfs' root filesystem ($mountpoint)" + xfs_growfs -d "$mountpoint" + ;; esac }