diff --git a/build_debian.sh b/build_debian.sh index 9910ea742e..0124050019 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -205,7 +205,6 @@ sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install \ ## Note: don't install python-apt by pip, older than Debian repo one sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install \ file \ - ifupdown2 \ iproute2 \ bridge-utils \ isc-dhcp-client \ diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 7dfd6dadb6..70f0273b9b 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -65,6 +65,10 @@ sudo mkdir -p $FILESYSTEM_ROOT/etc/modprobe.d/ sudo mkdir -p $FILESYSTEM_ROOT/var/cache/sonic/ sudo mkdir -p $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/ +# Install a more recent version of ifupdown2 (and its dependencies via 'apt-get -y install -f') +sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/ifupdown2_*.deb || \ + sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f + # Install dependencies for SONiC config engine sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install \ python-dev \ diff --git a/rules/ifupdown2.mk b/rules/ifupdown2.mk new file mode 100644 index 0000000000..b663cc1532 --- /dev/null +++ b/rules/ifupdown2.mk @@ -0,0 +1,11 @@ +# ifupdown2 package + +IFUPDOWN2_VERSION = 1.2.8-1 +export IFUPDOWN2_VERSION + +IFUPDOWN2 = ifupdown2_$(IFUPDOWN2_VERSION)_all.deb +$(IFUPDOWN2)_SRC_PATH = $(SRC_PATH)/ifupdown2 +SONIC_MAKE_DEBS += $(IFUPDOWN2) +SONIC_STRETCH_DEBS += $(IFUPDOWN2) + +export IFUPDOWN2 diff --git a/slave.mk b/slave.mk index 3b10abfc78..c8cf6f25e4 100644 --- a/slave.mk +++ b/slave.mk @@ -590,6 +590,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ $(LINUX_KERNEL) \ $(SONIC_DEVICE_DATA) \ $(PYTHON_CLICK) \ + $(IFUPDOWN2) \ $(LIBPAM_TACPLUS) \ $(LIBNSS_TACPLUS)) \ $$(addprefix $(TARGET_PATH)/,$$($$*_DOCKERS)) \ diff --git a/src/ifupdown2/Makefile b/src/ifupdown2/Makefile new file mode 100644 index 0000000000..66b4df2ec3 --- /dev/null +++ b/src/ifupdown2/Makefile @@ -0,0 +1,21 @@ +.ONESHELL: +SHELL = /bin/bash +.SHELLFLAGS += -e + +MAIN_TARGET = $(IFUPDOWN2) + +$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : + # Remove any stale files + rm -rf ./ifupdown2-$(IFUPDOWN2_VERSION) ./$(IFUPDOWN2_VERSION).tar.gz + + # Get ifupdown2 release + wget --no-check-certificate https://github.com/CumulusNetworks/ifupdown2/archive/$(IFUPDOWN2_VERSION).tar.gz + tar -z -f $(IFUPDOWN2_VERSION).tar.gz -x + pushd ./ifupdown2-$(IFUPDOWN2_VERSION) + + # Build source and Debian packages + dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) + popd + + # Move the newly-built .deb packages to the destination directory + mv $* $(DEST)/