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

Allow build image with local changes for debug purpose #247

Merged
merged 3 commits into from
Feb 15, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ DOCKER_BUILD = docker build --no-cache \
-f slave.mk \
PLATFORM=$(PLATFORM) \
SKU=$(SKU) \
DEBUG_BUILD=$(DEBUG_BUILD) \
Copy link
Contributor

@stcheng stcheng Feb 4, 2017

Choose a reason for hiding this comment

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

one more space #Resolved

Copy link
Collaborator

@lguohan lguohan Feb 5, 2017

Choose a reason for hiding this comment

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

can you add this into rules/config? #Resolved

Copy link
Contributor Author

Choose a reason for hiding this comment

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

don't quite get you. In default we are having this option off now. That should be the correct default behavior right?


In reply to: 99479772 [](ancestors = 99479772)

Copy link
Collaborator

@lguohan lguohan Feb 7, 2017

Choose a reason for hiding this comment

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

in the rules/config file, and a build option
DEBUG_BUILD = n

by default, we do not enable debug_build. You can also change it to DEBUG_BUILD=y #Resolved

$@

sonic-slave-build :
Expand Down
7 changes: 5 additions & 2 deletions build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
## Retrieval short version of Git revision hash for partition metadata
if [ -z "$(git status --untracked-files=no -s --ignore-submodules)" ]; then
GIT_REVISION=$(git rev-parse --short HEAD)
else
echo "Warning: There is local changes not committed to git repo. Cannot get a revision hash for partition metadata."
elif [ -z "$DEBUG_BUILD" ]; then
echo "Error: There are local changes not committed to git repo. Cannot get a revision hash for partition metadata."
exit 1
else
echo "Warning: There are local changes not committed to git repo, revision hash won't be tracked. Never deploy this image for other than debugging purpose."
GIT_REVISION=$(git rev-parse --short HEAD)"_local_debug"
fi

Expand Down
2 changes: 1 addition & 1 deletion slave.mk
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : .platform
)

./build_debian.sh "$(USERNAME)" "$(shell perl -e 'print crypt("$(PASSWORD)", "salt"),"\n"')" $(LOG)
TARGET_MACHINE=$($*_MACHINE) IMAGE_TYPE=$($*_IMAGE_TYPE) ./build_image.sh $(LOG)
TARGET_MACHINE=$($*_MACHINE) IMAGE_TYPE=$($*_IMAGE_TYPE) DEBUG_BUILD=$(DEBUG_BUILD) ./build_image.sh $(LOG)

$(foreach docker, $($*_DOCKERS), \
rm $($(docker)_CONTAINER_NAME).sh
Expand Down