Building 22.03-rc5 gets me different Kernel than offcial build (NanoPi R2s)

Hi all,

I am running OpenWRT on a NonoPi R2s. The reason for me doing this is mainly because I am using a a 16GB SD card and the default 104MB Root partition is way to small to add extra packages.

Issue come when installing openVPN from the official repository. opkg is failing, stating that kmod-tun depends on kernel 5.4 whereas I have 5.10 installed.

This issue started with 22.03rc, never had it with 21.03

Not using image builder, building everything from scratch, checked out the proper tag (22.03.0-rc5)
Maybe this is an issue on my side or an issue in the official builds, not sure how to find out.

It is an issue on your side.

But the first issue is that you can't install kmods from the official repo to the private builds due to pretty strict kernel option checksums.

So, if you build from scratch, include also those packages in your image.

The install error "5.4 vs. 5.10" sounds like you have somehow wrong opkg settings, that it tries to mix 21.02 packages into your 22.03 build. (21.02 had kernel 5.4 while 22.03 has 5.10)
Maybe something from possible backups?


After checking out the tag, make sure that you also update and install all feeds, so that you get the proper 22.03 feeds.

1 Like

@hnyman thanks for your reply.
The issue is actually the other way around. Official build seem to have been built against kernel 5.4 and my own build gets me 5.10.

I always run the feed updates scripts when checking out a new version.

here is the output of uname -a on my NanoPi

Linux NanoPi-R2S-Router 5.10.127 #0 SMP PREEMPT Wed Jul 6 19:09:39 2022 aarch64 GNU/Linux

I just tried once again, and now it is no longer complaining about 5.4 but about 5.10 version mismatch

I am a newbie with the openwrt build chain, always used it as a turnkey solution without much digging into it. How can I get that exact same kernel version? Is the kernel as a git submodule?
I know I can compile all packages myself, but having them straight from the repository is more convenient IMHO.

Short answer: you can't.
You should build with exactly same kernel settings, same modules built etc. as the rc5 release. In practice you can't do that.

Like I said:

Yes, it would be convenient, but it used to lead into difficult bugs/discrepancies. So, about 10 years ago then checksum logic was added to prevent hard-to-debug incompatibilities for casual users.

If you build your own build, just use menuconfig to include also the necessary kmods that you need.

1 Like

You could just try the ext4 version instead (ie. I’ve only ever used the squashfs version on my R2S, since I don’t install much, but it was my understanding that the ext4 partition on that version can be expanded to use the rest of the free space on the SD card if desired.

squashfs vs ext4 doesn't change anything in regards to kernel dependencies or (not-possible in-place upgrades).


@hnyman I thought the number at the end of the version number is a git hash, I was wrong.
I am using the .config from the offical builds as my starting point, not touching any option from the kernel beside the root partition size. I am assuming I get the same kernel options than the official builds. This worked with 21.x versions...

@edwrap When I first got the R2S I installed the ext4 version. But it died right after the first power failure thus I switched to the squashfs plus, as @slh says, you lose the in place upgrade.

It might be that changing the partition size option is enough. The hash is made over all kernel options, so any change has impact.

As you says that you use the default config, you might be compatible in practice, although the hash differs. You might try overriding the hash check with opkg option "--force-depends". That might enable you to install the kmod despite the hash difference. (But naturally there is the risk that you brick the device)