Trying to create custom kernel for custom board

I've built a custom board based on an Allwinner V3S and an LTE mini PCIe module. It's running OpenWrt with a kernel I had previously compiled. For some reason, however, this kernel's (5.17) JFFS2 driver is broken, so I'm currently using ext4 on top of squashfs.
To solve this, I thought I'd try to go the 'normal' route and download the SDK, in order to compile a working kernel. I've tried following the instrucitons on https://openwrt.org/docs/guide-developer/toolchain/using_the_sdk, but I got stuck.
I've downloaded the 'openwrt-sdk-21.02.3-armvirt-32_gcc-8.4.0_musl_eabi.Linux-x86_64' SDK (it's a 32 bit arm chip), and I have ran ./scripts/feeds update -a but I have no idea where to go from there. I think there's supposed to be a 'target selection' when doing a make menuconfig, but there isn't (there's Global build settings, Advanced, Image configuration (which is empty), Base system, Kernel modules (with only empty entries), and Utilities (also empty).

After sving the configuration, I've tried running make kernel_menuconfig, which ends with an error:

openwrt-sdk-21.02.3-armvirt-32_gcc-8.4.0_musl_eabi.Linux-x86_64$ make kernel_menuconfig
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'eip197-mini-firmware', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'r8169-firmware', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'e100-firmware', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'bnx2-firmware', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'bnx2x-firmware', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'ar3k-firmware', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'mwifiex-sdio-firmware', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'kmod-phy-bcm-ns-usb2', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'edgeport-firmware', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'kmod-phy-bcm-ns-usb3', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'amdgpu-firmware', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'radeon-firmware', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'prism54-firmware', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'rtl8192su-firmware', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'eip197-mini-firmware', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'r8169-firmware', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'e100-firmware', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'bnx2-firmware', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'bnx2x-firmware', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'ar3k-firmware', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'mwifiex-sdio-firmware', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'kmod-phy-bcm-ns-usb2', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'edgeport-firmware', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'kmod-phy-bcm-ns-usb3', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'amdgpu-firmware', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'radeon-firmware', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'prism54-firmware', which does not exist
WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'rtl8192su-firmware', which does not exist
tmp/.config-package.in:72:warning: ignoring type redefinition of 'PACKAGE_libc' from 'bool' to 'tristate'
tmp/.config-package.in:100:warning: ignoring type redefinition of 'PACKAGE_libgcc' from 'bool' to 'tristate'
tmp/.config-package.in:221:warning: ignoring type redefinition of 'PACKAGE_libpthread' from 'bool' to 'tristate'
tmp/.config-package.in:249:warning: ignoring type redefinition of 'PACKAGE_librt' from 'bool' to 'tristate'
#
# No change to .config
#
 make[1] toolchain/install
make -r toolchain/install: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's going on
make: *** [/home/tom/git/openwrt-sdk-21.02.3-armvirt-32_gcc-8.4.0_musl_eabi.Linux-x86_64/include/toplevel.mk:223: toolchain/install] Error 1

Can anyone point me in the right direction or to some documentation on how to use the SDK?

Did you read the first couple of sentences on that Wiki-page?

 Tasks you can do with the SDK:

    Compile custom software for a specific release while ensuring binary and feature compatibility
    Compile newer versions of certain packages for a specific release
    Recompile existing packages with custom patches or different features

Do you notice how the SDK is about compiling packages, not the entire thing? Yeah. You need to compile OpenWrt from scratch, if you want to mess around with its internals, including the kernel.

1 Like

I am sufficiently ashamed. Thank you for pointing that out. So basically I'll just have to clone the git repo?

More-or-less follow the instructions at https://openwrt.org/docs/guide-developer/toolchain/use-buildsystem -- the instructions there should get you started. I'd probably recommend hopping over to IRC or Discord for live-chat, if you run into issues.

1 Like

Thanks guys. Seems like everything (including the jffs2 overlay) is working! It's still kind of hacked together at this point, and I'm specifying the MTD kernel/rootfs/rootfs_data partition manually instead of using MTDsplit functionality, but at least it's working.

If anyone is interested in the hardware, all the design files are available on GutHub: https://github.com/tomwimmenhove/MoonPi

1 Like