From 353ce2e521f57318c502c862457dc859d8d181a6 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Fri, 7 Aug 2020 11:13:00 -1000 Subject: build: ipkg-build use fakeroot with PKG_FILE_MODES The `ipkg-build` script converts a folder into a `opkg` installable package. Until now it would use root:root for all packages and try to preserve file modes. This has the two drawbacks of packages want to add non-root files or add SUID files, like the `sudo` package does. To give more flexibility regarding file modes and avoid init script hacks, a new variable called `PKG_FILE_MODES`. The variable contains a list of files modes in the format `path:owner:group:mode`. An example for the `sudo` package below: ``` PKG_FILE_MODES:=\ /usr/bin/sudo:root:root:4755 \ /etc/sudoers:root:root:0440 ``` The `ipkg-build` now runs within a fakeroot environment to set any mode and directly store it in the resulting `ipk` package archive. Both options `-o` and `-g` are no longer required due to the introduction of the more flexible `-m` options, which takes the `PKG_FILE_MODES` as input. Lastly the option `-c` is removed as it's unused within the script. Signed-off-by: Paul Spooren --- include/package-ipkg.mk | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'include/package-ipkg.mk') diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk index 622cbf3223..d8b65433c2 100644 --- a/include/package-ipkg.mk +++ b/include/package-ipkg.mk @@ -9,10 +9,6 @@ ifndef DUMP include $(INCLUDE_DIR)/feeds.mk endif -# invoke ipkg-build with some default options -IPKG_BUILD:= \ - $(SCRIPT_DIR)/ipkg-build -c -o 0 -g 0 - IPKG_REMOVE:= \ $(SCRIPT_DIR)/ipkg-remove @@ -262,7 +258,7 @@ $(_endef) endif $(INSTALL_DIR) $$(PDIR_$(1)) - $(IPKG_BUILD) $$(IDIR_$(1)) $$(PDIR_$(1)) + $(FAKEROOT) $(SCRIPT_DIR)/ipkg-build -m "$(PKG_FILE_MODES)" $$(IDIR_$(1)) $$(PDIR_$(1)) @[ -f $$(IPKG_$(1)) ] $(1)-clean: -- cgit v1.2.3