imagebuilder: init APK dirs every time
authorPaul Spooren <mail@aparcar.org>
Fri, 8 Nov 2024 09:37:16 +0000 (10:37 +0100)
committerPaul Spooren <mail@aparcar.org>
Sat, 9 Nov 2024 15:46:44 +0000 (16:46 +0100)
The `--initdb` command creates basic folders required by APK,
previoiusly it would only run a single time when package_index is
actually called. Since the function isn't called if nothing changes,
`--initdb` doesn't initialize the rootfs again.

This commit moves it to package_reload, which runs every time.

Signed-off-by: Paul Spooren <mail@aparcar.org>
target/imagebuilder/files/Makefile

index 914609ada15f6a2bbecf277dd4d97cc5153a5ca8..72b36b0862389d225e1fe621c4f15a38f43d7dee 100644 (file)
@@ -181,7 +181,6 @@ ifeq ($(CONFIG_USE_APK),)
        ) >/dev/null 2>/dev/null
        $(OPKG) update >&2 || true
 else
-       $(APK) add --initdb
        (cd $(PACKAGE_DIR); $(APK) mkndx \
                $(if $(CONFIG_SIGNATURE_CHECK), --keys-dir $(APK_KEYS) --sign $(BUILD_KEY_APK_SEC)) \
                --allow-untrusted --output packages.adb *.apk) >/dev/null 2>/dev/null || true
@@ -200,6 +199,7 @@ ifeq ($(CONFIG_USE_APK),)
                $(OPKG) update >&2 || true; \
        fi
 else
+       $(APK) add --initdb
        if [ -d "$(PACKAGE_DIR)" ] && ( \
                        [ ! -f "$(PACKAGE_DIR)/packages.adb" ] || \
                        [ "`find $(PACKAGE_DIR) -cnewer $(PACKAGE_DIR)/packages.adb`" ] ); then \