Support btrfs when writable is converted to btrfs
Bug #1881074 reported by
Woodrow Shen
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
initramfs-tools-devices (Ubuntu) |
Fix Committed
|
Undecided
|
Unassigned |
Bug Description
[Impact]
* It's a special case that we may need to convert rootfs from ext4 to btrfs, and we have to resize btrfs inside initramfs as well.
[Test Case]
* Use ubuntu-image to create a classic image
* Make sure initramfs-
* Use btrfs-convert to re-format btrfs from ext4 writable
[Regression Potential]
* It should be low risk
[Other Info]
None
description: | updated |
To post a comment you must log in.
Some comments on the debdiff:
Use
blkid -s TYPE "$writable_part" -o value
instead of
blkid -s TYPE "$writable_part" | awk '{print $2}' | grep -o '".*"' | tr -d '"'
No need to redirect to >>$LOGFILE in resize_filesystem() which is already redirected when called. Also, you should not redirect to /dev/kmsg - I guess that was for debugging purposes.
Is it really necessary to mount the partition to find out the filesystem usage?
"btrfs filesystem show" apparently can work on devices according to [1]. But it also looks like btrfs commands are mostly used with mounted systems, so it is fine if you want to keep things like that.
Finally, you will need to use copy_exec for btrfs and blkid to the fixtrtc hook to get them included in the initramfs (although maybe blkid comes from busybox in this case, not sure).
Otherwise, looks good to me.
[1] https:/ /btrfs. wiki.kernel. org/index. php/Manpage/ btrfs-filesyste m