Buildroot compilation

Hello,
I have successfully compiled and running openwrt version x86-64.

I went with a stable version.
[LuCI openwrt-23.05 branch (git-24.073.29889-cd7e519)]/ [OpenWrt 23.05.3 (r23809-234f1a2efa)]

My questions is if I compile with a existing stable kernel and not trunk why do I get kernel conflicts and programs wont install when I am trying to install software via luci?

You will get that whenever your personal build diverges -at all- from the default (kernel-) config, as the kernel config itself is part of the declared packaging ABI.

Either use the exact OpenWrt build config (and repo state) - or build everything you (might) want to install yourself (ideally via =y), the later will be much easier/ quicker to do.

Thanks for the reply, I think I understand. Since I added network cards that weren't included in the original config. It changes the signature.

So I guess, I will recompile. Some software does install but a couple fail.

Aren't the network cards/drivers in OpenWRT, or just not in the default image ?

[How-To] Compile OpenWrt x86 and Keep Full Compatibility With Official Kernel Packages

I recently rebuilt my OpenWrt x86 image and needed to keep compatibility with all official repository packages, including kernel modules (kmods).
This method preserves the exact kernel ABI, so LuCI and opkg can install every package without “kernel version mismatch” errors.

This is the cleanest and safest way to build a custom image while still using the official OpenWrt repo.


Steps

1. Clone the exact release

git clone https://git.openwrt.org/openwrt/openwrt.git
cd openwrt
git checkout v24.10.4

2. Update and install feeds

./scripts/feeds update -a
./scripts/feeds install -a

3. Use the official build config

Download the official config directly:

wget -O .config \
https://downloads.openwrt.org/releases/24.10.4/targets/x86/64/config.buildinfo

If you open config.buildinfo, you will see the kernel used for this target:

kernel - 6.6.110~484466e2719a743506c36b4bb2103582-r1

The important part is the vermagic hash:

484466e2719a743506c36b4bb2103582

4. Load defaults and adjust configuration

make defconfig
make menuconfig

Do not change any <M> entries to < >, as that removes modules and changes the kernel ABI.
If you want a driver included in your image, use <*> instead — this does not break compatibility. You can add packages, but its simpler to do it from gui after first boot.

5. Confirm kernel ABI matches official repo

make target/linux/{clean,compile}
find build_dir/ -name .vermagic -exec cat {} \;

If it prints:

484466e2719a743506c36b4bb2103582

…then your custom image is fully compatible with all official packages and kernel modules from the OpenWrt repository.

6. Build your image

make download && make -j5


Result

  • Full LuCI/opkg access to all packages

  • Kernel modules install without errors

  • ABI/signature checks pass

  • Completely custom x86 image with zero repo compatibility issues

Full credit to the original write-up:
https://hamy.io/post/0015/how-to-compile-openwrt-and-still-use-the-official-repository/

1 Like

try this https://github.com/openwrt/openwrt/pull/20866/files

This topic was automatically closed after 25 hours. New replies are no longer allowed.