Petitboot on Odroid HC4 forgets Debian boot option

Jeremy Kerr jk at
Sat Jan 22 13:45:55 AEDT 2022

Hi Hubert,

> A little bit of success on creating an own grub.cfg in sda1 to show
> up in petitboot.
> I have created the directory grub under /boot/grub (it did not
> exist). I have
> created the file grub.cfg with the following content
> menuentry "Debian Parameters like ui" {
>         linux /boot/vmlinuz
>         initrd /boot/initrd.img
>         devicetree /boot/devicetree.dtb
>         root=/usr/var/petitboot/mnt/dev/sda1
> }

OK, a couple of notes on that:

 - you may have confused the root= grub variable with the kernel
   command-line parameter. At the moment, you're not passing any kernel
   command-line parameters, as they need to go on the linux statement.

   Something like:

      linux /boot/vmlinux root=/dev/sda1 debug

 - the grub syntax in petitboot doesn't support the 'devicetree'
   statement - unless the odroid folks have added it in their own tree.
   If there's a need for this, I can definitely add it to the petitboot
   code, but it might be a while before the odroid folks pick up those

   However, it's not usually required to pass a devicetree - the process
   of booting into the new kernel will just use the device tree as-is
   from the already-running petitboot environment.

So, try something like this:

    menuentry "Debian Parameters like ui" {
            linux /boot/vmlinuz root=/dev/sda1
            initrd /boot/initrd.img

If you do need the custom device tree, you could also switch to a
different config file type - there's a 'native' format that allows
setting the devicetree. In /boot/petitboot.conf in your root filesystem:

    name Debian
    image /boot/vmlinux
    initrd /boot/initrd
    args root=/dev/sda1 debug
    dtb /boot/devicetree.dtb

but try without, you might find that the grub config with no
'devicetree' statement works fine.

> success. I have also tried to create several entries to test various
> options but found that Petitboot only goes for the first menuentry it
> finds in the grub.cfg and then stops parsing. Could this be the case?

Petitboot should definitely be parsing all of the menuentries; if you
can send the config file you've created, I can take a look.

Also, see if the pb-discover.log has any details. Depending on the
odroid setup, you may be able to do something like:

    nvram --update-config=petitboot,debug?=true

- this will make the log more verbose.

then if you want to disable:

    nvram --update-config=petitboot,debug?=

> ------------------------------------------------------------
> I have a question regarding the list of bootable entries. Just to
> understand
> it:
> You mentioned that petitboot itself does not hold any entries but
> takes them as it finds these in the various partitions. The thing is,
> my Odroid came with options to install Debian bullseye, Debian buster,
> Ubuntu and two more I think. So where were these entries stored? And
> after the installation of Debian all options were gone. Isnt this
> strange?
> -----------------------------------------------------------

Was there any storage device already present on the device as shipped?
It's definitely possible to create a mostly-empty filesystem with just a
config file that provides a couple of boot options that netboot various
installer images.

One the installer runs though, it may overwrite the block device(s),
erasing those default configs.



More information about the Petitboot mailing list