Skip to content
Merged
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: 1 addition & 2 deletions src/sonic-build-hooks/scripts/buildinfo_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ else
PKG_CACHE_PATH=/sonic/target/vcache/${IMAGENAME}
fi
PKG_CACHE_FILE_NAME=${PKG_CACHE_PATH}/cache.tgz
$SUDO mkdir -p ${PKG_CACHE_PATH}
$SUDO chown $USER $PKG_CACHE_PATH
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

From the log, it looks like $USER="".
But it needs tests. SUDO can't be removed. Because there will be other error message.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@liushilongbuaa originally it was without sudo. Please see the PR description. Looks like sudo is not needed since the cache path is created with the regular user privileges long before executing the script during docker container build (environment doesn't have USER variable defined)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Building sonic-slave-* is different from build target/sonic-*.gz.
Some needs sudo, but some din't need.
I added sudo because of error message.

mkdir -p ${PKG_CACHE_PATH}

. ${BUILDINFO_PATH}/scripts/utils.sh

Expand Down