Local only upgrade, running imagebuilder on OpenWrt

Hi, I'm trying to update openwrt locally. Since asu fails to build images for me i wonder if it is possible to run imagebuilder on openwrt (armv8) (and then automatically run sysupgrade on generated file)?
I see that imagebuilder is available only for intel 64bit. Is it possible to emulate diffrent architectures using qemu on openwrt?

What errors do you get on ASU?

Building images...
Creating filesystem with parameters:
    Size: 109051904
    Block size: 4096
    Blocks per group: 32768
    Inodes per group: 6656
    Inode size: 256
    Journal blocks: 0
    Label: rootfs
    Blocks: 26624
    Block groups: 1
    Reserved blocks: 0
    Reserved block group size: 7
 
STDERR:
 
Package list missing or not up-to-date, generating it.
 
Building package index...
Downloading https://downloads.openwrt.org/releases/22.03.3/targets/rockchip/armv8/packages/Packages.gz
Updated list of available packages in /home/aparcar/asu/worker1/cache/22.03.3/rockchip/armv8/build_dir/target-aarch64_generic_musl/root-rockchip/../../../../../../../../../../../home/aparcar/asu/worker1/cache/22.03.3/rockchip/armv8/dl/openwrt_core
Downloading https://downloads.openwrt.org/releases/22.03.3/targets/rockchip/armv8/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_generic/base/Packages.gz
Updated list of available packages in /home/aparcar/asu/worker1/cache/22.03.3/rockchip/armv8/build_dir/target-aarch64_generic_musl/root-rockchip/../../../../../../../../../../../home/aparcar/asu/worker1/cache/22.03.3/rockchip/armv8/dl/openwrt_base
Downloading https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_generic/base/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_generic/luci/Packages.gz
Updated list of available packages in /home/aparcar/asu/worker1/cache/22.03.3/rockchip/armv8/build_dir/target-aarch64_generic_musl/root-rockchip/../../../../../../../../../../../home/aparcar/asu/worker1/cache/22.03.3/rockchip/armv8/dl/openwrt_luci
Downloading https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_generic/luci/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_generic/packages/Packages.gz
Updated list of available packages in /home/aparcar/asu/worker1/cache/22.03.3/rockchip/armv8/build_dir/target-aarch64_generic_musl/root-rockchip/../../../../../../../../../../../home/aparcar/asu/worker1/cache/22.03.3/rockchip/armv8/dl/openwrt_packages
Downloading https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_generic/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_generic/routing/Packages.gz
Updated list of available packages in /home/aparcar/asu/worker1/cache/22.03.3/rockchip/armv8/build_dir/target-aarch64_generic_musl/root-rockchip/../../../../../../../../../../../home/aparcar/asu/worker1/cache/22.03.3/rockchip/armv8/dl/openwrt_routing
Downloading https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_generic/routing/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_generic/telephony/Packages.gz
Updated list of available packages in /home/aparcar/asu/worker1/cache/22.03.3/rockchip/armv8/build_dir/target-aarch64_generic_musl/root-rockchip/../../../../../../../../../../../home/aparcar/asu/worker1/cache/22.03.3/rockchip/armv8/dl/openwrt_telephony
Downloading https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_generic/telephony/Packages.sig
Signature check passed.
Downloading file:packages/Packages
Updated list of available packages in /home/aparcar/asu/worker1/cache/22.03.3/rockchip/armv8/build_dir/target-aarch64_generic_musl/root-rockchip/../../../../../../../../../../../home/aparcar/asu/worker1/cache/22.03.3/rockchip/armv8/dl/imagebuilder
Downloading file:packages/Packages.sig
Signature check failed.
Remove wrong Signature file.
error: ext4_allocate_best_fit_partial: failed to allocate 1 blocks, out of space?
make[3]: *** [/home/aparcar/asu/worker1/cache/22.03.3/rockchip/armv8/include/image.mk:335: /home/aparcar/asu/worker1/cache/22.03.3/rockchip/armv8/build_dir/target-aarch64_generic_musl/linux-rockchip_armv8/root.ext4] Error 1
make[2]: *** [Makefile:188: build_image] Error 2
make[1]: *** [Makefile:126: _call_image] Error 2
make: *** [Makefile:242: image] Error 2

imagebuilder binaries are only provided for x86_64/ glibc, while using qemu-user-static would be able to emulate that (on a general purpose linux), setting that up is complicated and very slow. You'd be better off running a linux x86_64 system for that (and be it in a VM, e.g. qemu-kvm, virtualbox, hyper-v, vmware, parallels, etc.).

Building from source (not using imagebuilder) is also possible on linux/ arm64.

Its not a problem for me even if image will be generating few days.

My case is to make updates happen on openwrt so i can do update for example from my phone, executing earlier prepared bash script.

Wouldn't building from scratch make impossible to install kmod-* packages from repo?

Is it possible to make build system make minimal image without any packages and install them before finalizing images?

Whats the best way to build as possible similar builds to official openwrt images (at least the same binary for kernel as official openwrt)?

Yes, but if you build from source, you usually have no need to install anything at runtime to begin with (as you can/ should include everything you're going to need at build time; obviously once you have settled on 'your own feature set').

imagebuilder, which requires a x86_64/ linux environment to run (WSL2 might suffice).

You're trying to build too big of an image which exceeds builtbot's disk space. Reduce (or omit) ROOTFS size parameter and resize rootfs on the router.

How much storage does your device have? And what kind? Doing builds takes a lot of space to be successful and will thrash the storage medium

But im just using asu, i cannot change anything.

16GB industrial grade microSD + 64GB usb disk for storing logs and performance data.

64gb might be enough space to build from scratch, not using imagebuilder, you will still hit the max writes on that usb pretty quick though if you're doing this frequently.