Odroid N2, Booting DietPi USB SSD through Petitboot, “Cannot read /tmp/…_boot_dtb_”

Creating a bug report/issue

[*] I have searched the existing open and closed issues

Required Information

  • DietPi version | 9.20.1
  • Distro version | trixie
  • Kernel version | Linux odroid 6.12.61-current-meson64
  • Architecture | arm64
  • SBC model | Odroid N2 (aarch64)
  • Power supply used | 12V 2A FULLPOWER ICP30-120-2000
  • USB SSD used | 174c:55aa ASMedia, LITE-ON 128GB SATA SSD
  • SD card used | SanDisk Ultra 16GB

Additional Information (if applicable)

  • Can this issue be replicated on a fresh installation of DietPi? Yes.

Steps to reproduce

  1. Download DietPi_OdroidN2-ARMv8-Trixie.img.xz
  2. Flash to USB SSD with balenaEtcher
  3. Switch to SPI boot (Petitboot) on the Odroid N2
  4. Plug USB SSD in and Turn on

Expected behaviour

  • Boot to DietPi directly from USB SSD through Petitboot

Actual behaviour

  • “Cannot read /tmp/usb0_usr_var_petitboot_mnt_dev_sda1__boot_dtb_”

Extra details

Petitboot status log:

  • [sda1] Processing new Disk device
  • [sda1] Parsed U-boot script from /boot/boot.scr
  • [sda2] Processing new Disk device
  • Booting NO LABEL
  • Loaded kernel image from file:///usr/var/petitboot/mnt/dev/sda1/boot/vmlinuz-6.12.61-current-meson64
  • Loaded initrd from file:///usr/var/petitboot/mnt/dev/sda1/boot/initrd.img-6.12.61-current-meson64
  • Loaded dtb from file:///tmp/usb0_usr_var_petitboot_mnt_dev_sda1__boot_dtb_
  • Performing kexec load
  • Cannot read /tmp/usb0_usr_var_petitboot_mnt_dev_sda1__boot_dtb_
  • Boot cancelled

Have tried with Petitboot version 20220317 and 20231218

Have tried with pb-usbquirks command in Petitboot

Have tried with SD Card and the result is similar: “Cannot read /tmp/mmc1_usr_var_petitboot_mnt_dev_mmcblk1p1__boot_dtb_”

Any idea why this is happening?

Ok, I managed to boot directly to USB SSD through Petitboot.

The Petitboot default paths for Kernel, Initrd, and Device tree are wrong..

I changed it to:

  • Kernel: /boot/vmlinuz-6.12.61-current-meson64
  • Initrd: /boot/initrd.img-6.12.61-current-meson64
  • Device tree: /boot/dtb/amlogic/meson-g12b-odroid-n2.dtb

It boots flawlessly after changing those paths.

However, It went back to the defaults every time it reboots.. And I needed to edit those path manually every time..

How to make those paths permanent in Petitboot?

Looking at Petitboot status log, it said: “Parsed U-boot script from /boot/boot.scr”

Maybe we could change the defaults in boot.scr? Any pointers how to do that?

Where did you made these changes? In the petitboot menu?

To make it permanent you need to edit boot.cmd and compile it into boot.scr

Yes, I made the changes manually in Petitboot menu.

I found another way to make those paths permanent. Petitboot actually looks for grub.cfg file!

So I just made /boot/grub/grub.cfg file:

menuentry "DietPi” {
  linux /boot/Image root=/dev/sda1 rootfstype=ext4 rootwait console=tty1 consoleblank=0 coherent_pool=2M ubootpart= fsck.repair=yes net.ifnames=0
  initrd /boot/initrd.img
  devicetree /boot/dtb/amlogic/meson-g12b-odroid-n2.dtb
}

That’s it..

Petitboot will pick the entry automatically and boots directly from USB SSD!

1 Like

Oh, I figured out why it’s happening.. The “fdtfile” was not set in boot.scr …

I just added a single line in /boot/boot.cmd, below “# Load addresses”:

setenv fdtfile "amlogic/meson-g12b-odroid-n2.dtb"

Then recompile it with:

mkimage -C none -A arm64 -T script -d /boot/boot.cmd /boot/boot.scr

It now boots correctly, without needing any extra config file.

edit:

Or even simpler.. Just add below line in dietpiEnv.txt

fdtfile=amlogic/meson-g12b-odroid-n2.dtb

Without needing to recompile.. Lol..

Note: On fresh install, if using the dietpiEnv.txt for setup, we’ll need to manually input the paths in Petitboot menu first. Only on the first boot. DietPi will copy the dietpiEnv.txt to /boot after that first boot:

Device: (*) sda1 ["UUID"]
Kernel: /boot/vmlinuz-6.12.61-current-meson64
Initrd: /boot/initrd.img-6.12.61-current-meson64
Device tree: /boot/dtb/amlogic/meson-g12b-odroid-n2.dtb
1 Like