openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64, unable to build kernel

curl https://archive.traverse.com.au/pub/traverse/ls1088firmware/openwrt/branches/22_03/latest/image/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64.tar.xz | tar -Jxf -
cd openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/
./scripts/feeds update -a && ./scripts/feeds install -a
make -j1 V=s package/kernel/linux/prepare
#hit OK on menuconfig - is there a way to do this without being prompted?

make -j1 V=s package/kernel/linux/compile
make[1]: Entering directory '/home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64'
make[2]: Entering directory '/home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/package/toolchain'
Makefile:735: WARNING: skipping libgomp -- package has no install section
echo "libc" >> /home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/staging_dir/target-aarch64_generic_musl/pkginfo/toolchain.default.install
echo "libgcc" >> /home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/staging_dir/target-aarch64_generic_musl/pkginfo/toolchain.default.install
echo "libstdcpp" >> /home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/staging_dir/target-aarch64_generic_musl/pkginfo/toolchain.default.install
echo "libpthread" >> /home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/staging_dir/target-aarch64_generic_musl/pkginfo/toolchain.default.install
echo "librt" >> /home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/staging_dir/target-aarch64_generic_musl/pkginfo/toolchain.default.install
touch -r /home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/build_dir/target-aarch64_generic_musl/toolchain/.built /home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/build_dir/target-aarch64_generic_musl/toolchain/.autoremove 2>/dev/null >/dev/null
find /home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/build_dir/target-aarch64_generic_musl/toolchain -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -and -not -name '.pkgdir'  -print0 | xargs -r -0 rm -rf
make[2]: Leaving directory '/home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/package/toolchain'
time: package/toolchain/compile#0.14#0.03#0.14
make[2]: Entering directory '/home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/feeds/base/package/firmware/linux-firmware'
echo "iwlwifi-firmware-ax200" >> /home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/staging_dir/target-aarch64_generic_musl/pkginfo/linux-firmware.default.install
echo "iwlwifi-firmware-ax210" >> /home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/staging_dir/target-aarch64_generic_musl/pkginfo/linux-firmware.default.install
echo "ath10k-board-qca9887" >> /home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/staging_dir/target-aarch64_generic_musl/pkginfo/linux-firmware.default.install
echo "ath10k-board-qca9888" >> /home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/staging_dir/target-aarch64_generic_musl/pkginfo/linux-firmware.default.install
echo "ath10k-board-qca988x" >> /home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/staging_dir/target-aarch64_generic_musl/pkginfo/linux-firmware.default.install
echo "ath10k-firmware-qca6174" >> /home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/staging_dir/target-aarch64_generic_musl/pkginfo/linux-firmware.default.install
echo "ath10k-board-qca99x0" >> /home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/staging_dir/target-aarch64_generic_musl/pkginfo/linux-firmware.default.install
echo "ath10k-board-qca9984" >> /home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/staging_dir/target-aarch64_generic_musl/pkginfo/linux-firmware.default.install
touch -r /home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/build_dir/target-aarch64_generic_musl/linux-firmware-20220411/.built /home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/build_dir/target-aarch64_generic_musl/linux-firmware-20220411/.autoremove 2>/dev/null >/dev/null
find /home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/build_dir/target-aarch64_generic_musl/linux-firmware-20220411 -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -and -not -name '.pkgdir'  -print0 | xargs -r -0 rm -rf
make[2]: Leaving directory '/home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/feeds/base/package/firmware/linux-firmware'
time: package/feeds/base/linux-firmware/compile#0.80#0.05#0.82
make[2]: Entering directory '/home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/feeds/base/package/firmware/prism54-firmware'
touch -r /home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/build_dir/target-aarch64_generic_musl/prism54-firmware/.built /home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/build_dir/target-aarch64_generic_musl/prism54-firmware/.autoremove 2>/dev/null >/dev/null
find /home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/build_dir/target-aarch64_generic_musl/prism54-firmware -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -and -not -name '.pkgdir'  -print0 | xargs -r -0 rm -rf
make[2]: Leaving directory '/home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/feeds/base/package/firmware/prism54-firmware'
time: package/feeds/base/prism54-firmware/compile#0.30#0.03#0.29
make[2]: Entering directory '/home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/package/kernel/linux'
can't open file '/home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/build_dir/target-aarch64_generic_musl/linux-armvirt_64/linux-5.10.161/.config' at /home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/scripts/kconfig.pl line 32.
grep: /home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/build_dir/target-aarch64_generic_musl/linux-armvirt_64/linux-5.10.161/modules.builtin: No such file or directory
ERROR: module '/home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/build_dir/target-aarch64_generic_musl/linux-armvirt_64/linux-5.10.161/fs/nfs/nfsv3.ko' is missing.
make[2]: *** [modules/fs.mk:441: /home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/bin/targets/armvirt/64/packages/kmod-fs-nfs-v3_5.10.161-1_aarch64_generic.ipk] Error 1
make[2]: Leaving directory '/home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/package/kernel/linux'
time: package/kernel/linux/compile#0.84#0.06#0.87
    ERROR: package/kernel/linux failed to build.
make[1]: *** [package/Makefile:116: package/kernel/linux/compile] Error 1
make[1]: Leaving directory '/home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64'
make: *** [/home/voltagex/src/openwrt-sdk-armvirt-64_gcc-11.2.0_musl.Linux-x86_64/include/toplevel.mk:223: package/kernel/linux/compile] Error 2

That’s weird, everything’s built but it’s in the “wrong” location

./staging_dir/target-aarch64_generic_musl/root-armvirt/lib/modules/5.10.161/nfs_ssc.ko
./staging_dir/target-aarch64_generic_musl/root-armvirt/lib/modules/5.10.161/nfsd.ko
./staging_dir/target-aarch64_generic_musl/root-armvirt/lib/modules/5.10.161/nfsv3.ko
./staging_dir/target-aarch64_generic_musl/root-armvirt/lib/modules/5.10.161/nfs.ko
./staging_dir/target-aarch64_generic_musl/root-armvirt/lib/modules/5.10.161/nfsv4.ko

What kernel module(s) are you trying to build? The SDK doesn’t really handle kernel packages well, basically if it involves changing the “upstream” kernel config beyond turning on the individual module you need to do it in the original OpenWrt tree.

Anyway, I think the problem here is because the kernel packages are “special” so invoking the /prepare and /compile targets may not work as expected. Better to just do make -j$(nproc) and let it do it’s thing

Here’s my trick for getting the SDK going with minimal interaction:

./scripts/feeds update
./scripts/feeds install bash
cat <<'EOF' > .config
# CONFIG_ALL_NONSHARED is not set
# CONFIG_ALL_KMODS is not set
# CONFIG_ALL is not set
# CONFIG_SIGNED_PACKAGES is not set
CONFIG_PACKAGE_bash=m
EOF
make defconfig
make -j$(nproc)

I wasn’t actually trying to build the kernel, I was seeing if I could add your patch to fstools and it tried to build the kernel anyway

Ah. The CONFIG_ALL_* default causes that, disabling it will stop that from happening but has to be done very carefully in sequence.

It also helps to only import (./script/feeds install) the package you’re interested in, though there are some packages that don’t work without a full import.