From f4e37a66f92099cc5d3bbde33823cd38b30a48a8 Mon Sep 17 00:00:00 2001 From: lguohan Date: Thu, 16 Nov 2017 12:27:03 -0800 Subject: [PATCH] add INSTALLS, LAZY_INSTALLS, DEPENDS targets to image build (#1159) 1. _INSTALLS defines the packages to be installed in the image at the build time. 2. _LAZY_INSTALLS defines the packages to be installed in the image at the first run time 3. _DEPENDS defines the packages to at the build dependency of the image --- platform/broadcom/one-aboot.mk | 2 +- platform/broadcom/one-image.mk | 4 ++-- platform/broadcom/raw-image.mk | 4 ++-- platform/cavium/one-image.mk | 4 ++-- platform/centec/one-image.mk | 2 +- platform/generic/aboot-image.mk | 2 +- platform/generic/onie-image.mk | 2 +- platform/mellanox/one-image.mk | 2 +- slave.mk | 19 ++++++++++++++++--- 9 files changed, 27 insertions(+), 14 deletions(-) diff --git a/platform/broadcom/one-aboot.mk b/platform/broadcom/one-aboot.mk index fde8e06ff787..d13ce392b425 100644 --- a/platform/broadcom/one-aboot.mk +++ b/platform/broadcom/one-aboot.mk @@ -3,6 +3,6 @@ SONIC_ONE_ABOOT_IMAGE = sonic-aboot-broadcom.swi $(SONIC_ONE_ABOOT_IMAGE)_MACHINE = broadcom $(SONIC_ONE_ABOOT_IMAGE)_IMAGE_TYPE = aboot -$(SONIC_ONE_ABOOT_IMAGE)_DEPENDS += $(BRCM_OPENNSL_KERNEL) $(ARISTA_PLATFORM_MODULE) +$(SONIC_ONE_ABOOT_IMAGE)_INSTALLS += $(BRCM_OPENNSL_KERNEL) $(ARISTA_PLATFORM_MODULE) $(SONIC_ONE_ABOOT_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES) SONIC_INSTALLERS += $(SONIC_ONE_ABOOT_IMAGE) diff --git a/platform/broadcom/one-image.mk b/platform/broadcom/one-image.mk index 60305c292b6b..ca9da1134eb2 100644 --- a/platform/broadcom/one-image.mk +++ b/platform/broadcom/one-image.mk @@ -3,8 +3,8 @@ SONIC_ONE_IMAGE = sonic-broadcom.bin $(SONIC_ONE_IMAGE)_MACHINE = broadcom $(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie -$(SONIC_ONE_IMAGE)_DEPENDS += $(BRCM_OPENNSL_KERNEL) -$(SONIC_ONE_IMAGE)_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \ +$(SONIC_ONE_IMAGE)_INSTALLS += $(BRCM_OPENNSL_KERNEL) +$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \ $(DELL_Z9100_PLATFORM_MODULE) \ $(DELL_S6100_PLATFORM_MODULE) \ $(INGRASYS_S8900_54XC_PLATFORM_MODULE) \ diff --git a/platform/broadcom/raw-image.mk b/platform/broadcom/raw-image.mk index ae93683c543d..2591d32c1be8 100644 --- a/platform/broadcom/raw-image.mk +++ b/platform/broadcom/raw-image.mk @@ -3,7 +3,7 @@ SONIC_RAW_IMAGE = sonic-broadcom.raw $(SONIC_RAW_IMAGE)_MACHINE = broadcom $(SONIC_RAW_IMAGE)_IMAGE_TYPE = raw -$(SONIC_RAW_IMAGE)_DEPENDS += $(BRCM_OPENNSL_KERNEL) -$(SONIC_RAW_IMAGE)_INSTALLS += $($(SONIC_ONE_IMAGE)_INSTALLS) +$(SONIC_RAW_IMAGE)_INSTALLS += $(BRCM_OPENNSL_KERNEL) +$(SONIC_RAW_IMAGE)_LAZY_INSTALLS += $($(SONIC_ONE_IMAGE)_LAZY_INSTALLS) $(SONIC_RAW_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES) SONIC_INSTALLERS += $(SONIC_RAW_IMAGE) diff --git a/platform/cavium/one-image.mk b/platform/cavium/one-image.mk index 33bcd92cc047..696578451990 100644 --- a/platform/cavium/one-image.mk +++ b/platform/cavium/one-image.mk @@ -3,7 +3,7 @@ SONIC_ONE_IMAGE = sonic-cavium.bin $(SONIC_ONE_IMAGE)_MACHINE = cavium $(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie -$(SONIC_ONE_IMAGE)_DEPENDS += $(CAVM_PLATFORM_DEB) -$(SONIC_ONE_IMAGE)_DEPENDS += $(CAVM_XPNET_DEB) +$(SONIC_ONE_IMAGE)_INSTALLS += $(CAVM_PLATFORM_DEB) +$(SONIC_ONE_IMAGE)_INSTALLS += $(CAVM_XPNET_DEB) $(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES) SONIC_INSTALLERS += $(SONIC_ONE_IMAGE) diff --git a/platform/centec/one-image.mk b/platform/centec/one-image.mk index 49c27aea4261..7ad205dce521 100644 --- a/platform/centec/one-image.mk +++ b/platform/centec/one-image.mk @@ -3,6 +3,6 @@ SONIC_ONE_IMAGE = sonic-centec.bin $(SONIC_ONE_IMAGE)_MACHINE = centec $(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie -$(SONIC_ONE_IMAGE)_DEPENDS += $(CENTEC_SDK_KERNEL) +$(SONIC_ONE_IMAGE)_INSTALLS += $(CENTEC_SDK_KERNEL) $(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES) SONIC_INSTALLERS += $(SONIC_ONE_IMAGE) diff --git a/platform/generic/aboot-image.mk b/platform/generic/aboot-image.mk index 7f5b4639e4e9..ecc91bba54c0 100644 --- a/platform/generic/aboot-image.mk +++ b/platform/generic/aboot-image.mk @@ -3,6 +3,6 @@ SONIC_GENERIC_ABOOT_IMAGE = sonic-aboot-generic.swi $(SONIC_GENERIC_ABOOT_IMAGE)_MACHINE = generic $(SONIC_GENERIC_ABOOT_IMAGE)_IMAGE_TYPE = aboot -$(SONIC_GENERIC_ABOOT_IMAGE)_DEPENDS = +$(SONIC_GENERIC_ABOOT_IMAGE)_INSTALLS = $(SONIC_GENERIC_ABOOT_IMAGE)_DOCKERS = SONIC_INSTALLERS += $(SONIC_GENERIC_ABOOT_IMAGE) diff --git a/platform/generic/onie-image.mk b/platform/generic/onie-image.mk index 67f8adba61e1..1a2ddb143505 100644 --- a/platform/generic/onie-image.mk +++ b/platform/generic/onie-image.mk @@ -3,6 +3,6 @@ SONIC_GENERIC_ONIE_IMAGE = sonic-generic.bin $(SONIC_GENERIC_ONIE_IMAGE)_MACHINE = generic $(SONIC_GENERIC_ONIE_IMAGE)_IMAGE_TYPE = onie -$(SONIC_GENERIC_ONIE_IMAGE)_DEPENDS = +$(SONIC_GENERIC_ONIE_IMAGE)_INSTALLS = $(SONIC_GENERIC_ONIE_IMAGE)_DOCKERS = SONIC_INSTALLERS += $(SONIC_GENERIC_ONIE_IMAGE) diff --git a/platform/mellanox/one-image.mk b/platform/mellanox/one-image.mk index db8826951ca8..6f478ba76a51 100644 --- a/platform/mellanox/one-image.mk +++ b/platform/mellanox/one-image.mk @@ -3,7 +3,7 @@ SONIC_ONE_IMAGE = sonic-mellanox.bin $(SONIC_ONE_IMAGE)_MACHINE = mellanox $(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie -$(SONIC_ONE_IMAGE)_DEPENDS += $(SX_KERNEL) $(KERNEL_MFT) $(MFT) $(MLNX_HW_MANAGEMENT) +$(SONIC_ONE_IMAGE)_INSTALLS += $(SX_KERNEL) $(KERNEL_MFT) $(MFT) $(MLNX_HW_MANAGEMENT) $(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES) $(SONIC_ONE_IMAGE)_FILES += $(MLNX_FW_FILE) SONIC_INSTALLERS += $(SONIC_ONE_IMAGE) diff --git a/slave.mk b/slave.mk index 6f823cf98340..71cee41e3d0a 100644 --- a/slave.mk +++ b/slave.mk @@ -380,7 +380,20 @@ $(DOCKER_LOAD_TARGETS) : $(TARGET_PATH)/%.gz-load : .platform docker-start $$(TA ############################################################################### # targets for building installers with base image -$(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : .platform onie-image.conf $$(addprefix $(DEBS_PATH)/,$$($$*_DEPENDS)) $$(addprefix $(DEBS_PATH)/,$$($$*_INSTALLS)) $$(addprefix $(FILES_PATH)/,$$($$*_FILES)) $(addprefix $(DEBS_PATH)/,$(INITRAMFS_TOOLS) $(LINUX_KERNEL) $(IGB_DRIVER) $(SONIC_DEVICE_DATA) $(SONIC_UTILS)) $$(addprefix $(TARGET_PATH)/,$$($$*_DOCKERS)) $$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_CONFIG_ENGINE)) +$(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ + .platform \ + onie-image.conf \ + $$(addsuffix -install,$$(addprefix $(DEBS_PATH)/,$$($$*_DEPENDS))) \ + $$(addprefix $(DEBS_PATH)/,$$($$*_INSTALLS)) \ + $$(addprefix $(DEBS_PATH)/,$$($$*_LAZY_INSTALLS)) \ + $$(addprefix $(FILES_PATH)/,$$($$*_FILES)) \ + $(addprefix $(DEBS_PATH)/,$(INITRAMFS_TOOLS) \ + $(LINUX_KERNEL) \ + $(IGB_DRIVER) \ + $(SONIC_DEVICE_DATA) \ + $(SONIC_UTILS)) \ + $$(addprefix $(TARGET_PATH)/,$$($$*_DOCKERS)) \ + $$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_CONFIG_ENGINE)) $(HEADER) # Pass initramfs and linux kernel explicitly. They are used for all platforms export initramfs_tools="$(DEBS_PATH)/$(INITRAMFS_TOOLS)" @@ -392,8 +405,8 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : .platform export enable_organization_extensions="$(ENABLE_ORGANIZATION_EXTENSIONS)" export enable_dhcp_graph_service="$(ENABLE_DHCP_GRAPH_SERVICE)" export shutdown_bgp_on_start="$(SHUTDOWN_BGP_ON_START)" - export installer_debs="$(addprefix $(DEBS_PATH)/,$($*_DEPENDS))" - export lazy_installer_debs="$(foreach deb, $($*_INSTALLS),$(foreach device, $($(deb)_PLATFORM),$(addprefix $(device)@, $(DEBS_PATH)/$(deb))))" + export installer_debs="$(addprefix $(DEBS_PATH)/,$($*_INSTALLS))" + export lazy_installer_debs="$(foreach deb, $($*_LAZY_INSTALLS),$(foreach device, $($(deb)_PLATFORM),$(addprefix $(device)@, $(DEBS_PATH)/$(deb))))" export installer_images="$(addprefix $(TARGET_PATH)/,$($*_DOCKERS))" export config_engine_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_CONFIG_ENGINE))" export swsssdk_py2_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(SWSSSDK_PY2))"