Good day to all, is there anyone booting dietpi on the micro SD card in odroid n2 via petitboot with or without emmc attached with other OSs. Also please let me know how to do it. I already have coreelec and android pie in emmc. I tried by editing env.text and creating grub file in boot folder as suggested in the forum but booting gets stuck in command line. N2 identify SD card as mmcblk1p1 while dietpi says mmcblk0p1. Dietpi boots well in emmc mode only when nothing is attached. Please help. TIA.
Generally, our /boot/boot.scr supports petitboot. Looks like it is a boot priority issue? If SD card + eMMC are both attached, how do you select the OS to boot?
Why GRUB? Do you use it as secondary bootloader after petitboot, to have a boot menu or so? I mean petitboot itself has a boot menu as well.
Two operating systems on the same eMMC? How do you choose which one to boot? You have one boot partition with an env.txt and a boot.scr or so, maybe the kernel and initramfs images, and then two partitions for CoreELEC and Android Pie or so?
Dietpi image for the odroid N2 boots only in emmc mode ( but not in petitboot mode unless you edit the env.text and create a grub file as suggested by one of our forum member ) and that too from a usb drive with or without emmc module attached and from sd card without emmc module in emmc mode ( no boot when emmc module is attached) You must be very aware of petitboot boot in odroid N2 for multi boot and that’s what I’m using for selecting which OS to boot. I have coreelec and android on the same emmc module done with gparted and ubuntu with dietpi on the same usb flash drive done with disk utility. I’m able to boot from petitboot any OS I intend to. I couldn’t boot dietpi from micro SD card with or without emmc attached in petitboot because dietpi completely lacks the support for petitboot multi boot. Solid blue LED in emmc mode with emmc and micro sd card attached. Boot failure in petitboot with emmc and micro SD card. Dietpi is completely ignoring the micro SD card and looking into emmc for it’s root booting files which is a totally wrong destination and hence boot failure. What changes should I make in the dietpi image to make it correctly identify the boot folder in micro sd card. Thank you.
As said, DietPi does generally support petitboot. I can boot my Odroid N2+ with petitboot, with DietPi on SD card, eMMC, as well as USB. If multiple are attached, the boot priority matters, but I can select and successfully boot any of them from the boot menu, like I can select and boot any of them from U-Boot console, when interrupting auto-boot.
But whatever you do, you need to load the /boot/boot.scr from the DietPi partition, to get the right dtb+kernel+initramfs image paths, cmdline entry and all that. This is probably not done the way you/petitboot does multi-boot, and would then be the reason why you need to edit the boot config files it does actually load.
I am still confused about the GRUB file. You use petitboot, while GRUB is a different bootloader, which, AFAIK does not support the Odroid N2 directly. I guess you will need to show more in detail, which boot configs/scripts petitboot loads, when you select a certain drive and partition/distro in its boot menu. It sounds like there is a single boot script (which loads this env.text) for all of them? On which partition and path is this env.text located? Is there a boot.scr or boot.ini in the same directory?
Odroid N2, Booting DietPi USB SSD through Petitboot, “Cannot read /tmp/…_boot_dtb_” .
Please have a look at this topic.
Ah thanks for linking this. Indeed some changes in our base boot script caused the petitboot workaround which applied the fdtfile variable to be missing. Fixed with Odroid N2/HC4: fix petitboot workarounds · MichaIng/DietPi@60f95ca · GitHub.
Image build is running: DietPi-Build · MichaIng/DietPi@60f95ca · GitHub
Can be found here once done: Index of /downloads/images/testing
nice, you read and replied to my posts. please suggest a way to boot from micro sd card in petitboot when the emmc module is also in N2.
You can explicitly select the SD card in the petitboot boot menu, isn’t it? If it does not show up, maybe try to rescan for boot media.
Yes, dietpi as no label showup in the petitboot menu but when selected boots and get stuck in the command line saying mmcblk1p1 not found because it looks for the root file system in emmc, ignoring the micro SD card and results in boot failure. But boots fine from the usb even with emmc attached with appropriate edit in the env.text file.
That looks like petitboot is still replacing the root=UUID=... in our cmdline with the device path, its weird broken default behavior. setenv rootuuid "true" in our boot.scr should actually prevent this.
As you noted earlier, petitboot has swapped mmcblk0 and mmcblk1 device names for eMMC and SD card compared to mainline Linux, hence if it enforces its device paths onto the cmdline, Linux will attempt to mount the wrong partition. I do not understand in the first place why petitboot just overrides the root= entry chosen by the admin/distro by default. However, setting the rootuuid variable luckily disables this malicious behavior, at least for me. So even with our new test image, this still happens for you?
Please tell me what changes to be made in the latest image apart from vlix mentioned in that topic so that dietpi boots from petitboot with emmc module attached either from micro sd card or from usb. Even armbian could not be booted from petitboot. I have the latest version of petitboot.
Please verify first that you really tried it with the new image I linked above, which should show up with UUID e0e87bdf-15ad-4253-8d32-e21a94f21cab in the petitboot boot menu. That should work OOTB, without any further modification, it does for me.
Many thanks michalng. Problem solved. Now it’s booting via petitboot from the micro sd card even after I created partitions for it to sit with other OS and with the emmc module attached in odroid N2. Another thing is NO LABEL entry in petitboot boot menu which should show up as DIETPI. why is that?
Great!
We simply do not add a partition label, but we could do that.
Please tell us how to do that. Menu entry name will be nice to see and boot the OS we intend to in case of multi boot. Thanks once again.
When you boot the system, please try:
tune2fs -L DIETPI "$ROOT_DEV"
This adds a filesystem label. If this is what petitboot shows in the list, we can apply this to all out images by default.
Sorry it didn’t work. tune2fs: not found is the reply.
Try
sudo tune2fs -L DIETPI "$ROOT_DEV"
in petitboot shell or in DIETPI terminal?
In the DietPi/Linux terminal.