Errors using Image Builder created from source

I'm trying to re-create Image Builder for 23.05.5 ath79 "tiny" targets from source with a minor kernel change (swap enabled, as it's disabled by default).

Build environment is Debian 11.

I verified all required packages from the prerequisites section of this page are installed. The only error is for 'openjdk-7-jdk-headless' which apt returns 'E: Unable to locate package openjdk-7-jdk-headless', and searching I find no results with this error except one, where a developer (not for OpenWRT) states that referencing this package was a mistake, as it doesn't even exist. Running 'java -version' shows:

openjdk version "11.0.25" 2024-10-15
OpenJDK Runtime Environment (build 11.0.25+9-post-Debian-1deb11u1)
OpenJDK 64-Bit Server VM (build 11.0.25+9-post-Debian-1deb11u1, mixed mode, sharing)

I downloaded the config.buildinfo file from the ath78/tiny releases page to .config. I made the necessary change to Config-kernel.in to enable swap, ran make menuconfig to verify swap was enabled, saved to .config, ran make.

An Image Builder file was produced, however, when I attempt to use it to create an image, I get several errors:

Collected errors:
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.167-1-2da7f4f00c16ea4dde7435194cd629e1) for kmod-crypto-hash
 * pkg_hash_fetch_best_installation_candidate: Packages for kmod-crypto-hash found, but incompatible with the architectures configured
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.167-1-2da7f4f00c16ea4dde7435194cd629e1) for kmod-crypto-crc32
 * pkg_hash_fetch_best_installation_candidate: Packages for kmod-crypto-crc32 found, but incompatible with the architectures configured
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.167-1-2da7f4f00c16ea4dde7435194cd629e1) for kmod-nls-base
 * pkg_hash_fetch_best_installation_candidate: Packages for kmod-nls-base found, but incompatible with the architectures configured
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.167-1-2da7f4f00c16ea4dde7435194cd629e1) for kmod-fs-f2fs
 * pkg_hash_fetch_best_installation_candidate: Packages for kmod-fs-f2fs found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package kmod-fs-f2fs.
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.167-1-2da7f4f00c16ea4dde7435194cd629e1) for kmod-scsi-core
 * pkg_hash_fetch_best_installation_candidate: Packages for kmod-scsi-core found, but incompatible with the architectures configured
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.167-1-2da7f4f00c16ea4dde7435194cd629e1) for kmod-usb-core
 * pkg_hash_fetch_best_installation_candidate: Packages for kmod-usb-core found, but incompatible with the architectures configured
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.167-1-2da7f4f00c16ea4dde7435194cd629e1) for kmod-usb-storage
 * pkg_hash_fetch_best_installation_candidate: Packages for kmod-usb-storage found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package kmod-usb-storage.
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.167-1-2da7f4f00c16ea4dde7435194cd629e1) for kmod-gpio-button-hotplug
 * pkg_hash_fetch_best_installation_candidate: Packages for kmod-gpio-button-hotplug found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package kmod-gpio-button-hotplug.
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.167-1-2da7f4f00c16ea4dde7435194cd629e1) for kmod-usb-gadget
 * pkg_hash_fetch_best_installation_candidate: Packages for kmod-usb-gadget found, but incompatible with the architectures configured
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.167-1-2da7f4f00c16ea4dde7435194cd629e1) for kmod-usb-ehci
 * pkg_hash_fetch_best_installation_candidate: Packages for kmod-usb-ehci found, but incompatible with the architectures configured
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.167-1-2da7f4f00c16ea4dde7435194cd629e1) for kmod-usb-phy-nop
 * pkg_hash_fetch_best_installation_candidate: Packages for kmod-usb-phy-nop found, but incompatible with the architectures configured
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.167-1-2da7f4f00c16ea4dde7435194cd629e1) for kmod-usb-roles
 * pkg_hash_fetch_best_installation_candidate: Packages for kmod-usb-roles found, but incompatible with the architectures configured
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.167-1-2da7f4f00c16ea4dde7435194cd629e1) for kmod-usb-chipidea
 * pkg_hash_fetch_best_installation_candidate: Packages for kmod-usb-chipidea found, but incompatible with the architectures configured
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.167-1-2da7f4f00c16ea4dde7435194cd629e1) for kmod-usb-chipidea2
 * pkg_hash_fetch_best_installation_candidate: Packages for kmod-usb-chipidea2 found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package kmod-usb-chipidea2.
make[2]: *** [Makefile:189: package_install] Error 255
make[1]: *** [Makefile:144: _call_image] Error 2
make: *** [Makefile:262: image] Error 2

Can someone point out where I've gone wrong? Should I make a new build environment based on Ubuntu instead?

You need to build from source, 'everything' you're going to need/ install. Changing the kernel, regardless of the actual impact, will change the ABI version, so you can't use any kmod packages provided by OpenWrt's opkg (or apk-) repository and must provide your own instead.

I agree with @slh, but you could also search the forum for vermagic.

Thank you both for your replies.

I did actually build the kernel modules that gave those errors, but I think my mistake was in assuming that they would be included in the Image Builder. It seems instead that all necessary packages built from source need to be copied to the 'packages' sub-directory of the deployed Image Builder. After doing this, I was able to built the image successfully.

@frollic, are you suggesting it's possible to change a kernel setting like enabling swap without affecting the kermagic value? I found this page which discusses building and kermagic, and the first user comment is from someone who seems to have tried doing exactly what I'm doing (enabling swap) but got a different vermagic number than the official build.

I just read it's doable using modified vermagic, haven't actually tried it myself...