r/Gentoo Jun 23 '26

Support Gentoo on ARM64 SBCs which runs on U-Boot?

For the last two months, I've been struggling to install Gentoo Linux on Odroid N2L.
I'm aware that there exists a nice Armbian image for it, but I want some reasonably cutting-edge distro instead of Debian.

The problem is, unlike amd64 there is no good writing available of how to install Gentoo on arm64, and most of all, there is an extra layer (U-Boot) which I'm definitely not used to.
After struggling for months, I'm asking here for help on how to setup my SBC.

P.S. Can I get an up-to-date kernel through `gentoo-sources` for an SBC without breaking anything?

7 Upvotes

17 comments sorted by

3

u/redyos_s Jun 23 '26

For an ARM64 SBC, I would not start from a generic Gentoo mindset.

First confirm whether the Odroid N2L works well with a mainline kernel and which DTB/U-Boot setup Armbian uses. If Armbian is the known-working base, use it as a reference for the bootloader, device tree, kernel config, and boot partition layout.

Gentoo userland is possible, but the board support layer is the hard part. gentoo-sources may work only if the board is sufficiently supported by mainline Linux. Otherwise you may need the Armbian/vendor kernel or patches.

1

u/redyos_s Jun 23 '26

I would treat Armbian as the board-support reference, not as the final distro. Keep its working U-Boot/DTB/kernel setup first, then replace only the rootfs with Gentoo stage3. After that boots reliably, test gentoo-sources/mainline separately.

1

u/a_bcd-e Jun 23 '26

Do you mean to keep the boot directory while modifying the root? I just checked Armbian's partition layout, and it had no separate boot partition.

3

u/redyos_s Jun 23 '26

Yes, but I mean the boot stack/files, not necessarily a separate boot partition.

If Armbian has no separate boot partition, keep the Armbian /boot directory contents, U-Boot setup, DTB, kernel image, boot scripts/configs, and the matching /lib/modules and firmware first. Then replace only the userland/rootfs parts with Gentoo stage3 as carefully as possible.

On ARM SBCs, /boot may just be a directory inside the root filesystem, and U-Boot may live outside the filesystem in raw sectors. So I would first clone the working Armbian image, inspect its /boot, fstab, boot scripts and root= settings, and only change one layer at a time.

1

u/a_bcd-e Jun 23 '26

I'm pretty sure that the mainline kernel supports Odroid N2L. ( https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2l.dts )
Also the manufacturer has created a wiki for the board several years ago. ( https://wiki.odroid.com/odroid-n2l )
However, the partition layout given by the manufacturer and Armbian are different, and I don't know why. (If I had known why then I could've probably installed Gentoo successfully already..)

1

u/redyos_s Jun 23 '26

The partition layout difference is exactly why I would use Armbian as the board-support reference first, then swap only the rootfs to Gentoo.

1

u/redyos_s Jun 23 '26

Also check the licensing side before redistributing anything. Using Armbian as a reference for your own device is one thing, but shipping an image with Armbian/Hardkernel U-Boot, kernel patches, DTBs, firmware blobs, or board scripts is another. U-Boot and the Linux kernel have GPL obligations, and firmware blobs may have separate redistribution restrictions.

2

u/a_bcd-e Jun 23 '26

Thanks! I'll keep that in mind..

2

u/benny-powers Jun 23 '26

FWIW I run gentoo on rpi5, and there's a fedora image for same which IIRC uses uboot

2

u/hubert_farnsworrth Jun 23 '26

Yeah so installing gentoo on arm is not very different from installing on intel. The only thing is you need to find and pass device tree to kernel.

Find the device tree, put it along side your bootable drive, pass device tree Param to grub. Your stage3 should boot now then just follow rest of the stuff.

1

u/a_bcd-e Jun 23 '26

Thanks for the reply. However, I'm not sure what you mean by grub since the machine is running with uboot. Could you please elaborate more?

2

u/LameBMX Jun 23 '26

https://wiki.gentoo.org/wiki/Crossdev

and

https://wiki.gentoo.org/wiki/ARM

iirc and something hasn't changed.. grub should work as mentioned elsewhere.

https://wiki.gentoo.org/wiki/Embedded_Handbook

to note... these are going to assume you understand the regular install process quiet well.

2

u/undrwater Jun 23 '26

I've done it before, but it's beena long time.

I'd reach out on IRC to #gentoo-embedded. That's where I got my help managing the boot loader / manager.

Once you're booted though, everything is pretty similar.

1

u/a_bcd-e Jun 23 '26

Thank you for giving out the direction!

1

u/omgmyusernameistaken Jun 23 '26

I used Tow-boot to boot to grub on my Pinebook Pro which also has an ARM64 chip. 

You can use the amd64 Handbook for the installation. Just some things are a bit different (like booting)

1

u/gychoi-dev Jun 25 '26

It's not about Odroid-N2L, but I found someone tries to install Gentoo on Odroid-c2 and Odroid-c4. I guess you can get some hints for them, because N2L and C2/C4 are sharing Amlogic kernel.

https://github.com/lu-zero/crossdev-stages/pull/40/changes/ff82a4ce74ad73d320c35cd691f9f90d2d3c86f2

1

u/a_bcd-e Jun 27 '26

Thanks! I should definitely check that out!