Skip to content

Commit

Permalink
[socat]: build socat with readline (#1919)
Browse files Browse the repository at this point in the history
support readline in bcmsh

Signed-off-by: Guohan Lu <gulv@microsoft.com>
  • Loading branch information
lguohan authored Aug 13, 2018
1 parent f3ca7c4 commit 0cd4ef0
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 5 deletions.
3 changes: 0 additions & 3 deletions dockers/docker-base/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ RUN apt-get -y install \
# eliminating memory leaks
RUN apt-get -y -t jessie-backports install rsyslog

# Pre-install troubleshooting packages
RUN apt-get -y install socat

COPY ["etc/rsyslog.conf", "/etc/rsyslog.conf"]
COPY ["etc/rsyslog.d/*", "/etc/rsyslog.d/"]
COPY ["root/.vimrc", "/root/.vimrc"]
Expand Down
2 changes: 1 addition & 1 deletion platform/broadcom/docker-syncd-brcm/base_image_files/bcmsh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

docker exec -i syncd bcmsh "$@"
docker exec -it syncd bcmsh "$@"
2 changes: 1 addition & 1 deletion platform/broadcom/docker-syncd-brcm/bcmsh
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ if [ "$quiet" = false ]; then
echo "$banner"
fi

/usr/bin/socat - UNIX-CONNECT:/var/run/sswsyncd/sswsyncd.socket
/usr/bin/socat readline UNIX-CONNECT:/var/run/sswsyncd/sswsyncd.socket

1 change: 1 addition & 0 deletions rules/docker-base.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ $(DOCKER_BASE)_PATH = $(DOCKERS_PATH)/docker-base
$(DOCKER_BASE)_DEPENDS += $(SUPERVISOR)
$(DOCKER_BASE)_DEPENDS += $(LIBWRAP)
$(DOCKER_BASE)_DEPENDS += $(BASH)
$(DOCKER_BASE)_DEPENDS += $(SOCAT)

ifeq ($(SONIC_INSTALL_DEBUG_TOOLS),y)
GDB = gdb
Expand Down
9 changes: 9 additions & 0 deletions rules/socat.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# socat packages

SOCAT_VERSION = 1.7.3.1-2+deb9u1

export SOCAT_VERSION

SOCAT = socat_$(SOCAT_VERSION)_amd64.deb
$(SOCAT)_SRC_PATH = $(SRC_PATH)/socat
SONIC_MAKE_DEBS += $(SOCAT)
28 changes: 28 additions & 0 deletions src/socat/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.ONESHELL:
SHELL = /bin/bash
.SHELLFLAGS += -e

MAIN_TARGET = socat_$(SOCAT_VERSION)_amd64.deb

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Remove any stale files
rm -rf ./socat-1.7.3.1

# Get source package
wget -NO socat_$(SOCAT_VERSION).dsc "https://sonicstorage.blob.core.windows.net/packages/debian/socat_1.7.3.1-2+deb9u1.dsc?sv=2015-04-05&sr=b&sig=Ph7aMqb%2F%2FE%2F8qwxMXoXb5oK1YPkfVt6PV8mBBv5Wi%2F4%3D&se=2155-07-05T11%3A42%3A29Z&sp=r"
wget -NO socat_$(SOCAT_VERSION).debian.tar.xz "https://sonicstorage.blob.core.windows.net/packages/debian/socat_1.7.3.1-2+deb9u1.debian.tar.xz?sv=2015-04-05&sr=b&sig=yv77Fr5RtZgRTPmJK3j0lZ0BzsCiGaSs2i7NqQKEy2Y%3D&se=2155-07-05T11%3A39%3A59Z&sp=r"
wget -NO socat_1.7.3.1.orig.tar.gz "https://sonicstorage.blob.core.windows.net/packages/debian/socat_1.7.3.1.orig.tar.gz?sv=2015-04-05&sr=b&sig=0Ai1FM604aGsF5uBu2yN8w9O1a6zNjIDCdaiTo24DyQ%3D&se=2155-07-05T11%3A40%3A14Z&sp=r"

dpkg-source -x socat_$(SOCAT_VERSION).dsc

# Build source and Debian packages
pushd socat-1.7.3.1
patch -p0 < ../enable_readline.patch
dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS)
popd

# Move the newly-built .deb packages to the destination directory
mv $(DERIVED_TARGETS) $* $(DEST)/

$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)

13 changes: 13 additions & 0 deletions src/socat/enable_readline.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- debian/rules.old 2018-08-12 11:48:42.220230100 +0000
+++ debian/rules 2018-08-12 11:48:52.072230100 +0000
@@ -12,9 +12,6 @@
%:
dh $@ --with=autoreconf

-override_dh_auto_configure:
- dh_auto_configure -- --disable-readline
-
override_dh_auto_test:

-.PHONY: override_dh_auto_configure override_dh_auto_test
+.PHONY: override_dh_auto_test

0 comments on commit 0cd4ef0

Please sign in to comment.