N2 Boot Sequence

Both and to try all 3 OSes without fiddling with 1 eMMC and uSD. Now that it looks that CE can boot from USB it adds more options :slight_smile:

Sure, hope everything works flawlessly. Even myself was a bit surprised that CE can boot up from USB card reader with the uSD. :smile:
Let me keep moving a bit more to have more features.

How did you attach an USB card reader to an SD card slot? :slight_smile:

Everything goes by force😛

1 Like

I tried today to boot last nightly with new boot.ini to start from an USB port (uSD card inserted in USB adapter) via Petitboot. Could not get it to start, and got this error:

Read on /usr/var/petitboot/mnt/dev/sda1/kernel.img failed: Input/output error

Is there some more change needed to enable that?

At the same time, the same uSD installation boots via Petitboot and works OK when the card is inserted into uSD slot. The only difference I noticed is that when turned off, ethernet is still active - did not “obey” my config.ini command “wol=0”

My bad, used a Kingston USB microSD Reader. Changed it to my other (proper) Kingstone MobileLite G4 USB reader and CE boots and works from USB same as from uSD via Petitboot.
Everything is fine except my dubious hardware :slight_smile:

The only problem at the moment with petitboot is that you lose our custom changes to the bootloader which includes wol/cec/wake-sleep and some other bits, tobetter has said he will add these soon.

Yes, have found that out myself. On the other hand, no worries how is SPI switch positioned :slight_smile:

Just out of curiosity. why pettiboat?

meaning nothing negative, just curious. I am familiar with it and it being kexec based but was more concened with its lack of protecting certain resources when it comes to OS/kernel switching, and trying to add that layer of handlers to provide protection would make it a bit bulky for these types of embedded boards.

Im just asking as I 'm trying to see what i am missing with it…

Small correction! Petitboot, not Petitboat. :sweat_smile:

I am not sure what you mean by lack of protecting certain resources when it comes to OS/kernel switching**.

There has been high demand from many users who wish to manage the multiple OS installed in the different storages and boot from USB. There were a couple of suggestions and debates. Eventually, I and my workmate - Joy - picked up Petitboot which is also suggested by ODROID users, by the time I was not aware of it.

I understand many SBC users use a script or command to manage the boot devices and its priority which is not handy, but Petitboot offers UI. For ODROID-N2, it’s not optimistic to add graphical UI since it has only 8MB flash memory for complete small Linux box, but way better than a script or push/pull SD card.

Using Petitboot, it offers more flexibility to support hardware features like display and storage. I learned from ODROID that there are many display devices far away of the standard like VESA and some of them contain fake/wrong EDID. Also, some hardware storage devices, other than eMMC or SD, are not supported by a bootloader - U-boot, like SATA disk attached on PCI-e.

That’s true that introducing Petitboot make the ODROID a bit bulky, but the use cases of users are already not simple for embedded system. Building another layer of booting layer using Petitboot ask for more effort to add unsupported features for ODROID since Petitboot is designed with certain purpose for more powerful system. That’s why I had to investigate my time to read the code and add the changes to Petitboot, finally I have to complete in 8MB (Bootloader + Linux kernel + Root file system).

People in HK are also happy to see that running Petitboot on ODROID can help the demand of many people, at the same time some of them are a bit concerning a couple of different perspective. Since Petitboot is new thing and not a mandatory module which can be managable with small resources, but I am trying to spend some time to improve the features what I am expecting with Petitboot. :sweat_smile:

4 Likes

sorry for the typo. and thanx for the reply.

Protecting resources i was basically just talking about it not saving any state from the current running OS when switching as it basically just makes the switch and the new OS steps on everything as it starts up leaving some of the resources claimed by the now dead prior OS just hanging as the new OS starts up. Thats basically what i was referencing.

Its been a few years since i last looked at it so maybe some of those issues are dealt with… Over the years i have played with a number of different bootloaders and being a assemly guy wrote a few of my own but nowadays with open source availability had just kinda settled in on using U-boot and modding it to suite my needs but i agree that wihout some heavy mods it has some short falls.

I understand with the recent growth of the SBC market that moving forward there will be other requirements in flexibility for booting from a wider range of devices so i understand where your going i was just interested in understanding the thinking in this case.

On another note i would like to say i have followed HK pretty much since they appeared and have found that any of HK’s devices supplied to me to be very well made and some of the best products in those areas.

“Protecting resources i was basically just talking about it not saving any state from the current running OS when switching as it basically just makes the switch and the new OS steps on everything as it starts up leaving some of the resources claimed by the now dead prior OS just hanging as the new OS starts up.”

As far as I know Petitboot not switching between running OSes, just helps to choose which OS to start. So nothing to protect, no dead OS, etc.

I know Petitboot can boot from USB where u-boot can not, but are there other advantages over u-boot? (assuming everything gets sorted out with Petitboot at some point)

Technically U-boot also can boot from USB if proper command is given and Petitboot is also booted by U-boot. My perspective Petitboot is more than a boot manager, as I mentioned it’s already a small Linux box can have recovery or test tools which I am asking some users who have a trouble of display, ethernet and usb if they are not able to use them with a certain OS image. The current build of my Petitboot image has minimal tools even ‘vi’. So if you have a keyboard and display, you can edit ‘boot.ini’ in Petitboot without a desktop.

1 Like

I was gonna say U-boot can be made to boot from Usb as well but ya beat me to it… lol.

Adding tools to the bootloader has been a long time project of mine and its refreshing to see someone looking into that as well. Seems like most working on bootloaders never really think much about the tool end of things.
Currently i use Jtag to test and scan for things on a new board when i dump the core and for along time have trying to find a way to incorporate those abilities into the bootloader but it almost becomes more of a mini linux system for the bootloader to get that inteligence and trying to find a way to fish Jtagable data without the jtag is a huge hurdle i have not yet overcome. The idea was to be able to create a bootloader capable of scanning out a large portion of the device tree info when working on a unknown device.

Anyways thanx for your thoughts on the reasoning

I can confirm this works with nightly 0623.
CoreELEC on emmc and Debian Stretch on SD(from merveric@ Hardkernel)
Modified boot.ini from Debian Stretch with the “bootlabel” line and now i can choose what i want to boot.
So nice and super easy…and i love it!
Thank you so much @tobetter!

1 Like

Glad to hear your set up works, this make me more work for Petitboot.

If you have a chance to run another Debian distro for headless server, please try Netboot installer which install Debian from scratch to your N2. :smile:
https://forum.odroid.com/viewtopic.php?f=55&t=30869

Another update of Petitboot is uploaded.
https://forum.odroid.com/viewtopic.php?f=182&t=33873&p=260670#p260670

1 Like

thank you for this update.
i try to boot Debian Stretch from USB-Stick but this does not work.
it crashes and reboots.
Should this work and I am doing something wrong? incompatible stick maybe? (tried a slow and a breand new usb3 stick)
SD-Card in USB-Reader can boot. If i use the same image on USB-Stick it crashes.

Can you capture the logs if you have? Which image did you flash on it? I also suspect if USB stick is not supported by the Linux kernel but probably not…