imagebuilder: fix broken IB_STANDALONE option
authorChristian Marangi <ansuelsmth@gmail.com>
Fri, 31 May 2024 11:08:02 +0000 (13:08 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Fri, 31 May 2024 13:48:00 +0000 (15:48 +0200)
Fix broken IB_STANDALONE option for OPKG due to an error in ifdef logic
where we weren't adding the required entry to reference the local files
in repositories.conf

Rework the ifdef to more explicit and restore original functionality of
this option.

While at it also provide different README for APK or OPKG.

Fixes: d788ab376f85 ("build: add APK package build capabilities")
Link: https://github.com/openwrt/openwrt/pull/15599
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
target/imagebuilder/Makefile
target/imagebuilder/files/README.apk.md [new file with mode: 0644]
target/imagebuilder/files/README.md [deleted file]
target/imagebuilder/files/README.opkg.md [new file with mode: 0644]

index ef32d2cf7c0aac7572605f9502b99c435c44356e..7fd2aa0920e3c014b9daaff508b7df769a7c5268 100644 (file)
@@ -43,24 +43,29 @@ $(BIN_DIR)/$(IB_NAME).tar.zst: clean
 
        $(INSTALL_DIR) $(PKG_BUILD_DIR)/packages
 
-ifeq ($(CONFIG_IB_STANDALONE),)
 ifneq ($(CONFIG_USE_APK),)
+  ifeq ($(CONFIG_IB_STANDALONE),)
        $(call FeedSourcesAppendAPK,$(PKG_BUILD_DIR)/repositories)
        $(VERSION_SED_SCRIPT) $(PKG_BUILD_DIR)/repositories
+  endif
+
+       $(INSTALL_DATA) ./files/README.apk.md $(PKG_BUILD_DIR)/packages/README.md
 else
+  ifeq ($(CONFIG_IB_STANDALONE),)
        echo '## Remote package repositories' >> $(PKG_BUILD_DIR)/repositories.conf
        $(call FeedSourcesAppendOPKG,$(PKG_BUILD_DIR)/repositories.conf)
        $(VERSION_SED_SCRIPT) $(PKG_BUILD_DIR)/repositories.conf
 
+  endif
+
        # create an empty package index so `opkg` doesn't report an error
        touch $(PKG_BUILD_DIR)/packages/Packages
-       $(INSTALL_DATA) ./files/README.md $(PKG_BUILD_DIR)/packages/
+       $(INSTALL_DATA) ./files/README.opkg.md $(PKG_BUILD_DIR)/packages/README.md
 
        echo ''                                                        >> $(PKG_BUILD_DIR)/repositories.conf
        echo '## This is the local package repository, do not remove!' >> $(PKG_BUILD_DIR)/repositories.conf
        echo 'src imagebuilder file:packages'                          >> $(PKG_BUILD_DIR)/repositories.conf
 endif
-endif
 
 ifeq ($(CONFIG_BUILDBOT),)
   ifeq ($(CONFIG_IB_STANDALONE),)
diff --git a/target/imagebuilder/files/README.apk.md b/target/imagebuilder/files/README.apk.md
new file mode 100644 (file)
index 0000000..e82a937
--- /dev/null
@@ -0,0 +1,10 @@
+# ./packages folder
+
+Add `.apk` packages to this folder will allow the ImageBuilder to install them.
+
+For more complex setups consider adding a custom feed containing packages.
+
+    file:///path/to/Packages.adb
+
+Whenever the ImageBuilder builds a firmware image this folder will be reloaded
+and a new package index created.
diff --git a/target/imagebuilder/files/README.md b/target/imagebuilder/files/README.md
deleted file mode 100644 (file)
index 9a9616d..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-# ./packages folder
-
-Add `.ipk` packages to this folder will allow the ImageBuilder to install them.
-
-For more complex setups consider adding a custom feed containing packages.
-
-    src custom file:///path/to/packages
-
-Whenever the ImageBuilder builds a firmware image this folder will be reloaded
-and a new package index created. In case signature checks are enabled the
-`./packages/Packages` index will be signed with a locally generated key pair.
diff --git a/target/imagebuilder/files/README.opkg.md b/target/imagebuilder/files/README.opkg.md
new file mode 100644 (file)
index 0000000..9a9616d
--- /dev/null
@@ -0,0 +1,11 @@
+# ./packages folder
+
+Add `.ipk` packages to this folder will allow the ImageBuilder to install them.
+
+For more complex setups consider adding a custom feed containing packages.
+
+    src custom file:///path/to/packages
+
+Whenever the ImageBuilder builds a firmware image this folder will be reloaded
+and a new package index created. In case signature checks are enabled the
+`./packages/Packages` index will be signed with a locally generated key pair.