Skip to content

Commit

Permalink
Merge pull request #4520 from raspiblitz/dev
Browse files Browse the repository at this point in the history
build and packer updates
  • Loading branch information
rootzoll committed Apr 4, 2024
2 parents 3b60da7 + c7eb225 commit c8feef9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions build_sdcard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,15 @@ echo "[Login]
HandleLidSwitch=ignore
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
# https://github.com/rootzoll/raspiblitz/issues/138
# https://daker.me/2014/10/how-to-fix-perl-warning-setting-locale-failed-in-raspbian.html
Expand Down
18 changes: 18 additions & 0 deletions ci/packer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ echo "Results will be stored in:"
echo $BUILDFOLDER
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
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then

Expand Down Expand Up @@ -90,6 +98,13 @@ cd raspiblitz

# checkout the desired 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
if [ ${#COMMITHASH} -gt 0 ]; then
Expand All @@ -98,6 +113,8 @@ if [ ${#COMMITHASH} -gt 0 ]; then
echo "# actual(${actualCOMMITHASH}) ?= wanted(${COMMITHASH})"
matches=$(echo "${actualCOMMITHASH}" | grep -c "${COMMITHASH}")
if [ ${matches} -eq 0 ]; then
cd ..
rm -rf raspiblitz 2>/dev/null
echo "error='COMMITHASH of branch does not match'"
exit 1
fi
Expand Down Expand Up @@ -224,6 +241,7 @@ fi


echo "# clean up"
cd ..
rm -rf raspiblitz 2>/dev/null

echo "# SIGN & SECURE IMAGE ###########################################"
Expand Down

0 comments on commit c8feef9

Please sign in to comment.