From 1c5f11bdd47f1cf2429e5677e063698e0fede8c6 Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Fri, 6 Oct 2017 12:46:47 -0700 Subject: [PATCH] [sonic-utilities]: Build as Debian package once again (revert change to wheel) (#1018) RB=1127438 G=lnos-reviewers R=ntrianta,rjonnadu,rmolina,sfardeen,zxu A= --- files/build_templates/sonic_debian_extension.j2 | 8 +++----- rules/sonic-utilities.mk | 8 +++----- slave.mk | 3 +-- src/sonic-utilities | 2 +- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index a08872c4ea42..04f5181ff610 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -77,11 +77,9 @@ sudo cp {{swsssdk_py2_wheel_path}} $FILESYSTEM_ROOT/$SWSSSDK_PY2_WHEEL_NAME sudo LANG=C chroot $FILESYSTEM_ROOT pip install $SWSSSDK_PY2_WHEEL_NAME sudo rm -rf $FILESYSTEM_ROOT/$SWSSSDK_PY2_WHEEL_NAME -# Install SONiC Utilities Python package -SONIC_UTILITIES_WHEEL_NAME=$(basename {{sonic_utilities_wheel_path}}) -sudo cp {{sonic_utilities_wheel_path}} $FILESYSTEM_ROOT/$SONIC_UTILITIES_WHEEL_NAME -sudo LANG=C chroot $FILESYSTEM_ROOT pip install $SONIC_UTILITIES_WHEEL_NAME -sudo rm -rf $FILESYSTEM_ROOT/$SONIC_UTILITIES_WHEEL_NAME +# Install SONiC Utilities (and its dependencies via 'apt-get -y install -f') +sudo dpkg --root=$FILESYSTEM_ROOT -i target/debs/python-sonic-utilities_*.deb || \ + sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f # SONiC utilities installs bash-completion as a dependency. However, it is disabled by default # in bash.bashrc, so we copy a version of the file with it enabled here. diff --git a/rules/sonic-utilities.mk b/rules/sonic-utilities.mk index 1634ab88f46a..9349813f5c4e 100644 --- a/rules/sonic-utilities.mk +++ b/rules/sonic-utilities.mk @@ -1,7 +1,5 @@ # sonic utilities package -SONIC_UTILITIES = sonic_utilities-1.1-py2-none-any.whl -$(SONIC_UTILITIES)_SRC_PATH = $(SRC_PATH)/sonic-utilities -$(SONIC_UTILITIES)_PYTHON_VERSION = 2 -$(SONIC_UTILITIES)_DEPENDS += $(SWSSSDK_PY2) -SONIC_PYTHON_WHEELS += $(SONIC_UTILITIES) +SONIC_UTILS = python-sonic-utilities_1.1-1_all.deb +$(SONIC_UTILS)_SRC_PATH = $(SRC_PATH)/sonic-utilities +SONIC_PYTHON_STDEB_DEBS += $(SONIC_UTILS) diff --git a/slave.mk b/slave.mk index 16fea944853e..c26e4932f05a 100644 --- a/slave.mk +++ b/slave.mk @@ -380,7 +380,7 @@ $(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)) $$(addprefix $(TARGET_PATH)/,$$($$*_DOCKERS)) $$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_CONFIG_ENGINE)) $$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_UTILITIES)) +$(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)) $(HEADER) # Pass initramfs and linux kernel explicitly. They are used for all platforms export initramfs_tools="$(DEBS_PATH)/$(INITRAMFS_TOOLS)" @@ -397,7 +397,6 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : .platform 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))" - export sonic_utilities_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_UTILITIES))" $(foreach docker, $($*_DOCKERS),\ export docker_image="$(docker)" diff --git a/src/sonic-utilities b/src/sonic-utilities index e096aba55ed6..f59ccdb3ee40 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit e096aba55ed6c1ad4b0c8fd34bc22ccc71172d1a +Subproject commit f59ccdb3ee40452ab70666b6ab32505ad03867ca