3.0~rc.4ubuntu4 doesn't honor bootargs from /boot/boot.script anymore

Bug #1026780 reported by Paolo Pisati
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
flash-kernel (Ubuntu)
Fix Released
High
Unassigned

Bug Description

flag@ubuntu:~$ dpkg -l | grep flash
ii flash-kernel 3.0~rc.4ubuntu4 utility to make certain embedded devices bootable

flag@ubuntu:~$ cat /boot/boot.script
        fatload mmc 0:1 0x80000000 uImage
        fatload mmc 0:1 0x81600000 uInitrd
        setenv bootargs ro rootwait elevator=noop vram=40M mem=456M@0x80000000 mem=512M@0xA0000000 root=UUID=12e1a2ac-5c4e-41b0-94e3-0a4edeae18d1 fixrtc console=ttyO2,115200n8
        bootm 0x80000000 0x81600000

flag@ubuntu:~$ sudo flash-kernel
flash-kernel: installing version 3.4.0-201-omap4
Generating kernel u-boot image... done.
Taking backup of uImage.
Installing new uImage.
Generating initramfs u-boot image... done.
Taking backup of uInitrd.
Installing new uInitrd.
Generating boot script u-boot image... done.
Taking backup of boot.scr.
Installing new boot.scr.

flag@ubuntu:~$ sudo mount /dev/mmcblk0p1 /media

flag@ubuntu:~$ cat /media/boot.scr
'V�U�8mE3��dZ�boot script�fatload mmc 0:1 0x82000000 uImage
fatload mmc 0:1 0x83000000 uInitrd
setenv bootargs ro quiet splash
bootm 0x82000000 0x83000000

notice the absence of ALL the options i added to bootargs in /boot/boot.script like console to /media/boot.scr AFTER i ran flash-kernel

Revision history for this message
Paolo Pisati (p-pisati) wrote :

infinity told me to assign it to you (ogra), blame him :)

Changed in flash-kernel (Ubuntu):
assignee: nobody → Oliver Grawert (ogra)
Changed in flash-kernel (Ubuntu):
importance: Undecided → High
Revision history for this message
Oliver Grawert (ogra) wrote :

this is expected behavior, flash-kernel 3.x now reads from /usr/share/flash-kernel/bootscrpts/* and also does not require a root= line anymore (this is hardcoded in the initrd at install and updateinitramfs time) ... i guess technically flash-kernel should migrate the old boot scripts over but sadly there is no mechanism for user created boot.scr files to override the packaged ones atm.

Revision history for this message
Loïc Minier (lool) wrote :

This is an Ubuntu specific issue when upgrading from older flash-kernel versions which had support for a custom boot script to newer ones (closer to the Debian tree), that don't offer this -- only system-wide boot script templates are supported.

In general, it's best if kernels don't require any specific cmdline args to do the right thing; flash-kernel will set the right root device typically via initrd (either setting a default root device or overriding the one from the bootloader), but doesn't currently offer a way to set extra cmdline arguments. (Such a feature would of course be desired and useful.)

Revision history for this message
Paolo Pisati (p-pisati) wrote :

People who do development change the kernel parameters often to suit their needs: call it templates or config files, but i'll always need to tweak them to add debug, to workaround a bug, to enable or disable this or that feature, etcetc.

And any hardcoded parametrs (like root= in initd) is just a bad design decision.

Revision history for this message
Adam Conrad (adconrad) wrote :

Hardcoding root= in the initramfs is completely and utterly wrong. initramfses should be generic by default. Apparently, this needs some fixing. :P

Revision history for this message
Oliver Grawert (ogra) wrote :

the hardcoding can be switched on and off through a db parameter Bootloader-sets-root:)
... the problem is that there is no way to reliably provide a boot.script input file that doesnt get overwritten on package upgrades (and loses root= again though that), since the only source flash-kernel currently accepts is the one it ships in the package...

support for /etc/flash-kernel/bootscript.d/ needs to be added so we can put permanent input files there.

Revision history for this message
Loïc Minier (lool) wrote :

flash-kernel doesn't necessarily know how to change the kernel cmdline. This is extremely platform specific and might often change with user-configured changes. Consider that flash-kernel has to support RedBoot and U-Boot based platforms and that the kernel cmdline args are in the bootloaders' config in flash. The cmdline args might have been changed by the end-user, and it's hard to patch them in place just to set root. The approach of forcing the rootfs in the initrd is at least reliable and consistent across supported platforms.

Oliver Grawert (ogra)
Changed in flash-kernel (Ubuntu):
assignee: Oliver Grawert (ogra) → nobody
Revision history for this message
Dave Jones (waveform) wrote :

Just going through the ancient bugs in flash-kernel and this is another one I'm *fairly* sure was fixed at some point in the history (although I'm unsure when). Anyway, the supported mechanism for injecting parameters into the kernel cmdline via flash-kernel is to edit the LINUX_KERNEL_CMDLINE or LINUX_KERNEL_CMDLINE_DEFAULTS parameters in /etc/default/flash-kernel.

During its run flash-kernel *should* incorporate anything specified in these variables into the kernel command line, typically by substituting these values into the u-boot script prior to running mkimage.

There are a few cases where this *doesn't* happen, but they're largely limited to those cases not using u-boot (the "Method: pi" case I added is one such example, although there the kernel command line is a trivially editable text file on the boot partition and I didn't want people being surprised by their customization being overwritten so it was a deliberate choice). Alternatively, there are some u-boot scripts in f-k that don't contain the necessary substitution points.

Given this bug hasn't seen any activity for 8 years, and I'm fairly sure it's fixed I'll set this to "Fix Released" but please set it back to "New" if this is still an issue for you (and the aforementioned variables in /etc/default/flash-kernel don't work in your case)!

Changed in flash-kernel (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.