mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
Restart with superuser privileges if needed
This commit is contained in:
13
compile.sh
13
compile.sh
@@ -60,17 +60,22 @@ if [ -d "$DEST/output" ]; then
|
||||
read
|
||||
fi
|
||||
|
||||
if [ $EUID != 0 ]; then
|
||||
echo -e "[\e[0;35m warn \x1B[0m] This script requires root privileges"
|
||||
sudo "$0" "$@"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#--------------------------------------------------------------------------------------------------------------------------------
|
||||
# Get updates of the main build libraries
|
||||
#--------------------------------------------------------------------------------------------------------------------------------
|
||||
apt-get -qq -y install git
|
||||
if [ -d "$SRC/lib" ]; then
|
||||
cd $SRC/lib
|
||||
git pull
|
||||
cd $SRC/lib
|
||||
git pull
|
||||
else
|
||||
# download SDK
|
||||
git clone --depth 1 https://github.com/igorpecovnik/lib
|
||||
# download SDK
|
||||
git clone --depth 1 https://github.com/igorpecovnik/lib
|
||||
fi
|
||||
|
||||
|
||||
|
||||
8
main.sh
8
main.sh
@@ -13,14 +13,6 @@
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
# currently there is no option to create an image without root
|
||||
# you can compile a kernel but you can complete the whole process
|
||||
# if you find a way, please submit code corrections. Thanks.
|
||||
if [ "$UID" -ne 0 ]
|
||||
then echo "Please run as root"; exit
|
||||
fi
|
||||
|
||||
# We'll use this tittle on all menus
|
||||
backtitle="Armbian building script, http://www.armbian.com | Author: Igor Pecovnik"
|
||||
mkdir -p $DEST/debug $SRC/userpatches/kernel $SRC/userpatches/u-boot
|
||||
|
||||
Reference in New Issue
Block a user