diff options
author | Sebastian Kemper <sebastian_ml@gmx.net> | 2020-09-09 12:29:50 +0200 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2020-09-09 14:13:59 +0100 |
commit | f58d3235342433eeba7458b0a527ee2b3725ee3a (patch) | |
tree | 3afa88dc7a707b14618cf86c8b312c858ef6bf02 /include | |
parent | 2dda301d40ec0937f4de1bcec307bbc8adb66958 (diff) | |
download | upstream-f58d3235342433eeba7458b0a527ee2b3725ee3a.tar.gz upstream-f58d3235342433eeba7458b0a527ee2b3725ee3a.tar.bz2 upstream-f58d3235342433eeba7458b0a527ee2b3725ee3a.zip |
build: allow file modes per binary package
Currently the global variable PKG_FILE_MODES is used for all ipkg
creations. This works for Makefiles which output a single package, or
variants of a single package.
But if a Makefile outputs multiple packages that each contain different
files, setting PKG_FILE_MODES causes build failure when any of the files
in the variable do not exist in the folder that is currently being
packaged.
Example:
/openwrt/staging_dir/host/bin/fakeroot -l /openwrt/staging_dir/host/lib/libfakeroot.so -f /openwrt/staging_dir/host/bin/faked /openwrt/scripts/ipkg-build -m "/usr/lib/mariadb/plugin/auth_pam_tool_dir:root:376:0750" /openwrt/build_dir/target-mips_24kc_musl/mariadb-10.4.13/ipkg-mips_24kc/mariadb-server-plugin-disks /openwrt/bin/packages/mips_24kc/packages
+chown: cannot access '/openwrt/build_dir/target-mips_24kc_musl/mariadb-10.4.13/ipkg-mips_24kc/mariadb-server-plugin-disks//usr/lib/mariadb/plugin/auth_pam_tool_dir': No such file or directory
This commit changes the file mode handling a bit. The file mode can now
be set either globally via PKG_FILE_MODES (no behavior change) or on a
per-package basis via FILE_MODES. This way specific file modes can be
used for any particular package.
This behavior is already used for other OpenWrt variables, hence it is
familiar:
PKG_MAINTAINER vs MAINTAINER
PKG_SOURCE_SUBDIR vs SUBDIR
PKG_LICENSE vs LICENSE
...
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/package-defaults.mk | 1 | ||||
-rw-r--r-- | include/package-ipkg.mk | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/include/package-defaults.mk b/include/package-defaults.mk index 2fed72b1a4..2a04bc17e9 100644 --- a/include/package-defaults.mk +++ b/include/package-defaults.mk @@ -59,6 +59,7 @@ define Package/Default ALTERNATIVES:= LICENSE:=$(PKG_LICENSE) LICENSE_FILES:=$(PKG_LICENSE_FILES) + FILE_MODES:=$(PKG_FILE_MODES) endef Build/Patch:=$(Build/Patch/Default) diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk index 62cda5b936..0bca8ae84d 100644 --- a/include/package-ipkg.mk +++ b/include/package-ipkg.mk @@ -260,7 +260,7 @@ $(_endef) endif $(INSTALL_DIR) $$(PDIR_$(1)) - $(FAKEROOT) $(SCRIPT_DIR)/ipkg-build -m "$(PKG_FILE_MODES)" $$(IDIR_$(1)) $$(PDIR_$(1)) + $(FAKEROOT) $(SCRIPT_DIR)/ipkg-build -m "$(FILE_MODES)" $$(IDIR_$(1)) $$(PDIR_$(1)) @[ -f $$(IPKG_$(1)) ] $(1)-clean: |