Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[socat]: build socat with readline #1919

Merged
merged 1 commit into from
Aug 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to use "dget" to simplify the steps to get and extract the source code?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sometimes, debian update the package version causing our build break.

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