Kmod Package kernel version mis-match despite same source tag


I just built a kmod driver package for a network adaptor. I checked out the tag v19.07.2 and built from source, tested on my backup hardware. Then copied the ipk package for the driver over to my production router, also running v19.07.2 (but from image builder, not from source) and I get a kernel version mis-match. How come?

Is it possible to force my package build to use the exact same kernel version as the image-builder release?

As your package modified the KCONFIG... which the hash on the router is summed from... the conflict has arisen.

The kernel needs to be compiled with kmod*.ipk <- = m if for that ( all ) modules... ( same run if your package is correct ) in order for the "vermagic" to happify.

Just submit a PR... otherwise you'll never match a release hash.

1 Like

In the meantime, is there a way to get this running on my prod router without having to rebuild the whole things from source?

There are a few options...

  • install your own custom kernel + packages from your build environment
  • hack the vermagic and risk likely router / device permacrash ( opkg force same deal )

Force opkg install with "--force-depends" and hope that the router does not crash or brick.
If you have changed no kernel related options, that should work, but there is no certainty.

1 Like

Thanks @anon50098793

I tried the second option after mirroring the running prod image onto the backup hardware, it does indeed cause a kernel panic. Not quite sure why... I thought as they were actually built against the same kernel it would have been ok.

My challenge with the first option... how do I (easily) create a .config for the build that has all my required packages included? I only have them in list format (see below, which I use for the image builder) is there a way to pull this list into a .config somehow without having to do this manually through the menuconfig gui?

adblock base-files bind-dig bind-libs blkid block-mount bnx2-firmware busybox ca-bundle ca-certificates cgi-io collectd collectd-mod-conntrack collectd-mod-cpu collectd-mod-interface collectd-mod-iwinfo collectd-mod-load collectd-mod-memory collectd-mod-network collectd-mod-nut collectd-mod-rrdtool collectd-mod-thermal curl ddns-scripts ddns-scripts_route53-v1 dnsmasq-full dropbear e2fsprogs etherwake ethtool fdisk firewall fstools fwtool getdns getrandom glib2 htop intel-microcode ip6tables iperf3 ipset iptables iptables-mod-conntrack-extra iptables-mod-ipopt iptables-mod-physdev iw jshn jsonfilter kernel kmod-bnx2 kmod-br-netfilter kmod-button-hotplug kmod-crypto-acompress kmod-crypto-aead kmod-crypto-authenc kmod-crypto-cbc kmod-crypto-cmac kmod-crypto-crc32c kmod-crypto-deflate kmod-crypto-des kmod-crypto-ecb kmod-crypto-ecdh kmod-crypto-echainiv kmod-crypto-hash kmod-crypto-hmac kmod-crypto-iv kmod-crypto-kpp kmod-crypto-manager kmod-crypto-md5 kmod-crypto-null kmod-crypto-pcompress kmod-crypto-rng kmod-crypto-sha1 kmod-crypto-sha256 kmod-crypto-sha512 kmod-crypto-wq kmod-e1000 kmod-e1000e kmod-ebtables kmod-ebtables-ipv4 kmod-ebtables-ipv6 kmod-ebtables-watchers kmod-fs-ext4 kmod-fs-msdos kmod-fs-ntfs kmod-fs-vfat kmod-fuse kmod-gpio-button-hotplug kmod-hid kmod-hwmon-core kmod-i2c-algo-bit kmod-i2c-core kmod-ifb kmod-igb kmod-input-core kmod-input-evdev kmod-ip6tables kmod-ipsec kmod-ipsec4 kmod-ipsec6 kmod-ipt-conntrack kmod-ipt-conntrack-extra kmod-ipt-core kmod-ipt-ipopt kmod-ipt-ipset kmod-ipt-nat kmod-ipt-nat6 kmod-ipt-offload kmod-ipt-physdev kmod-ipt-raw kmod-iptunnel kmod-iptunnel4 kmod-iptunnel6 kmod-irqbypass kmod-kvm-intel kmod-kvm-x86 kmod-lib-crc-ccitt kmod-lib-crc16 kmod-lib-crc32c kmod-lib-lzo kmod-lib-zlib-deflate kmod-lib-zlib-inflate kmod-mii kmod-mmc kmod-nf-conntrack kmod-nf-conntrack-netlink kmod-nf-conntrack6 kmod-nf-flow kmod-nf-ipt kmod-nf-ipt6 kmod-nf-nat kmod-nf-nat6 kmod-nf-reject kmod-nf-reject6 kmod-nfnetlink kmod-nft-core kmod-nft-nat kmod-nft-offload kmod-nls-base kmod-nls-cp437 kmod-nls-iso8859-1 kmod-nls-utf8 kmod-ppp kmod-pppoe kmod-pppox kmod-pps kmod-ptp kmod-r8169 kmod-regmap-core kmod-sched kmod-sched-cake kmod-sched-connmark kmod-sched-core kmod-scsi-core kmod-sit kmod-slhc kmod-tun kmod-usb-core kmod-usb-ehci kmod-usb-net kmod-usb-net-rtl8152 kmod-usb-ohci kmod-usb-ohci-pci kmod-usb-storage kmod-usb-storage-extras kmod-usb-uhci kmod-usb2 kmod-usb2-pci kmod-usb3 libatomic1 libattr libblkid1 libblobmsg-json libbz2-1.0 libc libcap libcomerr0 libcurl4 libelf1 libexpat libext2fs2 libf2fs6 libfdisk1 libfdt libffi libgcc1 libgmp10 libip4tc2 libip6tc2 libipset13 libiwinfo-lua libiwinfo20181126 libjson-c2 libjson-script libltdl7 liblua5.1.5 liblucihttp-lua liblucihttp0 liblzo2 libmbedtls12 libmnl0 libncurses6 libnetfilter-conntrack3 libnettle7 libnfnetlink0 libnl-tiny libopenssl-conf libopenssl1.1 libpcap1 libpcre libpthread librrd1 librt libsmartcols1 libss2 libubox20191228 libubus-lua libubus20191227 libuci-lua libuci20130104 libuclient20160123 libunbound libusb-1.0-0 libusb-compat4 libustream-openssl20150806 libuuid1 libwrap libxtables12 libyaml logd lua luci luci-app-adblock luci-app-advanced-reboot luci-app-ddns luci-app-firewall luci-app-openvpn luci-app-opkg luci-app-sqm luci-app-statistics luci-app-upnp luci-app-wol luci-base luci-compat luci-lib-ip luci-lib-ipkg luci-lib-iptparser luci-lib-jsonc luci-lib-nixio luci-mod-admin-full luci-mod-network luci-mod-status luci-mod-system luci-proto-ipv6 luci-proto-ppp luci-ssl-openssl luci-theme-bootstrap luci-theme-material miniupnpd mkf2fs mtd mwifiex-sdio-firmware nano netifd nut nut-common nut-driver-blazer_usb nut-server nut-upsc nut-upscmd nut-upsmon odhcp6c odhcpd-ipv6only openssh-keygen openssl-util openvpn-openssl openwrt-keyring opkg partx-utils perl perlbase-base perlbase-bytes perlbase-class perlbase-config perlbase-dynaloader perlbase-errno perlbase-essential perlbase-fcntl perlbase-filehandle perlbase-getopt perlbase-io perlbase-list perlbase-net perlbase-posix perlbase-scalar perlbase-selectsaver perlbase-socket perlbase-symbol perlbase-tie perlbase-time perlbase-xsloader pixman ppp ppp-mod-pppoe procd qemu-blobs qemu-bridge-helper qemu-img qemu-x86_64-softmmu r8169-firmware rpcd rpcd-mod-file rpcd-mod-iwinfo rpcd-mod-luci rpcd-mod-rrdns rrdtool1 shadow-common shadow-groupadd shadow-groupdel shadow-useradd shadow-usermod sqm-scripts stubby sudo swconfig tc tcpdump terminfo uboot-envtools ubox ubus ubusd uci uclibcxx uclient-fetch uhttpd uhttpd-mod-ubus unbound-host urandom-seed urngd usb-modeswitch usign wakeonlan wget zlib -dnsmasq

No super easy way... but each time you add stuff do a;

./scripts/ > ./configV1(2,3,etc)

Then later you can use those to make things alot faster :wink:

You can cheat as well as only the kmods really need to be added at that stage... other release packages should install ok :slight_smile:


Beginning to see why the PR is the way to go :slight_smile:

Not sure if it was weird coincidence or it jogged someone's memory, but it appears a PR was just approved into Master that adds the mlx4 and mlx5 drivers, making mine obsolete!

Never-the-less, same outcome.

1 Like