summaryrefslogtreecommitdiff
path: root/package/base-files
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-04-06 19:39:51 +0000
committerFelix Fietkau <nbd@openwrt.org>2015-04-06 19:39:51 +0000
commitbeca028bd6bb71898052faadff680d8e76f61eb3 (patch)
tree14a05ceeedb3c6c18f4ff09eb0659b16ebb8e386 /package/base-files
parentdde8214d167415015d42cc826ebb535f726dd90d (diff)
downloadmtk-20170518-beca028bd6bb71898052faadff680d8e76f61eb3.zip
mtk-20170518-beca028bd6bb71898052faadff680d8e76f61eb3.tar.gz
mtk-20170518-beca028bd6bb71898052faadff680d8e76f61eb3.tar.bz2
build: add integration for managing opkg package feed keys
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 45286
Diffstat (limited to 'package/base-files')
-rw-r--r--package/base-files/Makefile21
1 files changed, 19 insertions, 2 deletions
diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index d0d93e5..0bba313 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -14,9 +14,11 @@ PKG_NAME:=base-files
PKG_RELEASE:=157
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
-PKG_BUILD_DEPENDS:=opkg/host
+PKG_BUILD_DEPENDS:=opkg/host usign/host
PKG_LICENSE:=GPL-2.0
+PKG_CONFIG_DEPENDS := CONFIG_SIGNED_PACKAGES
+
include $(INCLUDE_DIR)/package.mk
ifneq ($(DUMP),1)
@@ -29,7 +31,7 @@ endif
define Package/base-files
SECTION:=base
CATEGORY:=Base system
- DEPENDS:=+netifd +libc +procd +jsonfilter
+ DEPENDS:=+netifd +libc +procd +jsonfilter +SIGNED_PACKAGES:usign
TITLE:=Base filesystem for OpenWrt
URL:=http://openwrt.org/
VERSION:=$(PKG_RELEASE)-$(REVISION)
@@ -87,8 +89,23 @@ define Build/Compile/Default
endef
Build/Compile = $(Build/Compile/Default)
+ifdef CONFIG_SIGNED_PACKAGES
+ define Build/Configure
+ [ -s $(BUILD_KEY) -a -s $(BUILD_KEY).pub ] || \
+ $(STAGING_DIR_HOST)/bin/usign -G -s $(BUILD_KEY) -p $(BUILD_KEY).pub -c "Local build key"
+
+ endef
+
+ define Package/base-files/install-key
+ mkdir -p $(1)/etc/opkg/keys
+ $(CP) $(BUILD_KEY).pub $(1)/etc/opkg/keys/`$(STAGING_DIR_HOST)/bin/usign -F -p $(BUILD_KEY).pub`
+
+ endef
+endif
+
define Package/base-files/install
$(CP) ./files/* $(1)/
+ $(Package/base-files/install-key)
if [ -d $(GENERIC_PLATFORM_DIR)/base-files/. ]; then \
$(CP) $(GENERIC_PLATFORM_DIR)/base-files/* $(1)/; \
fi