Skip to content

Fix the kernel command line generation in OSTRee for FIT image

Description

While working on {T6729} the incorrect kernel command line generation has been discovered.

Without separate initrd file the libostree uses ostree-prepare-root binary by default for "init=" kernel commandline:

$ cat /proc/cmdline
root=UUID=ae08ad04-6d0a-4d4b-8ec4-a310deb653c3 rootwait rw quiet splash plymouth.ignore-serial-consoles fsck.mode=auto fsck.repair=yes init=/ostree/boot.1/apertis/0d45be59cf95853bdf0c0034ff67b65d1dccfdb0fb8f03879b805ee5c171f534/0/usr/lib/ostree/ostree-prepare-root ostree=/ostree/boot.1/apertis/0d45be59cf95853bdf0c0034ff67b65d1dccfdb0fb8f03879b805ee5c171f534/0

Since we don't use ostree-boot package, we have no ostree-prepare-root in our system and the boot fails back to default init (systemd).

So we have 2 choices at the moment:

  • Fix the kernel command line generation in OSTRee
  • Add the ostree-boot package and remove from initramfs our custom script-based ostree deployment selection.

For the 2-nd -- need some additional efforts for correct system startup.

Impact of bug

Low, since this only affects the platforms using FIT images (only SABRELite for now, may later affect amd64 as well) and the kernel falls back to /sbin/init anyway.

The only practical effect is that this message is printed on boot:

run-init: can't execute '/ostree/boot.1/apertis/cc7dc86689375ba4f9ea187d75825d3bc3354b920c395a8dbb1b78d0a9015852/0/usr/lib/ostree/ostree-prepare-root': No such file or directory
Target filesystem doesn't have requested /ostree/boot.1/apertis/cc7dc86689375ba4f9ea187d75825d3bc3354b920c395a8dbb1b78d0a9015852/0/usr/lib/ostree/ostree-prepare-root.

Outcomes

Management data

This section is for management only, it should be the last one in the description.

Phabricator link: https://phabricator.apertis.org/T6768

Edited by Walter Lozano