Skip to content

Commit

Permalink
[baseimage]: Fix tcpdmatch dependency (#1594)
Browse files Browse the repository at this point in the history
* Fix tcpdmatch dependency

Issue: sonic_debian_extension.j2 uses tcpdmatch from src folder
       which is result of libwrap build
Fix: added tcpd.deb to build results and extract required files
     from build results

* Install libwrap0 and tcpd deb packages
  • Loading branch information
yurypm authored and lguohan committed Apr 14, 2018
1 parent b097b96 commit 2b9f877
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
2 changes: 2 additions & 0 deletions rules/libwrap.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
5 changes: 4 additions & 1 deletion src/libwrap/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

0 comments on commit 2b9f877

Please sign in to comment.