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

Bug #1026780 reported by Paolo Pisati on 2012-07-19
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
flash-kernel (Ubuntu)
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

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
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.

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.)

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.

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

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.

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) on 2014-09-30
Changed in flash-kernel (Ubuntu):
assignee: Oliver Grawert (ogra) → nobody
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers