summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2016-09-24 18:25:25 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2016-09-24 18:25:25 +0200
commite9165793409ceccaeef6674c691b875a83fcb97f (patch)
treef2a7c83775ed5f2e23a208792d639cf3fdc11a09 /include
parent1c09849f6cf1b8bd94819ca11910ce444c3d3019 (diff)
downloadmaster-31e0f0ae-e9165793409ceccaeef6674c691b875a83fcb97f.tar.gz
master-31e0f0ae-e9165793409ceccaeef6674c691b875a83fcb97f.tar.bz2
master-31e0f0ae-e9165793409ceccaeef6674c691b875a83fcb97f.zip
image: allow specifying additional packages for device-specific rootfs
Add a new option to each device in multi-profile mode, allowing to provide a list of packages to add or remove. In case of added packages, the user must take care that these are selected to be built. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Diffstat (limited to 'include')
-rw-r--r--include/image.mk14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/image.mk b/include/image.mk
index 63cefff05c..3085400666 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -387,11 +387,21 @@ else
DEVICE_CHECK_PROFILE = $(CONFIG_TARGET_$(if $(CONFIG_TARGET_MULTI_PROFILE),DEVICE_)$(call target_conf,$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET)))_$(1))
endif
+DEVICE_EXTRA_PACKAGES = $(call qstrip,$(CONFIG_TARGET_DEVICE_PACKAGES_$(call target_conf,$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET)))_DEVICE_$(1)))
+
+define merge_packages
+ $(1) :=
+ $(foreach pkg,$(2),
+ $(1) := $$(strip $$(filter-out -$$(patsubst -%,%,$(pkg)) $$(patsubst -%,%,$(pkg)),$$($(1))) $(pkg))
+ )
+endef
+
define Device/Check/Common
_PROFILE_SET = $$(strip $$(foreach profile,$$(PROFILES) DEVICE_$(1),$$(call DEVICE_CHECK_PROFILE,$$(profile))))
ifdef TARGET_PER_DEVICE_ROOTFS
- ROOTFS_ID/$(1) := $$(if $$(_PROFILE_SET),$$(call mkfs_packages_id,$$(DEVICE_PACKAGES)))
- PACKAGES_$$(ROOTFS_ID/$(1)) := $$(DEVICE_PACKAGES)
+ $$(eval $$(call merge_packages,_PACKAGES,$$(DEVICE_PACKAGES) $$(call DEVICE_EXTRA_PACKAGES,$(1))))
+ ROOTFS_ID/$(1) := $$(if $$(_PROFILE_SET),$$(call mkfs_packages_id,$$(_PACKAGES)))
+ PACKAGES_$$(ROOTFS_ID/$(1)) := $$(_PACKAGES)
endif
endef