V23.05.2 with different kernel versions?

To everybody,

Last days I am building OpenWrt version (git checkout) v23.05.2 (latest stable release), I found the following:
After git checkout v23.05.2 (and all following commands, like feeds update & install) I now have 2 OpenWrt builds r23630-842932a63d, but the kernel used is different? (For the same device ofcourse.)

OpenWrt r23630-842932a63d with kernel - 5.15.137-1-b3e908a2c135db978960f8650bf9e912
OpenWrt r23630-842932a63d with kernel - 5.15.137-1-ca5a123547341203209f8abac37f8281

Why is this not the version 23.05.2 from OpenWrt itself?
kernel - 5.15.137-1-fedd9aa540b38047b7ee66cc038a7408
As now I can not update / install other packages from Luci, as the kernel is different. Same issue as (closed): Kernel version Problem

In the link as answer is stated: As general advice, especially for inexperienced users: Go for the latest stable release (if available for your device), not a snapshot version, then the package repositories will match and packages will be available.

So it looks like v23.05.2 is not stable release (yet)?

Following is info about my device (name TorRouter is set instead of OpenWrt)

# ubus call system board
	"kernel": "5.15.137",
	"hostname": "TorRouter-TEST",
	"system": "xRX200 rev 1.2",
	"model": "ZyXEL P-2812HNU-F1",
	"board_name": "zyxel,p-2812hnu-f1",
	"rootfs_type": "squashfs",
	"release": {
		"distribution": "TorRouter",
		"version": "23.05.2",
		"revision": "r23630-842932a63d",
		"target": "lantiq/xrx200",
		"description": "TorRouter 23.05.2 r23630-842932a63d"

As also asked on oftc.net channel, but no reaction.

<DGDodo> weird, v23.05.2 want to install additional package: The installed version of package kernel is not compatible, require 5.15.137-1-fedd9aa5… while 5.15.137-1-b3e908a2… is installed.
<DGDodo> distfeeds is 23.05.2, build is 23.05.2, why is the kernel different?


Some explanations here.


If you change any kernel package options or selections (which kmods to build), the vermagic hash will change.



Thanks for your quick reply. I am not so well in reading github changes.
I do build OpenWrt versions for 10 years now, this is new for me. It is nowhere mentioned in the wiki pages all of them should be adjusted?


According this link: Only if you change kernel_makeconfig you should have different versions and pakage updates can not be done with Luci. (typo)
I do NOT change this.

Older (< v23.xx.y) builds did always automatically select the stable release versions, why is it changed?
Where do I find an example in the wiki how to implement this ? vermagic hash? (hnyman)
(It is the first time I hear of this.)



Sorry to get back on this, but I do not understand it fully.
I am trying to build Openwrt v23.05.2 compatible with it's packages.
Following all steps of: https://openwrt.org/docs/guide-developer/toolchain/use-buildsystem

Do I need to adjust .config manually to get the right kernel?

After git checkout v23.05.2 all packages should be of the same kernel, i presume? This was always the normal procedure, never had these issues before building v23+.
Next all feeds update and install, just before 'make prereq', 'make defconfig'.
Then 'make menuconfig', only minor things are added (like nano, htop).

'make' runs without any problems, but nowadays every build has different kernels?

How to build a version that is compatible with OpenWrt v23.05.2, so that packages can be installed afterwards?


To my understanding, each stable release is linked to a specific kernel version. All the packages should also work. For example 23.05.2 has kernel 5.15.137.

No, it should be done by default once you have select the branch (git checkout command)

Whatever you add or not some packages, kernel should be the same.

Consider using 23.05.3 which will be announce soon. You will have the latest kernel and dependencies fixed.

I've build compatible kernels based on the description in the link below. It is a few years old and I've not needed it any more since the image builder is a much easier way to include specific packages.



As seen in my topic start the kernel-base is the same, but the hash at the end is different and therefor you can NOT install packages within Luci.
Although I have used git checkout v23.05.2
It just does NOT set the hash of kernel 5.15.137-1
It looks to me v23.05.2 is not as stable as I thought. This is the first time I walk into this is 10 years!


1 Like

OpenWrt v23.05.3 is under release. Maybe this is due to the fact that not everything is updated everywhere yet?


I know there are different ways to compile an OpenWrt image, but I use the following link for almost 10 years and never had these issues.

It seems to be it needs adjustment nowadays. (As some more pages...)
( All package related stuff is still on 22.03 ? )


To all,

The only place 'vermagic is mentioned in the wiki is: https://openwrt.org/user/ahorner/build-guide
(make kernel_menuconfig, which I do NOT use!)

It is also mentioned also in toh: https://openwrt.org/toh/nexx/wt3020
Only to be specified to check, but not how.

So the question is: Why is the kernel-hash different every build, even when using git checkout v23.05.2? As this is not the case in earlier versions.



Is it?
According https://OpenWrt.org : Current stable release - OpenWrt 23.05.2




Already seen during git tag:



The vermagic is a hash of the chosen kernel options. The best advice is to build using the config.seed file from your target.

1 Like


That rule is in my include/kernel-defaults.mk:

    grep '=[ym]' $(LINUX_DIR)/.config.set | LC_ALL=C sort | $(MKHASH) md5 > $(LINUX_DIR)/.vermagic

The vermagic is a hash of the chosen kernel options. The best advice is to build using the config.seed file from your target.

Where do I find the config.seed of my target (ZyXEL P-2812HNU-F1)?
There is no config.seed at: https://downloads.openwrt.org/releases/23.05.2/targets/lantiq/xrx200/

The Download Selector has a version of my device, why can I not make it -a good working version- myself?


Sorry, it’s the config.buildinfo file. It’s for the whole target, not per device.

When building your own image, you should be willing to take the additional responsibility for including the packages you want up-front and later creating new sysupgrade images when updates are available or new kernel-specific packages are needed.

I don’t know how this has changed over the years, since I’m relatively new here compared to others. I now use imagebuilder, but used to build my own images every time I wanted to update anything.

1 Like

It has been the same for 10+ years.

If you change/select/deselect any kernel related packages/options, you need to build it all by yourself at the same build round.

If you take the config.seed from a release, you should then not change/select any packages, or the hash will again change.

1 Like

As @hnyman said above, notice that if you do not change any kernel package from the default config the .vermagic number should be the same as the official build. However I do a lightweight Access Point builds which I remove some Kernel Netfilter Extensions, not needed since I've also removed the entire firewall packages, and for this reason I do override the .vermagic to keep using the official packages.

I've also noticed some situations that even not changing any kernel configuration via make menconfig and accepting all defaults, .vermagic can still be different from the official builds.

So, if you want to override the .vermagic from your custom build to match the .vermagic from the official builds, you can get the offical .vermagic for your device from the openwrt-23.05.2-lantiq-xrx200.manifest file.

Look for the line below:

kernel - 5.15.137-1-fedd9aa540b38047b7ee66cc038a7408

The .vermagic for 23.05.2 official build is "fedd9aa540b38047b7ee66cc038a7408" for Lantiq XRX200.

On your build system, from the build dir, and before you start your build edit the following file:

nano --linenumbers ./include/kernel-defaults.mk

Comment out line #121 and override the new magic number as follows:

		# grep '=[ym]' $(LINUX_DIR)/.config.set | LC_ALL=C sort | $(MKHASH) md5 > $(LINUX_DIR)/.vermagic
		echo "fedd9aa540b38047b7ee66cc038a7408" > $(LINUX_DIR)/.vermagic

Then do your build as usual. Your magic number should be the same as the official build, and you should be able to use the official package repository without issues.

Just make sure you are in fact building from the same tag you are overriding vermagic (23.05.2 in the above example).

1 Like


Why does this occur to me the first time building v23.05.2? As I build versions from LEDE till v22.03.x which did not have this issue?

Something MUST have changed! Idk what.

(Even building with Download Selector crashes on luci-app-wifischeduler ?
Error: Impossible package selection)