mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-22 16:10:55 +02:00
update packer script
This commit is contained in:
57
ci/packer.sh
57
ci/packer.sh
@@ -11,45 +11,64 @@ REPO="https://github.com/raspiblitz/raspiblitz"
|
|||||||
# folders to store the build results
|
# folders to store the build results
|
||||||
BUILDFOLDER="images"
|
BUILDFOLDER="images"
|
||||||
|
|
||||||
|
# check if started with sudo
|
||||||
|
if [ "$EUID" -ne 0 ]; then
|
||||||
|
echo "error='run as root / may use sudo'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# usage info
|
||||||
|
echo "packer.sh [BRANCH] [arm|x86] [min|fat] [?lastcommithash]"
|
||||||
echo "Build RaspiBlitz install images on a Debian LIVE system"
|
echo "Build RaspiBlitz install images on a Debian LIVE system"
|
||||||
echo "From repo (change in script is needed):"
|
echo "From repo (change in script is needed):"
|
||||||
echo $REPO
|
echo $REPO
|
||||||
echo "Results will be stored in:"
|
echo "Results will be stored in:"
|
||||||
echo $BUILDFOLDER
|
echo $BUILDFOLDER
|
||||||
|
echo "Start this script in the root of an writable 128GB NTFS formatted USB drive."
|
||||||
|
|
||||||
# give info if not started with parameters
|
# get parameters
|
||||||
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||||||
echo "Start this script in the root of an writable 128GB NTFS formatted USB drive:"
|
|
||||||
echo "packer.sh [BRANCH] [arm|x86] [min|fat] [?lastcommithash]"
|
# by input
|
||||||
exit 1
|
read -p "Press ENTER to continue or CTRL+C to exit"
|
||||||
|
read -p "Enter the branch to build (default: dev): " BRANCH
|
||||||
|
read -p "Enter the architecture to build (arm|x86): " ARCH
|
||||||
|
read -p "Enter the type to build (min|fat): " TYPE
|
||||||
|
read -p "Enter the last commit hash to check (optional): " COMMITHASH
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
# by command line
|
||||||
|
BRANCH=$1
|
||||||
|
ARCH=$2
|
||||||
|
TYPE=$3
|
||||||
|
COMMITHASH=$4
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BRANCH=$1
|
|
||||||
ARCH=$2
|
|
||||||
TYPE=$3
|
|
||||||
COMMITHASH=$4
|
|
||||||
|
|
||||||
# check if branch is set
|
# check if branch is set
|
||||||
if [ "$BRANCH" == "[BRANCH]" ]; then
|
if [ ${#BRANCH} -eq 0 ]; then
|
||||||
echo "error='branch not set'"
|
echo "error='branch not set'"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check if output is set
|
# check if arch is set
|
||||||
if [ -z "$ARCH" ]; then
|
if [ ${#ARCH} -eq 0 ]; then
|
||||||
echo "error='ARCH not set'"
|
echo "error='ARCH not set'"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
if [ "$ARCH" != "arm" ] && [ "$ARCH" != "x86" ]; then
|
||||||
# check if output is set
|
echo "error='ARCH not supported'"
|
||||||
if [ -z "TYPE" ]; then
|
|
||||||
echo "error='TYPE not set'"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check if started with sudo
|
# check if type is set
|
||||||
if [ "$EUID" -ne 0 ]; then
|
if [ ${#TYPE} -eq 0 ]; then
|
||||||
echo "error='run as root / may use sudo'"
|
echo "error='TYPE not set'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ "$TYPE" != "min" ] && [ "$TYPE" != "fat" ]; then
|
||||||
|
echo "error='TYPE not supported'"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user