Skip to content

[sonic-cli] add a new cli to host environment. #1819

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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: 3 additions & 0 deletions dockers/docker-fpm-quagga/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ supervisorctl start bgpcfgd

supervisorctl start rsyslogd

chmod 777 -R /var/run/quagga
chown -R quagga /var/run/quagga
chgrp -R quagga /var/run/quagga
# Start Quagga processes
supervisorctl start zebra
supervisorctl start bgpd
Expand Down
2 changes: 2 additions & 0 deletions files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ sudo cp -f $IMAGE_CONFIGS/bash/bash.bashrc $FILESYSTEM_ROOT/etc/
sudo dpkg --root=$FILESYSTEM_ROOT -i target/debs/sonic-device-data_*.deb || \
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f

# Install sonic-cli
sudo dpkg --root=$FILESYSTEM_ROOT -i target/debs/sonic-cli*.deb
# Install pam-tacplus and nss-tacplus
sudo dpkg --root=$FILESYSTEM_ROOT -i target/debs/libtac2_*.deb
sudo dpkg --root=$FILESYSTEM_ROOT -i target/debs/libpam-tacplus_*.deb
Expand Down
1 change: 1 addition & 0 deletions rules/docker-fpm-quagga.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ SONIC_DOCKER_IMAGES += $(DOCKER_FPM_QUAGGA)
$(DOCKER_FPM_QUAGGA)_CONTAINER_NAME = bgp
$(DOCKER_FPM_QUAGGA)_RUN_OPT += --net=host --privileged -t
$(DOCKER_FPM_QUAGGA)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
$(DOCKER_FPM_QUAGGA)_RUN_OPT += -v /var/run/quagga:/var/run/quagga:rw

$(DOCKER_FPM_QUAGGA)_BASE_IMAGE_FILES += vtysh:/usr/bin/vtysh
8 changes: 8 additions & 0 deletions rules/sonic-cli.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# sonic-cli packages

CLI_VERSION = 1.0.0

SONIC_CLI = sonic-cli-$(CLI_VERSION)-Linux.deb
$(SONIC_CLI)_DEPENDS += $(LIBTAC_DEV)
$(SONIC_CLI)_SRC_PATH = $(SRC_PATH)/sonic-utilities/sonic-cli
SONIC_CMAKE_DEBS += $(SONIC_CLI)
33 changes: 32 additions & 1 deletion slave.mk
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,35 @@ $(addprefix $(DEBS_PATH)/, $(SONIC_DPKG_DEBS)) : $(DEBS_PATH)/% : .platform $$(a

SONIC_TARGET_LIST += $(addprefix $(DEBS_PATH)/, $(SONIC_DPKG_DEBS))

# Build project with cmake
# Add new package for build:
# SOME_NEW_DEB = some_new_deb.deb
# $(SOME_NEW_DEB)_SRC_PATH = $(SRC_PATH)/project_name
# $(SOME_NEW_DEB)_DEPENDS = $(SOME_OTHER_DEB1) $(SOME_OTHER_DEB2) ...
# SONIC_CMAKE_DEBS += $(SOME_NEW_DEB)
$(addprefix $(DEBS_PATH)/, $(SONIC_CMAKE_DEBS)) : $(DEBS_PATH)/% : .platform $$(addsuffix -install,$$(addprefix $(DEBS_PATH)/,$$($$*_DEPENDS)))
$(HEADER)
# Build project and take package
pushd $($*_SRC_PATH) $(LOG)
pwd
rm -rf build
mkdir build
cd build
if [ $(ENABLE_DEBUG) == y ]; then
cmake -DCMAKE_BUILD_TYPE=Debug ..
else
cmake ..
fi

make package
popd $(LOG)

# clean up
mv $(addprefix $($*_SRC_PATH)/build/, $* $($*_DERIVED_DEBS) $($*_EXTRA_DEBS)) $(DEBS_PATH) $(LOG)
$(FOOTER)

SONIC_TARGET_LIST += $(addprefix $(DEBS_PATH)/, $(SONIC_DPKG_DEBS))

# Build project with python setup.py --command-packages=stdeb.command
# Add new package for build:
# SOME_NEW_DEB = some_new_deb.deb
Expand Down Expand Up @@ -450,7 +479,8 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \
$(SONIC_UTILS) \
$(LIBWRAP) \
$(LIBPAM_TACPLUS) \
$(LIBNSS_TACPLUS)) \
$(LIBNSS_TACPLUS) \
$(SONIC_CLI)) \
$$(addprefix $(TARGET_PATH)/,$$($$*_DOCKERS)) \
$$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_CONFIG_ENGINE)) \
$$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_PLATFORM_COMMON_PY2))
Expand Down Expand Up @@ -536,6 +566,7 @@ SONIC_CLEAN_DEBS = $(addsuffix -clean,$(addprefix $(DEBS_PATH)/, \
$(SONIC_DPKG_DEBS) \
$(SONIC_PYTHON_STDEB_DEBS) \
$(SONIC_DERIVED_DEBS) \
$(SONIC_CMAKE_DEBS) \
$(SONIC_EXTRA_DEBS)))

SONIC_CLEAN_FILES = $(addsuffix -clean,$(addprefix $(FILES_PATH)/, \
Expand Down
2 changes: 2 additions & 0 deletions sonic-slave/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ RUN apt-get update && apt-get install -y \
libpcre3-dev \
gawk \
chrpath \
# For sonic-cli
libaudit-dev \
# For frr build
libc-ares-dev \
hardening-wrapper \
Expand Down