Skip to content
Contents
GuidesOpenWrt

Moving OpenWrt from x86 to ARM: check the ABI, packages and kernel modules

Migrate configuration from an x86 router to an ARM device: the LuCI web interface may continue to display normally, but the actual business-processing program may fail to start. Before copying files, separately verify CPU capabilities, currently running kernel, user-space ABI, and backend build environment. A 64-bit CPU does not imply that 64-bit user-space is being run; and even if both are ARM-based, this does not guarantee that the two binary packages are interoperable.

Migrate configuration from an x86 router to an ARM device: the LuCI web interface may continue to display normally, but the actual business-processing program may fail to start. Before copying files, separately verify CPU capabilities, currently running kernel, user-space ABI, and backend build environment. A 64-bit CPU does not imply that 64-bit user-space is being run; and even if both are ARM-based, this does not guarantee that the two binary packages are interoperable.

Verify one identity record for the old device and one for the target device, as well as a read-only executable file copy on the maintenance computer.

Record system identity on the old device and the target device respectively.

Execute the following on the SSH terminal of each router separately, and indicate the device ownership for each result:

ubus call system board
uname -m
command -v opkg
command -v apk

Record the firmware release version, target platform, and kernel version. uname -m is the machine architecture reported by the kernel and cannot substitute evidence of user-space ABI. When using opkg as the package manager, query again:

opkg --version
opkg print-architecture

When using APK, query:

apk --version
apk --print-arch

The former lists allowed package architectures and priorities, while the latter outputs the default package architecture; this information is used to match the firmware's software source. It does not guarantee that any file with a matching name can run. When an option is not available, refer to the local help; retain unknown values.opkg command definitionandAPK global optionsQuery basis provided.

OpenWrt Isolation Experiment SSH Output

Kernel architecture, APK package architecture, and the installed BusyBox on x86/64 test machine; a separate copy must be obtained for the target device during migration.

Static check of user-space and backend ELF

Obtain a read-only copy of /bin/busybox from the old device and the target device, and also obtain a copy of the backend files to be migrated. Record the source device, package, and version for each copy. The following operations are performed on a workstation already maintaining GNU Binutils, where file names refer to local copies—note that there is no requirement to run x86 programs on the ARM router.

readelf -h ./old-busybox
readelf -h ./target-busybox
readelf -l ./target-busybox
readelf -h ./candidate-backend
readelf -l ./candidate-backend
readelf -d ./candidate-backend
readelf -A ./candidate-backend

These options respectively read the ELF header, program header, dynamic section, and architecture attributes, without launching the checked program. The path must be replaced with your own copy; if readelf does not recognize the file, first determine whether it is a script, compressed archive, or another format, and do not proceed to infer the bitness.GNU readelf documentationDescribes the reading results of various types.

First compare Class, Data, Machine, and Flags: is the user-space sample ELF32 or ELF64? What machine type and byte order is being used? Then examine the INTERP entry in the program header to determine the loader being pointed to, and inspect the NEEDED entries in the dynamic section to identify the required shared libraries. ARM architecture attributes may also affect compatibility; do not assume compatibility based solely on the presence of "arm" in the file name.

Backend configurations should be replaced with those corresponding to the target machine type. Even if the machine type matches, mismatches in the loader, libc, or ABI still require a package specifically adapted for this firmware; do not mask such issues by arbitrarily creating symbolic links for the loader. The absence of an INTERP does not automatically imply "fully static and compatible"—this must be verified in conjunction with file type, dynamic sections, and build documentation. BusyBox is merely a user-space example; the backend and its plugins must be examined separately, and conclusions drawn from a single file cannot be generalized to the entire system.

Docker exec format error: which file actually ran?

Keep the failed container. Replace gm89-abi with its name. Inspect the recorded image ID so a moved tag cannot mislead you. The first line describes the daemon host, which may differ from your workstation.

docker info --format '{{.OSType}} {{.Architecture}}'
id=$(docker inspect --format '{{.Image}}' gm89-abi)
echo "$id"
docker inspect --format '{{.Path}}' gm89-abi
docker image inspect --format '{{.Os}} {{.Architecture}}' "$id"

Docker · Linux x86_64 · Alpine 3.21 · /bin/true

This isolated x86 Linux control matches x86_64 to amd64. The test entry point /bin/true exits normally with code 0. A service must also stay up.

On ARM, choose a native image if you have amd64 without emulation. Selecting a platform cannot convert a binary. If platforms match, follow Path through overrides and mounts. For an interpreter, check the script it opens.

Inspect a copy using file and readelf -h for ELF Machine and bitness. Check script headers, line endings and the interpreter inside the image. Keep the first error as missing files and permissions can give different messages.

Save the original digest and mounts. Test a real read in a separate instance with independent data. Restore the previous image and settings on failure. Avoid concurrent writes to the same volume.

Container storage on OpenWrt

Separate program dependencies from configuration migration.

First, verify the target architecture has a corresponding version by checking the official project release record or the OpenWrt package record. The script itself may be architecture-agnostic, but the interpreter, extension modules, and any externally called programs must still be compatible. Packages involving kmod also require verification of kernel build dependencies; identical CPU architecture does not guarantee kernel module compatibility.

Do not perform directory overwrites during configuration. Verify each item individually: network interface name, listening address, file path, user permissions, and backend version-supported options. Bridge names and storage paths from old devices may not hold on new devices. First, list in maintenance records as "transferable", "requires rewriting", or "pending confirmation". Do not guess and modify on-the-fly while the target device is undergoing network connectivity tasks.

Complete acceptance through business operations performed on the target device.

Static check passes, indicating no mismatches of the aforementioned types were found. True migration success must still be verified on the target device to confirm service stability, and original business requests must be repeatedly performed from the same LAN client. Record input, expected result, and actual result. Only --version execution or LuCI display is insufficient for acceptance.

If the loader, dependencies, or kernel conditions are not confirmed, halt at the step of obtaining the correct build. Subsequent installations should be scheduled during independent maintenance windows, preserving configuration and recovery procedures for available devices; upon verification failure, restore original device operations to carry business, without repeatedly forcing reinstallation to expand fault scope.

How to Choose OpenWrt Hardware for Plugins and Containers

Package architecture mismatch: compare the archived arch field and candidate origin

Read the package architecture on the target router running apk. If you already have an APK, copy it to a private temporary directory and inspect the name, version and arch declared inside it. Check whether the matching feeds on the router offer that package. ARM or x86 in the filename alone cannot settle compatibility.

Run these commands in the test directory. Substitute the actual downloaded filename and replace the name after policy with the name declared inside the package. The adbdump command reads archive metadata without executing the packaged program.

apk --print-arch
apk adbdump ./bsdtar-3.8.1-r2.apk | grep -E '^  (name|version|arch):'
apk policy bsdtar

The isolated OpenWrt guest compares the arch in the bsdtar file with the local package architecture and the repository offering that version.

In the 25.12.6 x86/64 control, both architecture values were x86_64. The policy output also listed the installed copy and the official index for that release. If the archive declares a different specific architecture, look for a compatible build in the feeds for the target. A noarch script package can still require an architecture-specific backend. If architectures match but installation fails, check release, target, dependency versions and signing. After a successful installation preview, test the actual service. Keep the original feeds and working service until the replacement passes.

Move from opkg to apk on OpenWrt 25.12

Which settings can move from an ARM router to an x86 router?

Leave the old router in service while preparing the replacement. Manage the new machine through a separate wired connection. Keep the LANs apart. A bridge called br-lan may have completely different physical ports on the two systems.

On the old router generate a configuration archive under System → Backup / Flash Firmware. Download it and check that it opens. In SSH inspect the file list and installed packages. The last command below is for apk. With opkg, save the output of opkg list-installed instead.

ubus call system board
sysupgrade -l
apk list --installed

Network, DHCP and firewall paths in the backup list on the virtual router.

The filtered example from OpenWrt 25.12.6 x86/64 shows three paths scheduled for backup. The list does not prove that external databases are included or identify the ports on the replacement. Save external data and the software inventory separately. Protect credentials in the archive.

Keep one management port connected. Test the other ports one by one and watch link state in LuCI. Record physical position, kernel device, bridge and purpose, then recreate WAN, LAN and VLAN membership by purpose.

From the old package list, select services you use. Check the new build for each interface, backend and driver. Retain the old machine if essential components are missing. Confirm the new subnet, listening interfaces and mount paths before moving DHCP reservations and service settings.

At cutover disconnect the old router from the household switch before connecting the replacement. Avoid two active DHCP servers on one LAN. Reboot the new machine. From a test client verify the lease, management login, an internal service and a public domain. Check that the guest network cannot access management. If a critical service fails, disconnect the new unit, reconnect the original cables, renew the client lease and repeat the checks.

What does an OpenWrt configuration backup restore?

OpenWrt builds iproute2 but cannot install dcb

Can two aarch64 routers share a USB Ethernet driver?

Plug the adapter into the destination first. If an interface appears, keep the management port connected and check link and traffic. If only the USB device appears, note its ID and kernel messages before choosing a module. Compare release, target and kernel on both routers.

The example reads an installed module, kmod-ppp. Substitute your installed module. These commands query local package records without changing repository settings.

grep -E 'RELEASE|TARGET' /etc/openwrt_release
uname -r
apk --print-arch
apk --repositories-file /dev/null list --installed kernel
apk --repositories-file /dev/null info -R kmod-ppp

OpenWrt 25.12.6 · apk · kmod-ppp

Real SSH output from an OpenWrt 25.12.6 x86/64 VM. This demonstrates the check. No ARM adapter was tested.

Compare the full version after kernel- in the first result with the requirement after kernel= in the second. Both read 6.12.112~b4125196ecec75391093e1e2edeba490-r1 here. The 6.12.112 shown by uname omits the build identifier and revision.

For an uninstalled candidate, omit the temporary repository option and inspect dependencies in the destination’s normal feeds. On older systems compare opkg status kernel with opkg info PACKAGE. If they differ, find matching feeds or build a matching image with the driver. Avoid forced installs and loose .ko copies.

If dependencies match but no interface appears, check firmware errors and driver binding. Verify the spare link’s address and traffic counters, then reboot and recheck. If needed, switch back, restore network settings and remove only newly added unused modules.

Reference

Explore hardware

Comments