Traverse OpenWRT SDK for cross-compilation

I’ve just checked the SDK package, it looks like there is an error in the package feed configuration which I will need to track down.

So do this first:

sed 's/arm64-2102/arm64_2102/g' feeds.conf.default > feeds.conf

Try without this step:

./scripts/feeds install -a

This installs ALL packages from OpenWrt’s various collections (openwrt itself, packages, LuCI etc) into the SDK system, which would take quite a long time to compile.

If you are trying to compile a certain OpenWrt package which we don’t have, you can do:

$ ./scripts/feeds update -a
$ ./scripts/feeds search p190nd
Search results in feed 'packages':
p910nd                          A small non-spooling printer server
...
$ ./scripts/feeds install p910nd
$ make defconfig
$ sed -i 's/CONFIG_SIGNED_PACKAGES=y/CONFIG_SIGNED_PACKAGES=n/g' .config
$ make -j$(nproc)
 make[1] world
 make[2] package/compile
 make[3] -C package/toolchain clean-build
 make[3] -C package/toolchain compile
 make[3] -C feeds/packages/net/p910nd clean-build
 make[3] -C feeds/packages/net/p910nd compile
 make[3] -C package/kernel/linux compile
 make[2] package/index

After this, the compiled OpenWrt package (.ipk) will be in bin/packages/aarch64_generic:

$ find bin/packages/aarch64_generic/
...
bin/packages/aarch64_generic/packages/p910nd_0.97-9_aarch64_generic.ipk

If you are trying to add your own package, you can follow the guide at OpenWrt.org: “Hello, world!” for OpenWrt /Creating a package from your application