From 4dc833abc2c3a6cbdbc2db3419d0505b7cc9f803 Mon Sep 17 00:00:00 2001 From: Felix Urbasik Date: Sun, 18 Aug 2024 12:17:24 +0200 Subject: [PATCH] main/postmarketos-initramfs: add support for multi-device btrfs This change allows mounting btrfs root filesystems which are spread across multiple devices or partitions. Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/5508 [ci:skip-build]: already built successfully in CI --- main/postmarketos-initramfs/APKBUILD | 4 ++-- main/postmarketos-initramfs/init_functions.sh | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/main/postmarketos-initramfs/APKBUILD b/main/postmarketos-initramfs/APKBUILD index 8b61bdcaf..80cc248b7 100644 --- a/main/postmarketos-initramfs/APKBUILD +++ b/main/postmarketos-initramfs/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Caleb Connolly # Co-Maintainer: Clayton Craft pkgname=postmarketos-initramfs -pkgver=3.8.0 +pkgver=3.8.1 pkgrel=0 pkgdesc="Base files for the postmarketOS initramfs / initramfs-extra" url="https://postmarketos.org" @@ -109,7 +109,7 @@ sha512sums=" c0233d22858a5901db64e1d2fe1f6d39a2e2cfd1b94a10932483f55fed9461e9b8aa2d73b154b9d99a7a8b49ee02abfbddfe917ce0c6d7576601ba2668589c01 00-initramfs-base.files d0f35562365756d93066ce45924d17fb347b54095179c3262daa2f073e12743505cd5d9372ad30485915ca754d95a8edba9a74314e7949e0b3cf6978a87d03a5 00-initramfs-extra-base.files 7ec5e9596b27f48d3abe51bc92d70d9708479b5e7df5fa9903d9e58f5945f2a7de5c390cc2d82842b899dfc9fa9bdb2b84b29cc1daf5d534861cf1324628d57b init.sh -e8cb695056e63a07726af7d1f53136dbddfa91c01f1849bd6db65ad93d8bd1df39dcca645cf81b7fca1bdb719a3e0c1f1fa1cd1e9cee1d6508e38afa931f69ed init_functions.sh +0581202eabe4edd4735d29b04f4da2a7a0fcce240a93d9e65d90d84e7e693b5ea28eec80b03783d1905a2e0ebfb5f2a266aa422525a5336eb8569fb37c2c7a33 init_functions.sh 7cf0b1e7511bf289a90ed6cf3190a78119be46e2d885ee3af2dd1fb048eaac7c0875bfd74cc576dd062d17c5fae23f7e721b86f8d71d2b3fb2917bcc184390c1 init_2nd.sh 8072562c74c92e040b90c8d5baf60073ebc058bc43576287dc30b9a2d9048d127d7997a0192ad81113c045510db0b83279004e8c3b973224c3398e2c1f0ce130 init_functions_2nd.sh 675e7d5bee39b2df7d322117f8dcaccc274d61beaf4d50ead19bbf2109446d64b1c0aa0c5b4f9846eb6c1c403418f28f6364eff4537ba41120fbfcbc484b7da7 mdev.conf diff --git a/main/postmarketos-initramfs/init_functions.sh b/main/postmarketos-initramfs/init_functions.sh index 466c34b78..cf154e8da 100644 --- a/main/postmarketos-initramfs/init_functions.sh +++ b/main/postmarketos-initramfs/init_functions.sh @@ -678,6 +678,12 @@ mount_root_partition() { if ! modprobe "$type"; then info "Unable to load module '$type' - assuming it's built-in" fi + + # btrfs may be using multiple backing block devices, scan for the rest of them + if [ "$type" = "btrfs" ]; then + btrfs device scan + fi + if ! mount -t "$type" -o rw"$rootfsopts" "$partition" /sysroot; then echo "ERROR: unable to mount root partition!" show_splash "ERROR: unable to mount root partition\\nhttps://postmarketos.org/troubleshooting"