base-files: correctly split install-key function for APK
authorPaul Spooren <mail@aparcar.org>
Fri, 17 May 2024 20:32:00 +0000 (23:32 +0300)
committerChristian Marangi <ansuelsmth@gmail.com>
Fri, 17 May 2024 20:34:23 +0000 (23:34 +0300)
The function incorrectly tried to APK keys even if there were none.
Correctly separate it into its own `ifdef` section.

Signed-off-by: Paul Spooren <mail@aparcar.org>
Link: https://github.com/openwrt/openwrt/pull/15519
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
package/base-files/Makefile

index c42e2d9dd416577a370c68c5de45bfb66776c1d9..0aa7ecd85420b9b6a7fecaa2cbe0b4bf316cab4d 100644 (file)
@@ -122,6 +122,13 @@ ifneq ($(CONFIG_USE_APK),)
                $(STAGING_DIR_HOST)/bin/openssl ecparam -name prime256v1 -genkey -noout -out $(BUILD_KEY_APK_SEC); \
                $(STAGING_DIR_HOST)/bin/openssl ec -in $(BUILD_KEY_APK_SEC) -pubout > $(BUILD_KEY_APK_PUB)
   endef
+
+ifndef CONFIG_BUILDBOT
+  define Package/base-files/install-key
+       mkdir -p $(1)/etc/apk/keys
+       $(CP) $(BUILD_KEY_APK_PUB) $(1)/etc/apk/keys/
+  endef
+endif
 else
 ifdef CONFIG_SIGNED_PACKAGES
   define Build/Configure
@@ -137,10 +144,6 @@ ifndef CONFIG_BUILDBOT
   define Package/base-files/install-key
        mkdir -p $(1)/etc/opkg/keys
        $(CP) $(BUILD_KEY).pub $(1)/etc/opkg/keys/`$(STAGING_DIR_HOST)/bin/usign -F -p $(BUILD_KEY).pub`
-
-       mkdir -p $(1)/etc/apk/keys
-       $(CP) $(BUILD_KEY_APK_PUB) $(1)/etc/apk/keys/
-
   endef
 endif
 endif