diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 0849118b83a4..d0afa4659667 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -246,7 +246,10 @@ sudo cp $IMAGE_CONFIGS/ssh/sshd-config-updater $FILESYSTEM_ROOT/usr/bin/ sudo chmod +x $FILESYSTEM_ROOT/usr/bin/sshd-config-updater sudo cp $IMAGE_CONFIGS/ssh/sshd-clear-denied-sessions $FILESYSTEM_ROOT/usr/bin sudo chmod +x $FILESYSTEM_ROOT/usr/bin/sshd-clear-denied-sessions -sudo cp src/libwrap/tcp-wrappers-7.6.q/tcpdmatch $FILESYSTEM_ROOT/usr/bin +sudo dpkg --root=$FILESYSTEM_ROOT -i target/debs/libwrap0_*_amd64.deb || \ + sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f +sudo dpkg --root=$FILESYSTEM_ROOT -i target/debs/tcpd_*_amd64.deb || \ + sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f ## copy platform rc.local sudo cp $IMAGE_CONFIGS/platform/rc.local $FILESYSTEM_ROOT/etc/ diff --git a/rules/libwrap.mk b/rules/libwrap.mk index 336a2ec68c9f..aab8e959d143 100644 --- a/rules/libwrap.mk +++ b/rules/libwrap.mk @@ -8,3 +8,5 @@ LIBWRAP = libwrap0_$(LIBWRAP_VERSION)_amd64.deb $(LIBWRAP)_SRC_PATH = $(SRC_PATH)/libwrap SONIC_MAKE_DEBS += $(LIBWRAP) +TCPD = tcpd_$(LIBWRAP_VERSION)_amd64.deb +$(eval $(call add_derived_package,$(LIBWRAP),$(TCPD))) diff --git a/src/libwrap/Makefile b/src/libwrap/Makefile index fea6f134ab58..4cb2e88a0c46 100644 --- a/src/libwrap/Makefile +++ b/src/libwrap/Makefile @@ -3,6 +3,7 @@ SHELL = /bin/bash .SHELLFLAGS += -e MAIN_TARGET = libwrap0_$(LIBWRAP_VERSION)_amd64.deb +DERIVED_TARGETS = tcpd_$(LIBWRAP_VERSION)_amd64.deb $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : # Remove any stale files @@ -19,5 +20,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : popd # Move the newly-built .deb packages to the destination directory - mv $* $(DEST)/ + mv $(DERIVED_TARGETS) $* $(DEST)/ + +$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)