View Single Post
Stskeeps's Avatar
Posts: 1,671 | Thanked: 11,478 times | Joined on Jun 2008 @ Warsaw, Poland
#8
Originally Posted by fanoush View Post
I don't get it where $root_dev in the script is and which (hardcoded?) rootfs it used for the dynamic menu. Isn't it chicken and egg problem? People can have random rootfs in internal flash (Poky, Android, Mamona, whatever) so there is no 'standard' place to install such menu in rootfs.
It's set in set_default_root_params in linuxrc - Basically the use of rootfs as the place for boot menu is "best effort" -it's either that or store it in initfs and flash every time on <Diablo systems. It's true that there's some issues if some other rootfs is in internal flash - but these can just as well contain a /etc/bootmenu.d that supporting tools may put stuff into. I would -much rather- prefer to store in initfs (without reflashing) or CAL (too little space), but this doesn't seem easily achievable on non-Diablo systems.

Also with reflashing rootfs in internal flash you'd loose such menu even if the rest of the systems on mmc is fine.
Well, there's always the possibility to have a mmc partition with boot information and such but that just complicates matters..

As for /linuxrc in rootfs, is this really used instead of /sbin/init in some systems? Maybe the code should fallback to run /sbin/init if /linuxrc is not found instead of plain reboot?
Well, the idea of linuxrc is that it's a script that runs inside the initfs, that performs the pivot_root and all the other needed stuff - whereas /sbin/init is run inside the pivot root / on the rootfs. Though - I can't imagine why people would have _LINUXRC=yes for systems that doesn't have linuxrc. I'd much rather want it to fall back to menu than try to start up /sbin/init on it's own if linuxrc fails

I've seen the use of /linuxrc as a pre-pivot script on another embedded system to allow for multiboot as well - it gives some flexibility for system developers to do things "right"

Having some workaround for the funky stuff you mention done by nokia /linuxrc in initfs should be useful though. But still, I'd like the bootmenu code to fallback to nokia /linuxrc in intfs so the system is properly initialized (see the boot() function in linuxrc, loading wi-fi module and telling dsme that the rootfs is mounted can prevent some surprises even in your random rootfs)
In my "first attempt" at a linuxrc for Deblet, I do many of the things needed to boot a proper system atleast - I don't really want it to load wifi module for instance as we just remove it later. I do however tell dsme that rootfs is mounted and such though.

Thanks for the constructive comments - I'll see what I can do to make the patch a little more sane.