Add USERPATCHES_PATH optional setting to config file. (#1450)

Required if userpatches folder is conflicted between two different configs.
This is frequent and requires maintaining two copies of the builder.
This commit is contained in:
Przemysław Sztoch
2019-07-10 04:50:50 +02:00
committed by lanefu
parent 94027c0f58
commit bc0fbb85bc
8 changed files with 38 additions and 39 deletions

View File

@@ -642,18 +642,16 @@ prepare_host()
fi
# create directory structure
mkdir -p $SRC/{cache,output,userpatches}
mkdir -p $SRC/{cache,output} $USERPATCHES_PATH
if [[ -n $SUDO_USER ]]; then
chgrp --quiet sudo cache output userpatches
chgrp --quiet sudo cache output $USERPATCHES_PATH
# SGID bit on cache/sources breaks kernel dpkg packaging
chmod --quiet g+w,g+s output userpatches
chmod --quiet g+w,g+s output $USERPATCHES_PATH
# fix existing permissions
find $SRC/output $SRC/userpatches -type d ! -group sudo -exec chgrp --quiet sudo {} \;
find $SRC/output $SRC/userpatches -type d ! -perm -g+w,g+s -exec chmod --quiet g+w,g+s {} \;
find $SRC/output $USERPATCHES_PATH -type d ! -group sudo -exec chgrp --quiet sudo {} \;
find $SRC/output $USERPATCHES_PATH -type d ! -perm -g+w,g+s -exec chmod --quiet g+w,g+s {} \;
fi
mkdir -p $DEST/debs/extra $DEST/{config,debug,patch} $SRC/userpatches/overlay $SRC/cache/{sources,toolchains,utility,rootfs} $SRC/.tmp
find $SRC/patch -type d ! -name . | sed "s%/patch%/userpatches%" | xargs mkdir -p
mkdir -p $DEST/debs/extra $DEST/{config,debug,patch} $USERPATCHES_PATH/overlay $SRC/cache/{sources,toolchains,utility,rootfs} $SRC/.tmp
display_alert "Checking for external GCC compilers" "" "info"
# download external Linaro compiler and missing special dependencies since they are needed for certain sources
@@ -698,12 +696,12 @@ prepare_host()
# download etcher CLI utility
download_etcher_cli
[[ ! -f $SRC/userpatches/customize-image.sh ]] && cp $SRC/config/templates/customize-image.sh.template $SRC/userpatches/customize-image.sh
[[ ! -f $USERPATCHES_PATH/customize-image.sh ]] && cp $SRC/config/templates/customize-image.sh.template $USERPATCHES_PATH/customize-image.sh
if [[ ! -f $SRC/userpatches/README ]]; then
rm -f $SRC/userpatches/readme.txt
echo 'Please read documentation about customizing build configuration' > $SRC/userpatches/README
echo 'http://www.armbian.com/using-armbian-tools/' >> $SRC/userpatches/README
if [[ ! -f $USERPATCHES_PATH/README ]]; then
rm -f $USERPATCHES_PATH/readme.txt
echo 'Please read documentation about customizing build configuration' > $USERPATCHES_PATH/README
echo 'http://www.armbian.com/using-armbian-tools/' >> $USERPATCHES_PATH/README
fi
# check free space (basic)