diff options
author | Paul Spooren <mail@aparcar.org> | 2020-08-07 11:13:00 -1000 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2020-08-31 11:13:12 +0100 |
commit | 353ce2e521f57318c502c862457dc859d8d181a6 (patch) | |
tree | 4e84a80f6b7183b677567d5f3ae03fb1529c6954 /include | |
parent | 2bd55d0a2b22e5923a433edd9f90be8ea2997bde (diff) | |
download | upstream-353ce2e521f57318c502c862457dc859d8d181a6.tar.gz upstream-353ce2e521f57318c502c862457dc859d8d181a6.tar.bz2 upstream-353ce2e521f57318c502c862457dc859d8d181a6.zip |
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 <mail@aparcar.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/package-ipkg.mk | 6 |
1 files changed, 1 insertions, 5 deletions
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: |