Skip to content

Commit

Permalink
imagebuilder: fix APK architecture setting
Browse files Browse the repository at this point in the history
Currently, when "apk add --initdb" is called it will populate the
/etc/apk/arch file with the architecture of the host instead of the target
package architecture and this will then make it impossible for new packages
to be installed on the device as the target architecture will not match
after APK is updated to include [1].

So, lets use override the architecture by passing the target package one
by using the "--arch" argument to "apk add".

[1] https://gitlab.alpinelinux.org/alpine/apk-tools/-/commit/c1a3e69f24e235fc78f4dddb1f85fdf281464446

Fixes: openwrt#16953
Link: openwrt#17015
Signed-off-by: Robert Marko <[email protected]>
  • Loading branch information
robimarko committed Nov 19, 2024
1 parent 0d0a5eb commit 1c308ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions target/imagebuilder/files/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ ifeq ($(CONFIG_USE_APK),)
$(OPKG) update >&2 || true; \
fi
else
$(APK) add --initdb
$(APK) add --arch $(ARCH_PACKAGES) --initdb
if [ -d "$(PACKAGE_DIR)" ] && ( \
[ ! -f "$(PACKAGE_DIR)/packages.adb" ] || \
[ "`find $(PACKAGE_DIR) -cnewer $(PACKAGE_DIR)/packages.adb`" ] ); then \
Expand All @@ -227,7 +227,7 @@ ifeq ($(CONFIG_USE_APK),)
$(OPKG) install $(wildcard $(PACKAGE_DIR)/kernel_*.ipk)
$(OPKG) install $(BUILD_PACKAGES)
else
$(APK) add --no-scripts $(BUILD_PACKAGES)
$(APK) add --arch $(ARCH_PACKAGES) --no-scripts $(BUILD_PACKAGES)
endif

prepare_rootfs: FORCE
Expand Down

0 comments on commit 1c308ba

Please sign in to comment.