Petitboot, yet another bootloader based on KEXEC

Post Reply
sshock
Posts: 55
Joined: Thu Dec 19, 2019 1:04 pm
languages_spoken: english
ODROIDs: XU4, C2, and N2
Has thanked: 3 times
Been thanked: 9 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by sshock »

tobetter wrote:
Sat Feb 05, 2022 3:00 am
Thanks and nice timing.
Could you try new Petitboot firmware (v20220204) and see the problem happens?
http://ppa.linuxfactory.or.kr/images/pe ... 220204.img
Good news, this fixes the issue with the eMMC! I am now able to boot up to Android 11 on my eMMC via petitboot.

The userscript feature is still broken though. Whenever I put anything in userscript.sh petitboot fails right after running the script:

Image

Let me know what I can do to help. I do have a USB UART kit and am happy to help in any way I can.
These users thanked the author sshock for the post:
m_ueberall (Sat Feb 05, 2022 4:35 pm)

User avatar
tobetter
Posts: 9845
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 629 times
Been thanked: 1660 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by tobetter »

sshock wrote:
Sat Feb 05, 2022 8:40 am
tobetter wrote:
Sat Feb 05, 2022 3:00 am
Thanks and nice timing.
Could you try new Petitboot firmware (v20220204) and see the problem happens?
http://ppa.linuxfactory.or.kr/images/pe ... 220204.img
Good news, this fixes the issue with the eMMC! I am now able to boot up to Android 11 on my eMMC via petitboot.

The userscript feature is still broken though. Whenever I put anything in userscript.sh petitboot fails right after running the script:

Image

Let me know what I can do to help. I do have a USB UART kit and am happy to help in any way I can.
Glad to hear eMMC problem does not happen with new version.
For the userscript.sh, do you have any OS installed in SD card?

sshock
Posts: 55
Joined: Thu Dec 19, 2019 1:04 pm
languages_spoken: english
ODROIDs: XU4, C2, and N2
Has thanked: 3 times
Been thanked: 9 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by sshock »

tobetter wrote:
Sat Feb 05, 2022 5:18 pm
Glad to hear eMMC problem does not happen with new version.
For the userscript.sh, do you have any OS installed in SD card?
Sorry for the delayed response. When testing userscript.sh, yes I did have an OS installed on the SD card. Should I try again with a fresh SD card with no OS?

User avatar
tobetter
Posts: 9845
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 629 times
Been thanked: 1660 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by tobetter »

sshock wrote:
Tue Feb 15, 2022 1:32 am
tobetter wrote:
Sat Feb 05, 2022 5:18 pm
Glad to hear eMMC problem does not happen with new version.
For the userscript.sh, do you have any OS installed in SD card?
Sorry for the delayed response. When testing userscript.sh, yes I did have an OS installed on the SD card. Should I try again with a fresh SD card with no OS?
No worries.
Well...it should not but wonder it is, and wonder it affect the script problem. I used to test clean SD card with only the userscript.sh... Which OS is installed in SD card?

sshock
Posts: 55
Joined: Thu Dec 19, 2019 1:04 pm
languages_spoken: english
ODROIDs: XU4, C2, and N2
Has thanked: 3 times
Been thanked: 9 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by sshock »

tobetter wrote:
Tue Feb 15, 2022 1:36 am
Well...it should not but wonder it is, and wonder it affect the script problem. I used to test clean SD card with only the userscript.sh... Which OS is installed in SD card?
It has Android 9 on it. I'm happy to do a test with a clean SD card with nothing else on it. It's definitely worth a shot :)

sshock
Posts: 55
Joined: Thu Dec 19, 2019 1:04 pm
languages_spoken: english
ODROIDs: XU4, C2, and N2
Has thanked: 3 times
Been thanked: 9 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by sshock »

sshock wrote:
Tue Feb 15, 2022 2:42 am
tobetter wrote:
Tue Feb 15, 2022 1:36 am
Well...it should not but wonder it is, and wonder it affect the script problem. I used to test clean SD card with only the userscript.sh... Which OS is installed in SD card?
It has Android 9 on it. I'm happy to do a test with a clean SD card with nothing else on it. It's definitely worth a shot :)
Good news, it looks like you were right. I reformatted my SD card so it has nothing except a single FAT partition with petitboot.cfg and userscript.sh, and I have been unable to reproduce the strange "Failed to launch petitboot" issue.

I do see an issue where sometimes after booting up to Android the wallpaper is gone / black and the buttons at the bottom are visible, but I can't move the mouse or click on anything. I can connect with adb shell, but it feels like it hasn't fully boot up properly. This issue is only happening about once every 10 reboots though and I'm not entirely sure it's petitboot's fault.

So I think we might be good to go for the most part. At least, I am at a point now where I can start testing a more advanced userscript.

User avatar
tobetter
Posts: 9845
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 629 times
Been thanked: 1660 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by tobetter »

sshock wrote:
Tue Feb 22, 2022 9:41 am
sshock wrote:
Tue Feb 15, 2022 2:42 am
tobetter wrote:
Tue Feb 15, 2022 1:36 am
Well...it should not but wonder it is, and wonder it affect the script problem. I used to test clean SD card with only the userscript.sh... Which OS is installed in SD card?
It has Android 9 on it. I'm happy to do a test with a clean SD card with nothing else on it. It's definitely worth a shot :)
Good news, it looks like you were right. I reformatted my SD card so it has nothing except a single FAT partition with petitboot.cfg and userscript.sh, and I have been unable to reproduce the strange "Failed to launch petitboot" issue.
Glad to hear it is.
I do see an issue where sometimes after booting up to Android the wallpaper is gone / black and the buttons at the bottom are visible, but I can't move the mouse or click on anything. I can connect with adb shell, but it feels like it hasn't fully boot up properly. This issue is only happening about once every 10 reboots though and I'm not entirely sure it's petitboot's fault.
This is very strange...are you able to grab a logs when the problem happens? dmesg or logcat if possible?
So I think we might be good to go for the most part. At least, I am at a point now where I can start testing a more advanced userscript.
Thanks, willing to hear that. I am also about to release new version after 20220204 but newer version is pretty much same as 20220204.

sshock
Posts: 55
Joined: Thu Dec 19, 2019 1:04 pm
languages_spoken: english
ODROIDs: XU4, C2, and N2
Has thanked: 3 times
Been thanked: 9 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by sshock »

tobetter wrote:
Tue Feb 22, 2022 10:47 am
sshock wrote:
Tue Feb 22, 2022 9:41 am
I do see an issue where sometimes after booting up to Android the wallpaper is gone / black and the buttons at the bottom are visible, but I can't move the mouse or click on anything. I can connect with adb shell, but it feels like it hasn't fully boot up properly. This issue is only happening about once every 10 reboots though and I'm not entirely sure it's petitboot's fault.
This is very strange...are you able to grab a logs when the problem happens? dmesg or logcat if possible?
That's a good idea. I'll try to do that next time I'll able to reproduce it.
tobetter wrote:
Tue Feb 22, 2022 10:47 am
sshock wrote:
Tue Feb 22, 2022 9:41 am
So I think we might be good to go for the most part. At least, I am at a point now where I can start testing a more advanced userscript.
Thanks, willing to hear that. I am also about to release new version after 20220204 but newer version is pretty much same as 20220204.
:ok:

brad
Posts: 1595
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 C4 HC4 N1 N2 N2+ H2 H2+ M1 (64 bit ftw)
Location: Australia
Has thanked: 178 times
Been thanked: 251 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by brad »

I came across a nice feature of booting via petitboot vs uboot.

uboot sometimes does not have enough room in allocated RAM to load larger sized kernel images or initrd images. Petitboot however has no problem booting the larger sized stuff :)

User avatar
tobetter
Posts: 9845
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 629 times
Been thanked: 1660 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by tobetter »

brad wrote:
Fri Feb 25, 2022 11:48 am
I came across a nice feature of booting via petitboot vs uboot.

uboot sometimes does not have enough room in allocated RAM to load larger sized kernel images or initrd images. Petitboot however has no problem booting the larger sized stuff :)
True...and Petitboot do not care about the address to load booing blobs which is good when booting new kernel images.

sshock
Posts: 55
Joined: Thu Dec 19, 2019 1:04 pm
languages_spoken: english
ODROIDs: XU4, C2, and N2
Has thanked: 3 times
Been thanked: 9 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by sshock »

@tobetter, I have confirmed that the petitboot,userscript setting works to download and execute a userscript.sh fetched from a remote server, thanks!

sshock
Posts: 55
Joined: Thu Dec 19, 2019 1:04 pm
languages_spoken: english
ODROIDs: XU4, C2, and N2
Has thanked: 3 times
Been thanked: 9 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by sshock »

@tobetter, any idea why fw_setenv hdmimode 480p60hz isn't working for me these days with my little monitor? I know it has worked off and on with various versions of petitboot; it would be cool if it worked in the latest one (20220204), but it doesn't. It's not that serious of an issue for me, but it is currently the only thing forcing me to have an sd card always inserted (so I can specify that in petitboot.cfg).
Last edited by sshock on Fri Mar 04, 2022 3:25 am, edited 1 time in total.

sshock
Posts: 55
Joined: Thu Dec 19, 2019 1:04 pm
languages_spoken: english
ODROIDs: XU4, C2, and N2
Has thanked: 3 times
Been thanked: 9 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by sshock »

@tobetter, your userscript.sh and userscript.sh.v1 sample scripts on ppa.linuxfactory.or.kr still have wait_for_device ${TARGET} instead of wait_for_device ${TARGET} || panic "device ${TARGET} not found".

Another small suggestion: maybe add a sleep 1 after the figlet "Up to date". As it currently is it goes away so quickly you can't see it.

sshock
Posts: 55
Joined: Thu Dec 19, 2019 1:04 pm
languages_spoken: english
ODROIDs: XU4, C2, and N2
Has thanked: 3 times
Been thanked: 9 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by sshock »

@tobetter, great news! I finally did the first full test of userscript.sh by just pointing to your sample one at http://ppa.linuxfactory.or.kr/mastering ... rscript.sh

and it worked beautifully!

User avatar
tobetter
Posts: 9845
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 629 times
Been thanked: 1660 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by tobetter »

sshock wrote:
Fri Mar 04, 2022 3:06 am
@tobetter, your userscript.sh and userscript.sh.v1 sample scripts on ppa.linuxfactory.or.kr still have wait_for_device ${TARGET} instead of wait_for_device ${TARGET} || panic "device ${TARGET} not found".

Another small suggestion: maybe add a sleep 1 after the figlet "Up to date". As it currently is it goes away so quickly you can't see it.
Thanks, it's updated just now. :)

Gozer
Posts: 14
Joined: Wed Dec 29, 2021 12:59 am
languages_spoken: english
ODROIDs: N2+ 4Go
Has thanked: 5 times
Been thanked: 0
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by Gozer »

Hello All, I updated Android Pie and experience the issue that it does not boot anymore. I understand Petitboot needs to be updated to the latest. Can I use pb-update command or it has to be done somehow manually?

I have Android on eMMC and Coreelec on SD.

Thanks

User avatar
tobetter
Posts: 9845
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 629 times
Been thanked: 1660 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by tobetter »

sshock wrote:
Fri Mar 04, 2022 3:00 am
@tobetter, any idea why fw_setenv hdmimode 480p60hz isn't working for me these days with my little monitor? I know it has worked off and on with various versions of petitboot; it would be cool if it worked in the latest one (20220204), but it doesn't. It's not that serious of an issue for me, but it is currently the only thing forcing me to have an sd card always inserted (so I can specify that in petitboot.cfg).
Let me test this sometime soon... since I'm playing with something else...

User avatar
tobetter
Posts: 9845
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 629 times
Been thanked: 1660 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by tobetter »

sshock wrote:
Fri Mar 04, 2022 3:25 am
@tobetter, great news! I finally did the first full test of userscript.sh by just pointing to your sample one at http://ppa.linuxfactory.or.kr/mastering ... rscript.sh

and it worked beautifully!
Congratulation...appreciate your suggestion and having good feature. :)

User avatar
tobetter
Posts: 9845
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 629 times
Been thanked: 1660 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by tobetter »

Gozer wrote:
Fri Mar 04, 2022 3:31 am
Hello All, I updated Android Pie and experience the issue that it does not boot anymore. I understand Petitboot needs to be updated to the latest. Can I use pb-update command or it has to be done somehow manually?

I have Android on eMMC and Coreelec on SD.

Thanks
Do you see the boot entry for CoreELEC and Android Pie? Or only CoreELEC?
What's current version of Petitboot and Android Pie?

Gozer
Posts: 14
Joined: Wed Dec 29, 2021 12:59 am
languages_spoken: english
ODROIDs: N2+ 4Go
Has thanked: 5 times
Been thanked: 0
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by Gozer »

Hello,
Last edited by Gozer on Fri Mar 04, 2022 9:50 pm, edited 1 time in total.

Gozer
Posts: 14
Joined: Wed Dec 29, 2021 12:59 am
languages_spoken: english
ODROIDs: N2+ 4Go
Has thanked: 5 times
Been thanked: 0
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by Gozer »

tobetter wrote:
Fri Mar 04, 2022 3:34 am
Gozer wrote:
Fri Mar 04, 2022 3:31 am
Hello All, I updated Android Pie and experience the issue that it does not boot anymore. I understand Petitboot needs to be updated to the latest. Can I use pb-update command or it has to be done somehow manually?

I have Android on eMMC and Coreelec on SD.

Thanks
Do you see the boot entry for CoreELEC and Android Pie? Or only CoreELEC?
What's current version of Petitboot and Android Pie?
Hello,

yes I can see both entries and the N2 will boot to CE with no problem.

I have following:
Petitboot Dev 20211112
Android 9 64 bits - odroidn2-eng 9 PQ3A.190801.002 20220222

User avatar
tobetter
Posts: 9845
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 629 times
Been thanked: 1660 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by tobetter »

Gozer wrote:
Fri Mar 04, 2022 9:50 pm
tobetter wrote:
Fri Mar 04, 2022 3:34 am
Gozer wrote:
Fri Mar 04, 2022 3:31 am
Hello All, I updated Android Pie and experience the issue that it does not boot anymore. I understand Petitboot needs to be updated to the latest. Can I use pb-update command or it has to be done somehow manually?

I have Android on eMMC and Coreelec on SD.

Thanks
Do you see the boot entry for CoreELEC and Android Pie? Or only CoreELEC?
What's current version of Petitboot and Android Pie?
Hello,

yes I can see both entries and the N2 will boot to CE with no problem.

I have following:
Petitboot Dev 20211112
Android 9 64 bits - odroidn2-eng 9 PQ3A.190801.002 20220222
Can you try after updating the Petitboot? For updating, in the command line of the Petitboot and run pb-update after udhcpc.

Gozer
Posts: 14
Joined: Wed Dec 29, 2021 12:59 am
languages_spoken: english
ODROIDs: N2+ 4Go
Has thanked: 5 times
Been thanked: 0
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by Gozer »

tobetter wrote:
Fri Mar 04, 2022 10:38 pm
Gozer wrote:
Fri Mar 04, 2022 9:50 pm
tobetter wrote:
Fri Mar 04, 2022 3:34 am
Gozer wrote:
Fri Mar 04, 2022 3:31 am
Hello All, I updated Android Pie and experience the issue that it does not boot anymore. I understand Petitboot needs to be updated to the latest. Can I use pb-update command or it has to be done somehow manually?

I have Android on eMMC and Coreelec on SD.

Thanks
Do you see the boot entry for CoreELEC and Android Pie? Or only CoreELEC?
What's current version of Petitboot and Android Pie?
Hello,

yes I can see both entries and the N2 will boot to CE with no problem.

I have following:
Petitboot Dev 20211112
Android 9 64 bits - odroidn2-eng 9 PQ3A.190801.002 20220222
Can you try after updating the Petitboot? For updating, in the command line of the Petitboot and run pb-update after udhcpc.
I just tried and it works.
Thanks 😊

User avatar
tobetter
Posts: 9845
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 629 times
Been thanked: 1660 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by tobetter »

20220317

New version 20220317 is uploaded and ready to upgrade to your ODROID-N2/N2Plus, this version have been tested by several users in this forum and tested. The firmware can be updated in the Petitboot itself by running the command 'pb-update', or you can download firmware file from spiboot-20220317.img and copy it to your SD card as spiboot.img.

What are improved:
  • The bug that eMMC is not recognized in Petitboot is also improved. - this bug have been reported already by many users and was fixed in previous version 20221222 but still in certain case or board have the same issue. New version is a lot improved... :cross finger:
  • Booting issue with USB 3.0 storage - reported by many users that certain vendor/model of USB 3.0 storage or enclouser are not able to be booted by Petitboot even if it shows the boot entry and not having an issue with the storage. This issue is resolved by adding usb-storage.quirks in the kernel command line when booting to OS in USB storage. Petitboot can manage the list of such devices and will add usb-storage.quirks=... by default. When you have a USB storage and having an issue with it in performance or stability, try to run pb-usbquirks in the command line of Petitboot. pb-usbquirks will download the list of reported USB storages through the network and update the Petitboot to add the kernel command on next power cycle.
  • Display blackout issue is a bit improved. - Petitboot was not di splayed to a screen of certain vendors or models earlier, this issue is improved by changing the display attribution in kernel and have been passed with many display devices which had the same issue.
  • Added CoreELEC specific improvement - CoreELEC team tried to manage their OS image to support multiple boards with different CPU, this makes to change a bit of features in lowlevel and a couple of changes are applied to Petitboot to support latest CoreELEC firmware.
  • Custom user script can run before Petitboot started. - This is an idea of @sshock that eMMC can be recovered with a back up image through the network. This feature is not required generic user, it would be nice feature when one wants to maintain a custom OS image to recover or reflash through the network in case the memory card needs to be recovered or reflashed. It requires a shell script skiil.
  • Using static IP address - some users had an issue of using network in order to update Petitboot or lauch Netboot Installer menus when Petitboot is not compatible with teir AP/Router. New version can set up a static IP address and use it by default when one store network configuration. For example, in order to assign IP address 192.168.1.36 and connect to the public network through a gateway with 192.168.1.1, run this commands in the shell of Petitboot. dns1 and dns2 can be changed with the one from your IP provider if you know, otherwise using open DNS servers is simple.

    Code: Select all

    fw_setenv iptype static
    fw_setenv ipaddr 192.168.1.36
    fw_setenv gatewayip 192.168.1.1
    fw_setenv dns1 8.8.8.8
    fw_setenv dns2 8.8.4.4
    
  • Probably there would be a couple more which I've added whenever a testing version is uploaded, but not recall them everything as of now.
Please note it's not necessary to update/upgrate your Petitboot if you do not have an issue with the currently installed version.

Thanks...
These users thanked the author tobetter for the post (total 3):
istanbulls (Fri Mar 18, 2022 1:42 am) • m_ueberall (Fri Mar 18, 2022 3:07 am) • rooted (Fri Mar 18, 2022 4:07 am)

User avatar
mad_ady
Posts: 10598
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4 (HC1, HC2), C1+, C2, C4 (HC4), N1, N2, H2, Go, Go Advance, M1
Location: Bucharest, Romania
Has thanked: 644 times
Been thanked: 905 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by mad_ady »

For the static ip feature are you using a default /24 netmask? Normally, the user should supply it, because it can't be guessed, and a wrong netmask can cause more networking issues.

User avatar
tobetter
Posts: 9845
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 629 times
Been thanked: 1660 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by tobetter »

mad_ady wrote:
Fri Mar 18, 2022 1:34 am
For the static ip feature are you using a default /24 netmask? Normally, the user should supply it, because it can't be guessed, and a wrong netmask can cause more networking issues.
True, so /24 is the default and most generic I think. Let's see ... :)

sshock
Posts: 55
Joined: Thu Dec 19, 2019 1:04 pm
languages_spoken: english
ODROIDs: XU4, C2, and N2
Has thanked: 3 times
Been thanked: 9 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by sshock »

I had an interesting idea that I could support secure HTTPS downloads from the userscript by putting a statically built, SSL-enabled wget (or curl) on the SD card.

So I found a static aarch64 build of curl here and put it on the SD card.

Short answer: it works! (See example userscript.sh below). There are just two gotchas I ran into:

1. Curl looks for the CA certificates in /etc/ssl/certs/ca-certificates.crt. But it's not hard to have this on the SD card and copy it.

2. The date is always wrong on boot (Jan 1, 1970), which breaks SSL cert validation. For now I've hard-coded it but I need to find a better solution. Anyone have any ideas? Maybe I should try to find a static build of ntpdate?

Code: Select all

#!/bin/sh

echo "Obtaining dynamic IP address"
udhcpc

echo "Setting CWD to /media"
cd /media

echo "Setting the date"
date 2022-03-23

echo "Copying ca-certificates"
mkdir -p /etc/ssl/certs
cp ca-certificates.crt /etc/ssl/certs/

echo "Downloading google.com to temp file"
./curl https://www.google.com/ -o /tmp/tmp.html

echo "Here is the data!"
sleep 1
cat /tmp/tmp.html
sleep 5
These users thanked the author sshock for the post:
tobetter (Thu Mar 24, 2022 7:07 am)

User avatar
mad_ady
Posts: 10598
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4 (HC1, HC2), C1+, C2, C4 (HC4), N1, N2, H2, Go, Go Advance, M1
Location: Bucharest, Romania
Has thanked: 644 times
Been thanked: 905 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by mad_ady »

For #2 - I used the poor man's "ntp" to find the time on an embedded system once (smart tv)
If you were to wget/curl a http url (or https, but ignoring certifficate issues) one of the headers returned is the server's date. You could parse it and pass it to "date".
These users thanked the author mad_ady for the post:
m_ueberall (Thu Mar 24, 2022 5:11 pm)

sshock
Posts: 55
Joined: Thu Dec 19, 2019 1:04 pm
languages_spoken: english
ODROIDs: XU4, C2, and N2
Has thanked: 3 times
Been thanked: 9 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by sshock »

mad_ady wrote:
Thu Mar 24, 2022 2:54 pm
For #2 - I used the poor man's "ntp" to find the time on an embedded system once (smart tv)
If you were to wget/curl a http url (or https, but ignoring certifficate issues) one of the headers returned is the server's date. You could parse it and pass it to "date".
Yeah, I was kinda thinking along those lines as well. It's just disappointing that in order to have secure communications we have to start by making a non-secure call...

However, the risk should be pretty small I think, especially if I'm talking to an internal server, which means it would have to be an internal attacker, and the most damage they could cause would be a DoS and then I would just end up skipping the re-image process.

And if I'm being honest, if I'm that worried about an internal attacker, DHCP is probably an even easier attack vector and with an even greater potential for abuse, especially with PXE boot enabled.

User avatar
mad_ady
Posts: 10598
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4 (HC1, HC2), C1+, C2, C4 (HC4), N1, N2, H2, Go, Go Advance, M1
Location: Bucharest, Romania
Has thanked: 644 times
Been thanked: 905 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by mad_ady »

Another idea - the n2 supports a rtc with a battery. Not sure if you can read the hw clock in petitboot...

User avatar
rooted
Posts: 9447
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 758 times
Been thanked: 480 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by rooted »

mad_ady wrote:For #2 - I used the poor man's "ntp" to find the time on an embedded system once (smart tv)
If you were to wget/curl a http url (or https, but ignoring certifficate issues) one of the headers returned is the server's date. You could parse it and pass it to "date".
That's a pretty great idea, you come up with that?

User avatar
mad_ady
Posts: 10598
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4 (HC1, HC2), C1+, C2, C4 (HC4), N1, N2, H2, Go, Go Advance, M1
Location: Bucharest, Romania
Has thanked: 644 times
Been thanked: 905 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by mad_ady »

<offtopic>
Necessity is the mother of innovation :)
Actually I had a slightly different problem to solve.
My Samsung Smart TV (H series) is rooted with sammygo and already had ntp. But the timezone was hardcoded to utc (in the linux userspace) and was difficult to change. I had a script that ran on tv power on/resume from standby that checked the current time and day of week and if it was school time would lock the TV (set all TV channels with pin enabled) untill 18:00. (yes, I'm that kind of parent!). The problem was I needed to know local time and account for daylight savings, so I grabbed the time from my router's web management page with the method described above.

If you're wondering how the parent lock worked - it did so beautifully! My kid managed to break the code by shoulder-surfing and he was surprised it was 0000 Image
These users thanked the author mad_ady for the post:
istanbulls (Fri Mar 25, 2022 3:28 pm)

phaseshifter
Posts: 3697
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,n2+2G and n2 4G
cloudshell I and shell II
N-1,,N-2,...other odroid acc`s as well..vu7 etc..
Has thanked: 67 times
Been thanked: 51 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by phaseshifter »

will we ever see petiboot on the c-if the c-2 could do it and obsly the n-2 can so why not the c-4 also i have the origanl hi sheild running on my c-4
with an rtc module and i have temp addon board think i`ll have a squizz at the wiki id like to be able to open a prompt keep it small in size maybe have a desktop link would be handy

does any body have any info or links for booting off usb on yhe c-4 would be handy
necessity the mother of all creation and invention..!!!

User avatar
mad_ady
Posts: 10598
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4 (HC1, HC2), C1+, C2, C4 (HC4), N1, N2, H2, Go, Go Advance, M1
Location: Bucharest, Romania
Has thanked: 644 times
Been thanked: 905 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by mad_ady »

There is petitboot for c4! Tobetter released early on an ODROIDBIOS.bin file that you could put on an sd card (that also had uboot). It would load petitboot and behave similarly to a hc4.
But I haven't seen interrest in the community. Perhaps he will rebuild it from the current release if it's easy...
See this thread for details: https://r.tapatalk.com/shareLink/topic? ... source=app

Multi boot and USB booting with ODROID-C4

User avatar
rooted
Posts: 9447
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 758 times
Been thanked: 480 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by rooted »

mad_ady wrote:There is petitboot for c4! Tobetter released early on an ODROIDBIOS.bin file that you could put on an sd card (that also had uboot). It would load petitboot and behave similarly to a hc4.
But I haven't seen interrest in the community. Perhaps he will rebuild it from the current release if it's easy...
See this thread for details: https://r.tapatalk.com/shareLink/topic? ... source=app

Multi boot and USB booting with ODROID-C4
There is a recent revision which is only ten days old:

http://ppa.linuxfactory.or.kr/images/pe ... /odroidc4/

phaseshifter
Posts: 3697
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,n2+2G and n2 4G
cloudshell I and shell II
N-1,,N-2,...other odroid acc`s as well..vu7 etc..
Has thanked: 67 times
Been thanked: 51 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by phaseshifter »

trying it out in the next few days...thx guys hooking an m-2 via usb when i get some cash
necessity the mother of all creation and invention..!!!

allio
Posts: 2
Joined: Fri Apr 08, 2022 8:12 am
languages_spoken: english
ODROIDs: ODROID N2
Has thanked: 2 times
Been thanked: 0
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by allio »

I am having so much trouble trying to use Petitboot on my N2 (non +).

When I received my N2 a few years ago I set it straight up with CoreELEC on MMC and never bothered with the SPI. I have a vague memory of trying unsuccessfully to boot to SPI once or twice, not getting anything on the display, and giving up. I'd now like to try a few other things with my N2 and would like the current version of Petitboot but it just doesn't work.

Essentially no matter what I do, when the DIP switch is set to SPI the N2 won't boot. No output over HDMI and the blue light stays on solid.

I have gone through the "recovery" process detailed here several times. I have used both the newest recovery image (20211112) and an older one (20200816). Each time the board successfully boots and reports that is flashing Petitboot to SPI, after which it displays the Petitboot menu of the appropriate version. I then flip the DIP switch from MMC to SPI and power cycle. This produces a failed boot with solid blue line. The boot fails whether or not the microSD and/or eMMC are inserted - if the switch is set to SPI it will not boot.

Interestingly if I set the DIP switch to MMC and boot with the same recovery image microSD inserted, the N2 boots straight to Petitboot. It doesn't reflash to the SPI memory - which means it seems to be able to detect that the same version of Petitboot is already installed to SPI and it doesn't need to reflash. So Petitboot is getting flashed to SPI - but for some reason the N2 can't boot from it.

I've found at least one person with what seems to be the same problem (towards the end of the thread). It seems like he never solved it and instead worked around his issue by simply flashing the OS he needed to MMC.

Is my board faulty? I'm not sure what else I can do.

User avatar
tobetter
Posts: 9845
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 629 times
Been thanked: 1660 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by tobetter »

allio wrote:
Fri Apr 08, 2022 8:30 am
I am having so much trouble trying to use Petitboot on my N2 (non +).

When I received my N2 a few years ago I set it straight up with CoreELEC on MMC and never bothered with the SPI. I have a vague memory of trying unsuccessfully to boot to SPI once or twice, not getting anything on the display, and giving up. I'd now like to try a few other things with my N2 and would like the current version of Petitboot but it just doesn't work.

Essentially no matter what I do, when the DIP switch is set to SPI the N2 won't boot. No output over HDMI and the blue light stays on solid.

I have gone through the "recovery" process detailed here several times. I have used both the newest recovery image (20211112) and an older one (20200816). Each time the board successfully boots and reports that is flashing Petitboot to SPI, after which it displays the Petitboot menu of the appropriate version. I then flip the DIP switch from MMC to SPI and power cycle. This produces a failed boot with solid blue line. The boot fails whether or not the microSD and/or eMMC are inserted - if the switch is set to SPI it will not boot.
Not able to judge what problem happened after flashing the Petitboot but having solid blue LED. It exaplains that the bootloader in SPI flash memory stucks and not starting Petitboot from it.
Interestingly if I set the DIP switch to MMC and boot with the same recovery image microSD inserted, the N2 boots straight to Petitboot. It doesn't reflash to the SPI memory - which means it seems to be able to detect that the same version of Petitboot is already installed to SPI and it doesn't need to reflash. So Petitboot is getting flashed to SPI - but for some reason the N2 can't boot from it.
When you have Petitboot when the boot select switch is at MMC, it starts from SD card which you flashed with the recovery image. There is a file ODROIDBIOS.BIN which is Petitboot firmware image.
I've found at least one person with what seems to be the same problem (towards the end of the thread). It seems like he never solved it and instead worked around his issue by simply flashing the OS he needed to MMC.

Is my board faulty? I'm not sure what else I can do.
When you are able to have Petitboot after the boot select switch is at MMC, let's try to run this commands which will erase all data in SPI.

Code: Select all

flash_eraseall /dev/mtd0
flash_eraseall /dev/mtd1
flash_eraseall /dev/mtd2
flash_eraseall /dev/mtd3
Then copy the recent Petitboot image v20220317 to the same SD card as spiboot.img and boot from it again. No boot select switch changes. Then you will see again that Petitboot is flashing SPI flash memory. Once the flashing is over, remove SD card first and flip the boot select switch to SPI and do power cycle. Wish this solve the Petitboot booting issue.

If it does not help, I guess SPI flash memory has some issue and cannot boot. I am not sure what happen if I do not have a serial log from it. In case SPI flash memory does not boot Petitboot and you want to use Petitboot, alternative way is to make your eMMC can boot Petitboot when the boot select switch is at MMC.
These users thanked the author tobetter for the post (total 2):
allio (Fri Apr 08, 2022 12:28 pm) • m_ueberall (Sat Apr 09, 2022 8:12 pm)

allio
Posts: 2
Joined: Fri Apr 08, 2022 8:12 am
languages_spoken: english
ODROIDs: ODROID N2
Has thanked: 2 times
Been thanked: 0
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by allio »

That fixed it! Wow. I guess the manual full erase of the SPI was needed - maybe the automatic flash process left a small area of corrupt data behind that was causing problems.

Thank you so much responding so quickly and helpfully and fixing my problem :)

User avatar
tobetter
Posts: 9845
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 629 times
Been thanked: 1660 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by tobetter »

allio wrote:
Fri Apr 08, 2022 9:16 am
That fixed it! Wow. I guess the manual full erase of the SPI was needed - maybe the automatic flash process left a small area of corrupt data behind that was causing problems.

Thank you so much responding so quickly and helpfully and fixing my problem :)
Oh...glad to hear it works. I don't know what version was installed when you purchase N2, I am sure that very first version of Petitboot was very problematic...still it might be but not bad. v20220317 would be more more stable and many display issue are resolved, I think. :)
Glad to hear from N2 1st generation user.
These users thanked the author tobetter for the post:
allio (Fri Apr 08, 2022 12:28 pm)

trwn2p
Posts: 86
Joined: Fri Oct 16, 2020 5:12 am
languages_spoken: english
ODROIDs: N2 Plus
Has thanked: 3 times
Been thanked: 13 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by trwn2p »

I upgraded to v20220317 on N2+ and now the deep black background is fuzzy and lightened somewhat. That bleeds into the DE after an OS is booted. Not good. My mon is a BenQ gw 2765 27" IPS. 3 yrs old.

petitbooterase
Posts: 15
Joined: Tue Apr 19, 2022 7:45 am
languages_spoken: english
ODROIDs: M1
Has thanked: 0
Been thanked: 0
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by petitbooterase »

I was installing the Ubuntu desktop for M1. It couldn't boot up. Following some information on the net I deleted the Petitboot. Now I can't restore Petitboot. how can I fix this, restore Petitboot in order to boot?

Thank you

User avatar
tobetter
Posts: 9845
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 629 times
Been thanked: 1660 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by tobetter »

petitbooterase wrote:
Tue Apr 19, 2022 7:47 am
I was installing the Ubuntu desktop for M1. It couldn't boot up. Following some information on the net I deleted the Petitboot. Now I can't restore Petitboot. how can I fix this, restore Petitboot in order to boot?

Thank you
I wonder how did you removed the Petitboot? What instruction did you follow up?

heritage
Posts: 12
Joined: Tue Apr 19, 2022 8:52 am
languages_spoken: english
ODROIDs: M1
Has thanked: 0
Been thanked: 0
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by heritage »

I mispoke about erasing Petiboot. I had problems booting the Ubuntu and followed the directions to erase the data in SPI. Now everything is dark and nothing is booting.

User avatar
tobetter
Posts: 9845
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 629 times
Been thanked: 1660 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by tobetter »

heritage wrote:
Tue Apr 19, 2022 8:57 am
I mispoke about erasing Petiboot. I had problems booting the Ubuntu and followed the directions to erase the data in SPI. Now everything is dark and nothing is booting.
In order to recover the SPI flash memory, please refer to the link.
viewtopic.php?p=347732#p347732

And keep posting your issue here regarding Petitboot for ODROID-M1.
viewtopic.php?f=217&t=44346

trwn2p
Posts: 86
Joined: Fri Oct 16, 2020 5:12 am
languages_spoken: english
ODROIDs: N2 Plus
Has thanked: 3 times
Been thanked: 13 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by trwn2p »

I have not received a reply on my above post. How to downgrade pboot to previous version please. Or how to fix the current version.

User avatar
tobetter
Posts: 9845
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 629 times
Been thanked: 1660 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by tobetter »

trwn2p wrote:
Tue Apr 19, 2022 5:00 pm
I have not received a reply on my above post. How to downgrade pboot to previous version please. Or how to fix the current version.
Sorry, I missed your post.
If you want to revert the version and you remember it, download the image in the link and copy it as spiboot.img to the SD card. Then the upgrade will start on the next power cycle when the boot select switch is at SPI.
http://ppa.linuxfactory.or.kr/images/pe ... /odroidn2/

By the way, for your display issue, are you able to take a photo with the version 20200317 and another one after downgrading to see how the screens are different?

trwn2p
Posts: 86
Joined: Fri Oct 16, 2020 5:12 am
languages_spoken: english
ODROIDs: N2 Plus
Has thanked: 3 times
Been thanked: 13 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by trwn2p »

back to 2021112 version deep black is back. No pics Im a clutz with phones. Thanks for simple revert procedure.

madbrain
Posts: 130
Joined: Sat Aug 05, 2017 5:40 pm
languages_spoken: English, Français
ODROIDs: XU4, N2+
Has thanked: 10 times
Been thanked: 8 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by madbrain »

Installed dev.20220317 on my Odroid N2+ . When it boots, it no longer detects a keyboard, or any storage device. I am unable to do anything with it.
At first, I thought it might be a regression with KVM compatibility. I use an Iogear GCS1104 . But I connected the keyboard directly to the N2+, and reset it, and still had the same problem. Looks like there is a problem with this release. I'm going to try to revert to the previous version with SD card.

User avatar
tobetter
Posts: 9845
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 629 times
Been thanked: 1660 times
Contact:

Re: Petitboot, yet another bootloader based on KEXEC

Post by tobetter »

madbrain wrote:
Wed May 25, 2022 12:50 pm
Installed dev.20220317 on my Odroid N2+ . When it boots, it no longer detects a keyboard, or any storage device. I am unable to do anything with it.
At first, I thought it might be a regression with KVM compatibility. I use an Iogear GCS1104 . But I connected the keyboard directly to the N2+, and reset it, and still had the same problem. Looks like there is a problem with this release. I'm going to try to revert to the previous version with SD card.
When you connect USB keyboard or mouse directly to your N2, is its LED on?

Post Reply

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 0 guests