Used sequpgrade.sh to upgrade existing seqs

This commit is contained in:
2022-05-29 20:58:23 +02:00
parent 10ee4198f0
commit 6214493c18
57 changed files with 802 additions and 806 deletions

View File

@@ -24,8 +24,8 @@ SCRIPT_NAME=${SCRIPT_NAME%%.*}
CONFIG_FILE_NAME="${SCRIPT_NAME}.cfg"
CONFIG_FILE_TEMPLATE="$WDIR/${CONFIG_FILE_NAME}.example"
step_config() {
[ $QUIET -ne 0 ] && APTOPT="-y"
seq_config() {
quiet && APTOPT="-y"
return 0
}
@@ -33,16 +33,16 @@ step_1_info() {
echo "Download latest xz-compressed image [IMAGE FILE URL] [SD CARD DEVICE]"
echoinfo "$toolDownSite"
}
step_1_alias() { ALIAS="install"; }
step_1_alias() { echo "install"; }
step_1() {
shift
SDDEV="$2"
if [ -z "$1" ] && [ $QUIET -eq 0 ] ; then
if [ -z "$1" ] && interactive ; then
read -p "Provide image download url from $toolDownSite: " toolDownUrl
elif [ ! -z "$1" ] ; then
toolDownUrl="$1"
else
echoerr " [E] No image file provided for download"
error -e "No image file provided for download"
exit 1
fi
@@ -65,7 +65,7 @@ step_1() {
endReturn -o $? "Error downloading $downDownFile"
fi
echoseq " [I] Checking SHA256 checksum"
info "Checking SHA256 checksum"
exe cd $(dirname "$toolDownFile")
exe sha256sum -c "$downShaFile" >>/dev/null
endReturn -o $? "SHA256 checksum error"
@@ -81,14 +81,14 @@ step_2() {
# check if device was confirmed
endReturn -o $? "SD card device not found"
echoseq " [I] Writing $(basename "$toolDownFile")"
info "Writing $(basename "$toolDownFile")"
exep "xzcat \"$toolDownFile\" | dd of=$SDDEV bs=64k oflag=dsync status=progress"
exe sync
}
step_3_info() { echo "Prepare SD card for first run"; }
step_3() {
outColor green
color green
cat <<PREPARE_EOF
[I] Setup static IP
[etc/network/interfaces.d/eth0]
@@ -122,10 +122,10 @@ PREPARE_EOF
}
step_10_info() { echo "Essential debian setup"; }
step_10_alias() { ALIAS="setup"; }
step_10_alias() { echo "setup"; }
step_10() {
if [ -z "$(ls /etc/default | grep raspi)" ] ; then
echoerr " [E] Not on a Raspberry pi"
error -e "Not on a Raspberry pi"
return 1
fi
@@ -144,7 +144,7 @@ step_12() {
local localUs="en_US.UTF-8"
local localUsDefault="$localUs UTF-8"
if [ ! -f "$localesConfigLoc" ] ; then
echoerr " [E] Install packages locales first"
error -e "Install packages locales first"
exit 1
fi
@@ -152,18 +152,18 @@ step_12() {
endReturn -o $? "Changing locales failed"
exe locale-gen
exe update-locale LANG=$localUs
echoseq " [I] Logout and login for changes to be active"
info "Logout and login for changes to be active"
}
localesConfigLoc="/etc/locale.gen"
step_14_info() { echo "Change hostname [HOSTNAME]"; }
step_14_alias() { ALIAS="hostname"; }
step_14_alias() { echo "hostname"; }
step_14() {
shift
local localHostname=$1
endCheckEmpty localHostname "No hostname provided"
if [ $(grep -r "$localHostname" "$hostsLoc">>/dev/null; echo $?) -eq 0 ] ; then
echoseq " [I] Hostname $localHostname already defined"
info "Hostname $localHostname already defined"
return 0
fi
exe hostnamectl set-hostname "$localHostname"
@@ -173,14 +173,14 @@ step_14() {
hostsLoc="/etc/hosts"
step_16_info() { echo "Install cifs mounting requirements"; }
step_16_alias() { ALIAS="cifs"; }
step_16_alias() { echo "cifs"; }
step_16() {
exe apt install cifs-utils $APTOPT
}
step_17_info() { echo "Cifs notes"; }
step_17() {
outColor green
color green
cat <<CIFS_EOF
# Example fstab entry
[/etc/fstab]
@@ -203,9 +203,9 @@ CIFS_EOF
}
step_19_info() { echo "Setup notes"; }
step_19_alias() { ALIAS="setupnotes"; }
step_19_alias() { echo "setupnotes"; }
step_19() {
outColor green
color green
cat <<SETUPNOTES_EOF
# Secure root with a password
passwd
@@ -217,9 +217,9 @@ SETUPNOTES_EOF
}
step_40_info() { echo "Boot from HD notes"; }
step_40_alias() { ALIAS="hdboot"; }
step_40_alias() { echo "hdboot"; }
step_40() {
outColor green
color green
cat <<HDBOOT_EOF
[I] Raspberry pi 4 boots from USB automatically if there is no SD available
(needs boot loader version September 3rd)
@@ -268,7 +268,7 @@ read_sd_dev() {
fi
if [ ! -b "$SDDEV" ] ; then
echoerr " [I] $SDDEV not a block device"
info -e "$SDDEV not a block device"
SDDEV=
return 1
fi
@@ -296,5 +296,5 @@ read_sd_dev() {
}
SDBOOTPARTNO=1
SDROOTPARTNO=2
VERSION_SEQREV=12
readonly sqr_minVersion=16
. /usr/local/bin/sequencer.sh