[openwrt/openwrt] base-files: skip fix-group-user uci-default for APK installation

LEDE Commits lede-commits at lists.infradead.org
Tue Jun 11 14:59:07 PDT 2024


ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/8ca2e2852e1e9218720697c6014a99b5e1378585

commit 8ca2e2852e1e9218720697c6014a99b5e1378585
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Sun May 26 19:30:32 2024 +0200

    base-files: skip fix-group-user uci-default for APK installation
    
    For APK installation we don't have /usr/lib/opkg/info and user fixup are
    handled dirrectly. Skip the script in such case.
    
    Also remove this uci-defaults if we have CONFIG_USE_APK enabled.
    
    Link: https://github.com/openwrt/openwrt/pull/15543
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 package/base-files/Makefile                                 | 2 ++
 package/base-files/files/etc/uci-defaults/13_fix-group-user | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index 4425bb346d..313bf377b4 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -249,6 +249,8 @@ ifneq ($(CONFIG_USE_APK),)
 	mkdir -p $(1)/etc/apk/
 	$(call FeedSourcesAppendAPK,$(1)/etc/apk/repositories)
 	$(VERSION_SED_SCRIPT) $(1)/etc/apk/repositories
+
+	rm -f $(1)/etc/uci-defaults/13_fix-group-user
 else
 	$(if $(CONFIG_CLEAN_IPKG),, \
 		mkdir -p $(1)/etc/opkg; \
diff --git a/package/base-files/files/etc/uci-defaults/13_fix-group-user b/package/base-files/files/etc/uci-defaults/13_fix-group-user
index 74f501e8f7..c5cc74e1a0 100644
--- a/package/base-files/files/etc/uci-defaults/13_fix-group-user
+++ b/package/base-files/files/etc/uci-defaults/13_fix-group-user
@@ -1,5 +1,8 @@
 . /lib/functions.sh
 
+# Skip if we don't have /usr/lib/opkg/info (APK installation)
+[ -d /usr/lib/opkg/info ] || exit 0
+
 for file in $(grep -sl Require-User /usr/lib/opkg/info/*.control); do
 	file="${file##*/}"
 	file="${file%.control}"




More information about the lede-commits mailing list