[OpenWrt-Devel] [PATCH v2] image.mk: Create a manifest file of installed packages as a build artifact

Pushpal Sidhu psidhu at gateworks.com
Wed May 4 13:28:16 EDT 2016


A few linux BSP's create a manifest file of installed packages for a given
target in order to help them understand exactly what's on their images. Create
one for OpenWrt as well as a build artifact since many users have an affinity to
prune down on packages to save valuable flash space.

Signed-off-by: Pushpal Sidhu <psidhu at gateworks.com>
---
 include/image.mk | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/image.mk b/include/image.mk
index bc383e6..2606c77 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -280,6 +280,13 @@ define Image/mkfs/prepare
 	$(call Image/mkfs/prepare/default)
 endef
 
+define Image/Manifest
+	$(STAGING_DIR_HOST)/bin/opkg \
+		--offline-root $(TARGET_DIR) \
+		--add-arch all:100 \
+		--add-arch $(if $(ARCH_PACKAGES),$(ARCH_PACKAGES),$(BOARD)):200 list-installed > \
+		$(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).manifest
+endef
 
 define Image/Checksum
 	( cd ${BIN_DIR} ; \
@@ -597,6 +604,7 @@ define BuildImage
 		$(call Image/Build,$(fs))
 	)
 	$(call Image/mkfs/ubifs)
+	$(call Image/Manifest)
 	$(call Image/Checksum,md5sum --binary,md5sums)
 	$(call Image/Checksum,openssl dgst -sha256,sha256sums)
 
-- 
2.8.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list