OpenWrt on a mini PC

Hello, I'm trying to run OpenWrt x86 on a mini PC with intel CPU and two LAN from a USB stick but is not detected on the BIOS, others LInux live OS works without any problem, does OpenWrt x86 needs any special setting on the BIOS to work?

My guess would be that your mainboard requires UEFI booting (if you can enable the legacy CSM ~= BIOS emulation, that should work as well), which is not yet available in OpenWrt, but you can apply and build the necessary changes from the pull request to support UEFI yourself.

2 Likes

@slh Thanks for the hint, I found the CSM setting on the BIOS and enable it allows me to boot OpenWrt 19.07.0-rc1 from the USB stick, now I want to install it on an internal drive, I copied the "openwrt-19.07.0-rc1-x86-64-combined-ext4.img " image to a NVMe SSD and again is not being detected.
Does this setting look ok?

Have a look at the "Option ROM execution", storage in particular.

I wouldn't be surprised if OpenWrt currently isn't prepared to support NVMe SSDs either (as they expose themselves to the OS slightly differently) - but I haven't played with those yet.

A strategy to use OpenWrt on this kind of system might be to install Debian on the main system, and then boot OpenWrt inside a container using systemd-nspawn. It's lighter weight than a VM. Warning, I have never tried it, don't know if it works, but it seems like it should.

You probably need to rebuild the image yourself, to add support for NVM, or install necessary kmod-* package, if it's available and build an initramfs with necessary modules.

You do not need an installer, to install an operating system to x86 machine, you can just create ESP and rootfs partitions manually and unpack rootfs onto the partition, booting from some linux-based live USB which supports UEFI and NVMe. The process would be similar to initial installation of Gentoo and other source based distros.

After you have installed OpenWrt, you can use chroot to get to its command line, from which you can install packages via opkg like you normally would. Then you will need to prepare initramfs with the kernel modules, needed to mount NVM ssd, or alternatively you can just use kernel+initramfs, in which case OpenWrt can sit in EFI system partition in one or two files.

Whatever you do, you will need to either rebuild the kernel, or rebuild initramfs to add kernel modules, or just use a kernel from another distribution which was build with support for your storage media and uefi boot, but if you do the latter you'd need to add kernel modules to OpenWrt installation.

Another option is to use kernel without support for NVMe, putting all your config files into initramfs along with other stuff.

I tried the UEFI image posted by uxgood in the link , it boot but stop at this point:

It boot from USB without any problems, this is the boot log

have you solve that problem?? :crazy_face:

Did you press "Enter" to write?

1 Like

got it running with rEFInd
a small how to here OpenWRT x86-64 UEFI boot = true
that is the Q'n D way

//Agge

I was annoyed by this, so I created a script that will create an EFI bootable iso and install it on a removable media.