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

Create the src archive in target/ when INSTALL_DEBUG_TOOLS=y #3323

Merged
merged 2 commits into from
Aug 28, 2019
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
5 changes: 1 addition & 4 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -485,10 +485,7 @@ then
sudo LANG=C chroot $FILESYSTEM_ROOT /bin/bash -c "echo '/debug is mounted in each docker' >> /etc/motd"

sudo mkdir -p $FILESYSTEM_ROOT/src
pushd src
../scripts/dbg_files.sh | sudo tar -cvzf ../$FILESYSTEM_ROOT/src/sonic_src.tar.gz -T -
popd

sudo cp $DEBUG_SRC_ARCHIVE_FILE $FILESYSTEM_ROOT/src/
sudo mkdir -p $FILESYSTEM_ROOT/debug

fi
Expand Down
11 changes: 7 additions & 4 deletions scripts/dbg_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

# Provide file paths to archive for debug image as relative to src subdir
#
for i in $debug_src_archive
do
find $i/ -name "*.c" -o -name "*.cpp" -o -name "*.h" -o -name "*.hpp" -type f
done
if [ "$DEBUG_IMG" == "y" ]
then
for i in $DEBUG_SRC_ARCHIVE_DIRS
do
find src/$i/ -name "*.c" -o -name "*.cpp" -o -name "*.h" -o -name "*.hpp" -type f
done | tar -czf $DEBUG_SRC_ARCHIVE_FILE -T -
fi

7 changes: 6 additions & 1 deletion slave.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ PROJECT_ROOT = $(shell pwd)
STRETCH_DEBS_PATH = $(TARGET_PATH)/debs/stretch
STRETCH_FILES_PATH = $(TARGET_PATH)/files/stretch
DBG_IMAGE_MARK = dbg
DBG_SRC_ARCHIVE_FILE = $(TARGET_PATH)/sonic_src.tar.gz

CONFIGURED_PLATFORM := $(shell [ -f .platform ] && cat .platform || echo generic)
PLATFORM_PATH = platform/$(CONFIGURED_PLATFORM)
Expand Down Expand Up @@ -667,9 +668,13 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \
chmod +x sonic_debian_extension.sh,
)

export debug_src_archive="$(DBG_SRC_ARCHIVE)"
DEBUG_IMG="$(INSTALL_DEBUG_TOOLS)" \
DEBUG_SRC_ARCHIVE_DIRS="$(DBG_SRC_ARCHIVE)" \
DEBUG_SRC_ARCHIVE_FILE="$(DBG_SRC_ARCHIVE_FILE)" \
scripts/dbg_files.sh

DEBUG_IMG="$(INSTALL_DEBUG_TOOLS)" \
DEBUG_SRC_ARCHIVE_FILE="$(DBG_SRC_ARCHIVE_FILE)" \
USERNAME="$(USERNAME)" \
PASSWORD="$(PASSWORD)" \
./build_debian.sh $(LOG)
Expand Down