added sas to both images. A few minor updates to image generation for pi images.
This commit is contained in:
+34
-17
@@ -24,13 +24,6 @@ mounted=1
|
||||
set -e # Don't want to destroy stuff if this goes majorly wrong.
|
||||
trap cleanup EXIT # make sure the script cleans up after itself before closing.
|
||||
|
||||
# shellcheck disable=SC2329 # verify_image is invoked from cleanup, which is invoked via trap EXIT
|
||||
verify_image() {
|
||||
echo "Checking completed image filesystems..."
|
||||
fsck.vfat -n "${loopdev}p1"
|
||||
e2fsck -fn "${loopdev}p2"
|
||||
}
|
||||
|
||||
# shellcheck disable=SC2329 # compress_image is invoked from finish_build
|
||||
compress_image() {
|
||||
local compressedImage="${imageName}.xz"
|
||||
@@ -50,16 +43,11 @@ compress_image() {
|
||||
|
||||
# shellcheck disable=SC2329 # cleanup_image is invoked from cleanup and finish_build
|
||||
cleanup_image() {
|
||||
local verifyFilesystems="${1:-false}"
|
||||
local cleanupStatus=0
|
||||
|
||||
if [[ $mounted -eq 0 ]]; then
|
||||
if ! umount -R /mnt; then
|
||||
cleanupStatus=1
|
||||
elif [[ "$verifyFilesystems" == true ]]; then
|
||||
if ! verify_image; then
|
||||
cleanupStatus=1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -85,12 +73,12 @@ cleanup() {
|
||||
local status=$? # capture original exit status so failures propagate
|
||||
local cleanupStatus=0
|
||||
|
||||
if ! cleanup_image false; then
|
||||
if ! cleanup_image; then
|
||||
cleanupStatus=1
|
||||
fi
|
||||
|
||||
if [[ $status -eq 0 && $cleanupStatus -ne 0 ]]; then
|
||||
echo "Image build commands completed, but cleanup or filesystem verification failed."
|
||||
echo "Image build commands completed, but cleanup failed."
|
||||
status=1
|
||||
fi
|
||||
|
||||
@@ -100,8 +88,8 @@ cleanup() {
|
||||
finish_build() {
|
||||
trap - EXIT
|
||||
|
||||
if ! cleanup_image true; then
|
||||
echo "Image build commands completed, but cleanup or filesystem verification failed."
|
||||
if ! cleanup_image; then
|
||||
echo "Image build commands completed, but cleanup failed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -112,6 +100,30 @@ finish_build() {
|
||||
exit 0
|
||||
}
|
||||
|
||||
# shellcheck disable=SC2329 # install_sas is emitted into the chroot heredoc with declare -f
|
||||
install_sas() {
|
||||
local sasRepo="https://git.stormux.org/storm/sas"
|
||||
local sasPath="/usr/local/bin/sas"
|
||||
local tempDir
|
||||
local installStatus=0
|
||||
|
||||
tempDir="$(mktemp -d)"
|
||||
|
||||
echo "Installing latest sas..."
|
||||
if ! git clone --depth 1 "$sasRepo" "$tempDir"; then
|
||||
rm -rf "$tempDir"
|
||||
return 1
|
||||
fi
|
||||
|
||||
rm -f "$sasPath"
|
||||
if ! install -m 755 "$tempDir/sas.py" "$sasPath"; then
|
||||
installStatus=1
|
||||
fi
|
||||
|
||||
rm -rf "$tempDir"
|
||||
return "$installStatus"
|
||||
}
|
||||
|
||||
help() {
|
||||
echo -e "Usage:\n"
|
||||
echo "With no arguments, build with default parameters."
|
||||
@@ -196,7 +208,7 @@ for i in arch-install-scripts dosfstools parted ; do
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
for i in e2fsck fsck.vfat sha1sum xz ; do
|
||||
for i in sha1sum xz ; do
|
||||
if ! command -v "$i" &> /dev/null ; then
|
||||
echo "Please install ${i} before continuing."
|
||||
exit 1
|
||||
@@ -330,6 +342,7 @@ packages=(
|
||||
bluez-utils
|
||||
brltty
|
||||
cronie
|
||||
curl
|
||||
dialog
|
||||
espeak-ng
|
||||
fake-hwclock
|
||||
@@ -370,6 +383,7 @@ packages=(
|
||||
rsync
|
||||
screen
|
||||
sox
|
||||
speech-dispatcher
|
||||
w3m-git
|
||||
wget
|
||||
wireless-regdb
|
||||
@@ -382,6 +396,9 @@ packages=(
|
||||
|
||||
pacman -Su --needed --noconfirm "\${packages[@]}"
|
||||
|
||||
$(declare -f install_sas)
|
||||
install_sas
|
||||
|
||||
# Fix mkinitcpio preset for linux-rpi - kms hook fails on aarch64
|
||||
# See: https://archlinuxarm.org/forum/viewtopic.php?t=16672
|
||||
if [[ -f /etc/mkinitcpio.d/linux-rpi.preset ]]; then
|
||||
|
||||
Reference in New Issue
Block a user