** Description changed:

+ [ Impact ]
+ 
+ The initramfs can fail to build correctly (or completely, e.g. the
+ compression step can fail), but no error is reported which can result in
+ subsequent stages (e.g. flash-kernel) installing broken boot assets.
+ This can potentially result in failure to boot the system.
+ 
+ [ Test plan ]
+ 
+ This is purely for the ubuntu-raspi-settings portion:
+ 
+ * On a memory constrained model (e.g. Pi Zero 2W or 3A+), boot the Ubuntu 
resolute server image
+ * Attempt to rebuild the initramfs:
+ * sudo dracut --force /boot/initrd.img-$(uname -r) $(uname -r)
+ * Observe OOM as in zstd and failure (although exit code will be 0 if the 
dracut task is not yet fixed)
+ * If the /boot/initrd.img-$(uname -r) is successfully written, its size will 
be minimal (a few hundred KB)
+ * sudo apt install -t resolute ubuntu-raspi-settings
+ * sudo reboot
+ * sudo dracut --force /boot/initrd.img-$(uname -r) $(uname -r)
+ * Observe no OOM
+ * Check /boot/initrd.img-$(uname -r) is slightly north of 60MB in size
+ * sudo flash-kernel # to install the freshly made initrd
+ * sudo reboot
+ * Ensure system boots successfully
+ 
+ With the card in another machine:
+ 
+ * Shrink the boot partition to 256MB (I'll omit the steps for brevity as 
they're a bit involved -- let me know if anyone wants these included)
+ * Boot the card on the Pi again
+ * sudo flash-kernel # install second copy of rebuilt initrd
+ * Ensure this step succeeds without running out of space
+ 
+ [ Where things could go wrong ]
+ 
+ Tweaking dracut always carries the risk of breaking boot. The ubuntu-
+ raspi-settings change is obviously limited to Pi models so for *that*
+ portion of the SRU we can limit testing to Pi models only. The test plan
+ includes a step checking that the boot still works to guard against
+ failures.
+ 
+ One potential concern with lowering the compression level on the initrd
+ is that it becomes too large to fit two copies of it onto the boot
+ partition. This doesn't affect anyone with a modern install (noble
+ onwards) which came with a 512MB boot partition, but upgraders from
+ jammy have a 256MB boot partition. This case is also guarded against in
+ the test plan.
+ 
+ [ Original Description ]
+ 
  This is a follow-on from LP: #2155094 and I'm re-attaching the serial
  log output from that bug. The Pi Zero 2W in this case boots successfully
  under kernel 7.0.0 rev 1009, but when trying to boot rev 1011 the rootfs
  doesn't appear and the system falls back to rev 1009. Relevant portion
  of the attached log:
  
  [    0.495248] mmc0: host does not support reading read-only switch, assuming 
write-enable
  [    0.495302] PM: genpd: Disabling unused power domains
  [    0.497446] Disabling rootwait; root= is invalid.
  [    0.498905] /dev/root: Can't open blockdev
  [    0.499808] VFS: Cannot open root device "LABEL=writable" or 
unknown-block(0,0): error -6
  [    0.501568] Please append a correct "root=" boot option; here are the 
available partitions:
  [    0.503467] List of all bdev filesystems:
  [    0.503553] mmc0: new high speed SDXC card at address 5048
  [    0.504435]  ext3
  [    0.505402]  ext2
  [    0.506422]  ext4
  [    0.507347]  squashfs
  [    0.508242]  vfat
- [    0.509151] 
+ [    0.509151]
  [    0.510958] Kernel panic - not syncing: VFS: Unable to mount root fs on 
unknown-block(0,0)
  [    2.014089] CPU: 3 UID: 0 PID: 1 Comm: swapper/0 Not tainted 
7.0.0-1011-raspi #11-Ubuntu PREEMPT(lazy>
  [    2.023485] Hardware name: Raspberry Pi Zero 2 W Rev 1.0 (DT)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2157789

Title:
  [SRU] Dracut silently produces truncated initramfs with constrained
  RAM

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dracut/+bug/2157789/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to