Skip to content

Commit f5812c2

Browse files
committed
Cleaned up WORKSPACE/HOME usage in setup
- Removed HOME from SAVE_ENV since we don't set it anywhere - Added WORKSPACE to SAVE_ENV as we do set that one - Removed chown for /opt as that could break certain usages of the image and is not needed Signed-off-by: Craig Magina <cmagina@redhat.com>
1 parent 1701578 commit f5812c2

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

scripts/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ declare -a SAVE_VARS=(
2323
"CUDA_VERSION"
2424
"CUSTOM_LLVM"
2525
"DISPLAY"
26-
"HOME"
2726
"INSTALL_JUPYTER"
2827
"INSTALL_TOOLS"
2928
"INSTALL_TRITON"
@@ -34,6 +33,7 @@ declare -a SAVE_VARS=(
3433
"TRITON_CPU_BACKEND"
3534
"USE_CCACHE"
3635
"WAYLAND_DISPLAY"
36+
"WORKSPACE"
3737
"XDG_RUNTIME_DIR"
3838
)
3939

scripts/setup_user.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ create_user() {
110110
fix_permissions() {
111111
echo "Fixing permissions for user $USERNAME ..."
112112
chown "$USERNAME:$GROUP_ID" -R "$HOME"
113-
chown "$USERNAME:$GROUP_ID" -R /opt
114-
chown "$USERNAME:$GROUP_ID" -R "$WORKSPACE"
115-
mkdir -p "/run/user/$USER_ID"
116-
chown "$USERNAME:$GROUP_ID" "/run/user/$USER_ID"
113+
[[ -n "$WORKSPACE" && -d $WORKSPACE ]] && chown "$USERNAME:$GROUP_ID" -R "$WORKSPACE"
114+
115+
mkdir -p "/run/user/$USER_UID"
116+
chown "$USERNAME:$USER_GID" "/run/user/$USER_UID"
117117
}
118118

119119
##

0 commit comments

Comments
 (0)