Update directory permissions when using sudo

This commit is contained in:
zador-blood-stained 2017-07-26 15:50:00 +03:00
parent 8396c95368
commit fa7052927f
2 changed files with 10 additions and 0 deletions

View File

@ -547,6 +547,12 @@ prepare_host()
# create directory structure
mkdir -p $DEST/debs/extra $DEST/{config,debug,patch} $SRC/userpatches/overlay $SRC/cache/{sources,toolchains,rootfs} $SRC/.tmp
if [[ -n $SUDO_USER ]]; then
chgrp --quiet sudo cache output userpatches
# SGID bit on cache/sources breaks kernel dpkg packaging
chmod --quiet g+w,g+s output userpatches
fi
find $SRC/patch -type d ! -name . | sed "s%/patch%/userpatches%" | xargs mkdir -p
# download external Linaro compiler and missing special dependencies since they are needed for certain sources

View File

@ -17,6 +17,10 @@ if [[ $(basename $0) == main.sh ]]; then
exit -1
fi
# default umask for root is 022 so parent directories won't be group writeable without this
# this is used instead of making the chmod in prepare_host() recursive
umask 002
# destination
DEST=$SRC/output