Petitboot, yet another bootloader based on KEXEC

Sholander
Posts: 39
Joined: Wed Jun 05, 2019 1:02 am
languages_spoken: english
ODROIDs: ODROID N2
Has thanked: 0
Been thanked: 3 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Unread post by Sholander » Mon Aug 12, 2019 5:09 am

From where can I download "RC3 version of Petitboot" ? The last version I have is "201907-RC1"

User avatar
mad_ady
Posts: 6401
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 150 times
Been thanked: 109 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Unread post by mad_ady » Mon Aug 12, 2019 6:01 am

Look for it a few pages back in a post from @tobetter.
@tobetter: maybe you should make it official and put it on the wiki

woodyl
Posts: 11
Joined: Mon Aug 05, 2019 2:04 am
languages_spoken: english
ODROIDs: Odroid N2
Has thanked: 0
Been thanked: 0
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Unread post by woodyl » Mon Aug 12, 2019 11:48 pm

Is it possible to set up Petitboot to automatically set the HDMI display resolution? I'm using an HDMI-to-VGA adapter that only supports up to 720p. When I boot into an OS (Arch in this case), the bootloader automatically detects the resolution so that the display works, but it doesn't work with Petitboot. Here's another idea: I know that Petitboot scans through the attached devices to find a boot.ini file. What if it first looked through all the devices to find a 'petitboot.ini' file? Then, you could set parameters to stop booting and revert to Petitboot with various options set. You could set screen resolution, e.g. That would let you start up in Petitboot without having to disconnect the device your OS is mounted on. Maybe you could reboot from Petitboot and bypass the petitboot.ini file on the reboot.

User avatar
tobetter
Posts: 3791
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 29 times
Been thanked: 130 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Unread post by tobetter » Tue Aug 13, 2019 11:30 am

woodyl wrote:
Mon Aug 12, 2019 11:48 pm
Is it possible to set up Petitboot to automatically set the HDMI display resolution? I'm using an HDMI-to-VGA adapter that only supports up to 720p. When I boot into an OS (Arch in this case), the bootloader automatically detects the resolution so that the display works, but it doesn't work with Petitboot. Here's another idea: I know that Petitboot scans through the attached devices to find a boot.ini file. What if it first looked through all the devices to find a 'petitboot.ini' file? Then, you could set parameters to stop booting and revert to Petitboot with various options set. You could set screen resolution, e.g. That would let you start up in Petitboot without having to disconnect the device your OS is mounted on. Maybe you could reboot from Petitboot and bypass the petitboot.ini file on the reboot.
Somehow display autodetection code in the Linux kernel does not work properly in the Petitboot, this issue is not fixed yet, unfortunately. I do not clearly understand the suggestion. Are you meaning to let Petitboot can set the boot configuration?

User avatar
mad_ady
Posts: 6401
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 150 times
Been thanked: 109 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Unread post by mad_ady » Tue Aug 13, 2019 1:38 pm

I think we're looking for a way to bypass resolution autodetection and force a specific resolution instead. This could be done either by hardcoding it and building a custom petitboot or by parsing a separate "petitboot.ini" config file.
I remember that c2 had a c2_init.sh file that ran in the initrd and set the manual resolution by grabbing it from the kernel command line. It was setting it via sysfs if I remember correctly. Is there something similar for n2's startup?

User avatar
tobetter
Posts: 3791
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 29 times
Been thanked: 130 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Unread post by tobetter » Tue Aug 13, 2019 1:55 pm

mad_ady wrote:
Tue Aug 13, 2019 1:38 pm
I think we're looking for a way to bypass resolution autodetection and force a specific resolution instead. This could be done either by hardcoding it and building a custom petitboot or by parsing a separate "petitboot.ini" config file.
I remember that c2 had a c2_init.sh file that ran in the initrd and set the manual resolution by grabbing it from the kernel command line. It was setting it via sysfs if I remember correctly. Is there something similar for n2's startup?
I was thinking of the way to add a new section u-boot like this in case display auto detection cannot be resolved.

Code: Select all

  1 [u-boot]
  2 hdmimode=1080p60hz
  3 
  4 [petitboot]
  5 petitboot,interface=eth0
  6 petitboot,timeout=5
  7 petitboot,console=ttyS0,115200n8
  8 petitboot,bootdevs=network,any,
  9 petitboot,autoboot=true
 10 petitboot,http_proxy=
 11 petitboot,https_proxy=
 12 petitboot,write?=true
These users thanked the author tobetter for the post:
binhex (Tue Aug 13, 2019 6:05 pm)

User avatar
mad_ady
Posts: 6401
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 150 times
Been thanked: 109 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Unread post by mad_ady » Tue Aug 13, 2019 2:26 pm

Sure, but that would be more work for you

User avatar
tobetter
Posts: 3791
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 29 times
Been thanked: 130 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Unread post by tobetter » Tue Aug 13, 2019 2:36 pm

mad_ady wrote:
Tue Aug 13, 2019 2:26 pm
Sure, but that would be more work for you
always...

woodyl
Posts: 11
Joined: Mon Aug 05, 2019 2:04 am
languages_spoken: english
ODROIDs: Odroid N2
Has thanked: 0
Been thanked: 0
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Unread post by woodyl » Wed Aug 14, 2019 2:04 am

The idea I suggested of having the petitboot.ini file would provide more options than just setting the HDMI resolution. If we could do something like that, it would avoid the necessity of hardcoding various options into Petitboot. So, my idea is that PB is now scanning the first partition of of each drive looking for boot.ini. What I'm proposing is that it would first scan the partition for petitbooot.ini, then if it didn't find one, it would go on to scan for boot.ini as usual. If it finds petitboot.ini, it could load options from there. For instance, it could set HDMI resolution, then revert back to booting Petitboot instead of booting into the boot.ini. That way, you could interact with Petiboot, check the version, etc. On reboot, you could have the option to skip petitboot.ini on the next reboot. That's just one idea. I think that people who know more about it than I do can think of some other possibilities with such a setup. The main thing is that it would provide flexibility and reduce the need to hardcode everything somebody wants to do into PB itself.

Viald
Posts: 30
Joined: Thu Aug 01, 2019 6:47 am
languages_spoken: english
Has thanked: 5 times
Been thanked: 0
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Unread post by Viald » Wed Aug 14, 2019 5:02 am

Hello.
I booted my N2 from SSD using petitboot without issue. Since few days, my N2 doesn't boot anymore.
The SSD is well detected by petitboot and both partitions are well mounted and accessible.
As usual petitboot start to boot the SSD after 10s but even after waiting few minutes, I haven't the login prompt on the console.

For sure there is something wrong during the boot process. How can I see all steps of the boot process on the console ? I always had black screen until the login prompt.

Thank you.

elatllat
Posts: 1438
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1, N2
Has thanked: 13 times
Been thanked: 28 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Unread post by elatllat » Wed Aug 14, 2019 11:28 am

Viald wrote:
Wed Aug 14, 2019 5:02 am
... How can I see all steps of the boot process on the console ?...
buy a uart cable or edit console out of boot.ini

User avatar
tobetter
Posts: 3791
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 29 times
Been thanked: 130 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Unread post by tobetter » Wed Aug 14, 2019 12:26 pm

Viald wrote:
Wed Aug 14, 2019 5:02 am
Hello.
I booted my N2 from SSD using petitboot without issue. Since few days, my N2 doesn't boot anymore.
The SSD is well detected by petitboot and both partitions are well mounted and accessible.
As usual petitboot start to boot the SSD after 10s but even after waiting few minutes, I haven't the login prompt on the console.

For sure there is something wrong during the boot process. How can I see all steps of the boot process on the console ? I always had black screen until the login prompt.

Thank you.
Which OS is in your SSD?
Can you add console=tty1 to the boot.ini on your SSD?
These users thanked the author tobetter for the post:
Viald (Thu Aug 15, 2019 2:29 am)

Viald
Posts: 30
Joined: Thu Aug 01, 2019 6:47 am
languages_spoken: english
Has thanked: 5 times
Been thanked: 0
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Unread post by Viald » Wed Aug 14, 2019 2:59 pm

Ubuntu, I'll try. Thanks

Viald
Posts: 30
Joined: Thu Aug 01, 2019 6:47 am
languages_spoken: english
Has thanked: 5 times
Been thanked: 0
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Unread post by Viald » Thu Aug 15, 2019 2:30 am

Thank you Tobetter, I can now see the boot steps and I was able to correct the issue.

karog
Posts: 22
Joined: Fri Oct 09, 2015 3:28 am
languages_spoken: english
ODROIDs: XU4,N2
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Unread post by karog » Thu Aug 15, 2019 2:34 am

@Vlald, so what was the issue? It is always helpful to others what issues may arise. So a post saying you fixed the problem is less helpful than one that states what the problem and solution was for fellow travelers, even if you may think it is unique to you. Thx

Viald
Posts: 30
Joined: Thu Aug 01, 2019 6:47 am
languages_spoken: english
Has thanked: 5 times
Been thanked: 0
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Unread post by Viald » Thu Aug 15, 2019 3:27 am

You are right. In fact, the issue comes from /etc/fstab I had added USB disk which was not plugged anymore. The system started in maintenance mode. Until I was not able to see the boot steps, I was not able to guess my mistake too ;)

Viald
Posts: 30
Joined: Thu Aug 01, 2019 6:47 am
languages_spoken: english
Has thanked: 5 times
Been thanked: 0
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Unread post by Viald » Mon Aug 19, 2019 1:31 am

No sure that this issue could comes from Petitboot. I just ask ;)

I have added 3 more USB disks for data storage only (no boot)
I have a Kernel panic at boot time when I boot with the 3 more USB disks plugged.
According the boot log, the boot disk is sda and the root partition sda2.
IMG_20190818_173901.jpg
IMG_20190818_173901.jpg (597.71 KiB) Viewed 338 times

It seems that the kernel try to recognize a partition which doesn't exist sdd2

Code: Select all

root@Capsule:/etc/modprobe.d# fdisk /dev/sdb

Welcome to fdisk (util-linux 2.31.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sdb: 4.6 TiB, 5000981077504 bytes, 9767541167 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 1B415BE1-03C3-4DB4-8250-0FD7DE09B560

Device     Start        End    Sectors  Size Type
/dev/sdb1   2048 9767541133 9767539086  4.6T Linux filesystem

Command (m for help): q

root@Capsule:/etc/modprobe.d# fdisk /dev/sdc

Welcome to fdisk (util-linux 2.31.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sdc: 4.6 TiB, 5000981077504 bytes, 9767541167 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 0B1B8626-FEFD-4215-A9B3-EDE09718E81C

Device     Start        End    Sectors  Size Type
/dev/sdc1   2048 9767541133 9767539086  4.6T Linux filesystem

Command (m for help): q

root@Capsule:/etc/modprobe.d# fdisk /dev/sdd

Welcome to fdisk (util-linux 2.31.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sdd: 4.6 TiB, 5000981077504 bytes, 9767541167 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 291DECBA-E73F-4299-A527-5F545E1D6766

Device     Start        End    Sectors  Size Type
/dev/sdd1   2048 9767541133 9767539086  4.6T Linux filesystem
If I boot without, and plug the 3 USB disks after the system has started, everything is OK.

Code: Select all

root@Capsule:/etc/modprobe.d# lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 232.9G  0 disk 
|-sda1   8:1    0   128M  0 part /media/boot
|-sda2   8:2    0   220G  0 part /
`-sda3   8:3    0   6.4G  0 part [SWAP]
sdb      8:16   0   4.6T  0 disk 
`-sdb1   8:17   0   4.6T  0 part /media/usb0
sdc      8:32   0   4.6T  0 disk 
`-sdc1   8:33   0   4.6T  0 part /media/usb1
sdd      8:48   0   4.6T  0 disk 
`-sdd1   8:49   0   4.6T  0 part /media/usb2

karog
Posts: 22
Joined: Fri Oct 09, 2015 3:28 am
languages_spoken: english
ODROIDs: XU4,N2
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Unread post by karog » Mon Aug 19, 2019 1:47 am

When you have a bunch of disks, it is a crap shoot which drive letter they will get. What is root= in your boot.ini? Are you using UUID or PARTUUID or something less reliable?

Viald
Posts: 30
Joined: Thu Aug 01, 2019 6:47 am
languages_spoken: english
Has thanked: 5 times
Been thanked: 0
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Unread post by Viald » Mon Aug 19, 2019 2:23 am

I use UUID

Code: Select all

root=UUID=e139ce78-9841-40fe-8823-96a304a09859

Code: Select all

/dev/sda1: SEC_TYPE="msdos" LABEL="BOOT" UUID="F702-39CB" TYPE="vfat" PARTUUID="03823826-01"
/dev/sda2: LABEL="rootfs" UUID="e139ce78-9841-40fe-8823-96a304a09859" TYPE="ext4" PARTUUID="03823826-02"
/dev/sda3: UUID="a607fa8c-7f6d-4388-b982-96e3e7b6edd5" TYPE="swap" PARTUUID="03823826-03"
/dev/sdb1: UUID="5d3f8c1f-0bad-4b66-8d92-8ed2567f8b21" TYPE="ext4" PARTUUID="84985b8f-347f-4ad2-8e9a-08ff683bd061"
/dev/sdc1: UUID="4e21d475-01a8-4f85-807b-b9c7f0cc4f63" TYPE="ext4" PARTUUID="ee264c45-9d2c-4564-ab93-5713782c0eee"
/dev/sdd1: UUID="0bb85373-7890-45cf-9a5c-efd8b435baf4" TYPE="ext4" PARTUUID="a9a8d95f-f741-4d83-b08a-4bdee91717de"

Viald
Posts: 30
Joined: Thu Aug 01, 2019 6:47 am
languages_spoken: english
Has thanked: 5 times
Been thanked: 0
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Unread post by Viald » Wed Aug 21, 2019 6:22 pm

In fact it's a bug from petitboot. See here for details and workaround. viewtopic.php?f=177&p=266352#p266352

User avatar
tobetter
Posts: 3791
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 29 times
Been thanked: 130 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Unread post by tobetter » Wed Aug 21, 2019 6:24 pm

Viald wrote:
Wed Aug 21, 2019 6:22 pm
In fact it's a bug from petitboot. See here for details and workaround. viewtopic.php?f=177&p=266352#p266352
Sorry...For some reason, I've missed your post here. But glad to know the trick using root=PARTUUID=... instead of root=UUID=... works.

Viald
Posts: 30
Joined: Thu Aug 01, 2019 6:47 am
languages_spoken: english
Has thanked: 5 times
Been thanked: 0
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Unread post by Viald » Wed Aug 21, 2019 6:30 pm

No problem ;)

Post Reply

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 1 guest