Merge pull request #4520 from raspiblitz/dev

build and packer updates
This commit is contained in:
/rootzoll 2024-04-04 13:33:29 +02:00 committed by GitHub
commit c8feef9063
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 27 additions and 0 deletions

View file

@ -294,6 +294,15 @@ echo "[Login]
HandleLidSwitch=ignore HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore" | tee /etc/systemd/logind.conf.d/nosuspend.conf HandleLidSwitchDocked=ignore" | tee /etc/systemd/logind.conf.d/nosuspend.conf
# check if /etc/hosts already has debian entry
# prevent "unable to resolve host debian" error
isDebianInHosts=$(grep -c "debian" /etc/hosts)
if [ ${isDebianInHosts} -eq 0 ]; then
echo "# Adding debian to /etc/hosts"
echo "127.0.1.1 debian" | tee -a /etc/hosts > /dev/null
systemctl restart networking
fi
# FIXING LOCALES # FIXING LOCALES
# https://github.com/rootzoll/raspiblitz/issues/138 # https://github.com/rootzoll/raspiblitz/issues/138
# https://daker.me/2014/10/how-to-fix-perl-warning-setting-locale-failed-in-raspbian.html # https://daker.me/2014/10/how-to-fix-perl-warning-setting-locale-failed-in-raspbian.html

View file

@ -26,6 +26,14 @@ 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." echo "Start this script in the root of an writable 128GB NTFS formatted USB drive."
# check if internet is available
if ping -c 1 "1.1.1.1" &> /dev/null; then
echo "# checking internet"
else
echo "error='script needs internet connection to run'"
exit 1
fi
# get parameters # get parameters
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
@ -90,6 +98,13 @@ cd raspiblitz
# checkout the desired branch # checkout the desired branch
git checkout $BRANCH git checkout $BRANCH
if [ $? -gt 0 ]; then
cd ..
rm -rf raspiblitz 2>/dev/null
echo "# BRANCH: ${BRANCH}"
echo "error='git checkout BRANCH failed'"
exit 1
fi
# check commit hash if set # check commit hash if set
if [ ${#COMMITHASH} -gt 0 ]; then if [ ${#COMMITHASH} -gt 0 ]; then
@ -98,6 +113,8 @@ if [ ${#COMMITHASH} -gt 0 ]; then
echo "# actual(${actualCOMMITHASH}) ?= wanted(${COMMITHASH})" echo "# actual(${actualCOMMITHASH}) ?= wanted(${COMMITHASH})"
matches=$(echo "${actualCOMMITHASH}" | grep -c "${COMMITHASH}") matches=$(echo "${actualCOMMITHASH}" | grep -c "${COMMITHASH}")
if [ ${matches} -eq 0 ]; then if [ ${matches} -eq 0 ]; then
cd ..
rm -rf raspiblitz 2>/dev/null
echo "error='COMMITHASH of branch does not match'" echo "error='COMMITHASH of branch does not match'"
exit 1 exit 1
fi fi
@ -224,6 +241,7 @@ fi
echo "# clean up" echo "# clean up"
cd ..
rm -rf raspiblitz 2>/dev/null rm -rf raspiblitz 2>/dev/null
echo "# SIGN & SECURE IMAGE ###########################################" echo "# SIGN & SECURE IMAGE ###########################################"