GNOME Bugzilla – Bug 707192
ostree-prepare-root fails when ostree=/path is last in cmdline
Last modified: 2013-09-02 21:08:07 UTC
ostree-prepare-root fails whenever I have the ostree=/path parameter last in my kernel commandline. It boots fine when appending *anything* manually. The error message that gets reported claims that the ostree root could not be found, giving /path followed by a \n. Appending anything to the kernel command line will remove the bogus \n from path and the installation boots fine.
Created attachment 253737 [details] [review] prepare-root: Fix ostree= kernel argument at end (glibc version specific?) Extracting the code for parse_ostree_cmdline() and running it on some test input (on RHEL6.4 glibc), I can reproduce the odd behavior from getline() where it apparently returns the size of the default malloc buffer in the size output, and some non-zero value. This behavior would be OK except that it breaks the logic for stripping off the trailing newline, which in turn breaks booting because we return "ostree=foo\n". This has worked so far in gnome-ostree because syslinux apparently injects initrd=/path/to/initrd as a final kernel argment. Anyways, we don't handle NUL characters here in /proc/cmdline, so let's just call strlen () to be safe.
*** Bug 707312 has been marked as a duplicate of this bug. ***