postmarketos-initramfs: init_functions.sh should handle rootfsopts
Describe your issue
What's the expected behaviour?
Adding a boot parameter like rootfsopts=subvol=@,noatime to the kernel command line should be passed through and used by mount_root_partition() to allow the initial root mount using custom options (in this case, specifying which btrfs subvolume to mount).
Additionally, it would be nice if there was a better error when a filesystem was mounted but the expected entries on it don't exist:
Mount root partition (/dev/sda1) to /sysroot (read-only)
Detected btrfs filesystem
[ 10.264708] BTRFS: device label pmOS_root devid 1 transid 15 /dev/sda1 scanned by mount (565)
[ 10.272929] BTRFS info (device sda1): using crc32c (crc32c-generic) checksum algorithm
[ 10.279787] BTRFS info (device sda1): using free space tree
ERROR: unable to mount root partition!
The mount succeeded, but because the wrong subvolume was mounted the only directories visible are @ and @subvolumes in my example.
What's the current behaviour?
There's no way to pass options to the mount of the root filesystem, therefore no way to select a btrfs subvolume to mount without setting it as the default subvolume.
How to reproduce your issue?
Try to boot a device with a btrfs root where the root filesystem is not installed into the root subvolume.
What device are you using?
odroid-xu4
On what postmarketOS version did you encounter the issue?
-
edge ( master
branch) -
v23.06
-
v22.12
(Supported until 2023-07-06) -
I confirm that the issue still is present after running sudo apk upgrade -a
How did you get postmarketOS image?
-
from https://images.postmarketos.org -
I built it using pmbootstrap -
It was preinstalled on my device
What's the build date of the image? (in yyyy-mm-dd format)
2023-07-29