clean release & init startup (rc6) (#4518)

This commit is contained in:
/rootzoll 2024-04-03 23:43:40 +02:00 committed by rootzoll
parent b377858178
commit dd8b195db9
9 changed files with 45 additions and 28 deletions

View file

@ -520,7 +520,7 @@ if [ "${baseimage}" = "raspios_arm64" ] || [ "${baseimage}" = "debian" ] || [ "$
# run as exec to dont allow easy physical access by keyboard # run as exec to dont allow easy physical access by keyboard
# see https://github.com/rootzoll/raspiblitz/issues/54 # see https://github.com/rootzoll/raspiblitz/issues/54
bash -c 'echo "# automatic start the LCD info loop" >> /home/pi/.bashrc' bash -c 'echo "# automatic start the LCD info loop" >> /home/pi/.bashrc'
bash -c 'echo "SCRIPT=/home/admin/00infoLCD.sh" >> /home/pi/.bashrc' bash -c 'echo "SCRIPT=\"sudo /home/admin/00infoLCD.sh\"" >> /home/pi/.bashrc'
bash -c 'echo "# replace shell with script => logout when exiting script" >> /home/pi/.bashrc' bash -c 'echo "# replace shell with script => logout when exiting script" >> /home/pi/.bashrc'
bash -c 'echo "exec \$SCRIPT" >> /home/pi/.bashrc' bash -c 'echo "exec \$SCRIPT" >> /home/pi/.bashrc'
echo "autostart LCD added to $homeFile" echo "autostart LCD added to $homeFile"

View file

@ -64,8 +64,8 @@ configFile="/mnt/hdd/raspiblitz.conf"
infoFile="/home/admin/raspiblitz.info" infoFile="/home/admin/raspiblitz.info"
# check that user is pi # check that user is pi
if [ "$USER" != "pi" ]; then if [ "$USER" != "pi" ] && [ "$USER" != "root" ]; then
echo "plz run as user pi --> su pi" echo "plz run as user pi or with sudo"
exit 1 exit 1
fi fi

View file

@ -124,6 +124,8 @@ if [ "${flagExists}" == "1" ]; then
# set state info # set state info
/home/admin/_cache.sh set state "stop" /home/admin/_cache.sh set state "stop"
/home/admin/_cache.sh set message "stopped for manual provision" /home/admin/_cache.sh set message "stopped for manual provision"
systemctl stop background.service
systemctl stop background.scan.service
# log info # log info
echo "INFO: 'bootstrap stopped - run command release after manual provison to remove stop flag" >> ${logFile} echo "INFO: 'bootstrap stopped - run command release after manual provison to remove stop flag" >> ${logFile}
exit 0 exit 0

View file

@ -1,3 +1,3 @@
# RaspiBlitz Version - always [major].[main].[sub] (sub can be a string like '2rc1') # RaspiBlitz Version - always [major].[main].[sub] (sub can be a string like '2rc1')
codeVersion="1.11.0" codeVersion="1.11.0rc6"
# keep last line with comment ---> IF YOU HAVE A NEW VERSION BRANCH > EDIT ALSO build_sdcard.sh # keep last line with comment ---> IF YOU HAVE A NEW VERSION BRANCH > EDIT ALSO build_sdcard.sh

View file

@ -44,7 +44,7 @@ if [ "${needsExpansion}" == "1" ]; then
fi fi
apt_install() { apt_install() {
apt install -y ${@} sudo DEBIAN_FRONTEND=noninteractive apt install -y ${@}
if [ $? -eq 100 ]; then if [ $? -eq 100 ]; then
echo "FAIL! apt failed to install needed packages!" echo "FAIL! apt failed to install needed packages!"
echo ${@} echo ${@}
@ -62,12 +62,13 @@ echo "# defaultAPIuser(${defaultAPIuser})"
echo "# defaultAPIrepo(${defaultAPIrepo})" echo "# defaultAPIrepo(${defaultAPIrepo})"
echo "# defaultWEBUIuser(${defaultWEBUIuser})" echo "# defaultWEBUIuser(${defaultWEBUIuser})"
echo "# defaultWEBUIrepo(${defaultWEBUIrepo})" echo "# defaultWEBUIrepo(${defaultWEBUIrepo})"
sleep 3
echo "* Adding nodeJS Framework ..." echo "* Adding nodeJS Framework ..."
/home/admin/config.scripts/bonus.nodejs.sh on || exit 1 /home/admin/config.scripts/bonus.nodejs.sh on || exit 1
echo "* Optional Packages (may be needed for extended features)" echo "* Optional Packages (may be needed for extended features)"
apt_install qrencode secure-delete fbi msmtp unclutter xterm python3-pyqt5 xfonts-terminus apache2-utils nginx python3-jinja2 socat libatlas-base-dev hexyl autossh apt_install qrencode secure-delete fbi msmtp unclutter xterm python3-pyqt5 xfonts-terminus python3-jinja2 socat libatlas-base-dev hexyl
echo "* Adding LND ..." echo "* Adding LND ..."
/home/admin/config.scripts/lnd.install.sh install || exit 1 /home/admin/config.scripts/lnd.install.sh install || exit 1

View file

@ -3,17 +3,22 @@
# Just run this script once after a fresh sd card build # Just run this script once after a fresh sd card build
# to prepare the image for release as a downloadable sd card image # to prepare the image for release as a downloadable sd card image
# stop background services
sudo systemctl stop background.service
sudo systemctl stop background.scan.service
# remove stop flag (if exists) # remove stop flag (if exists)
echo "deleting stop flag .." echo "deleting stop flag .."
sudo rm /boot/firmware/stop 2>/dev/null sudo rm /boot/firmware/stop 2>/dev/null
# cleaning logs # cleaning logs
echo "deleting raspiblitz & system logs .." echo "deleting raspiblitz & system logs .."
sudo rm /var/log/* 2>/dev/null sudo rm -rf /var/log/journal/* 2>/dev/null
sudo rm /var/log/redis/* 2>/dev/null sudo rm /var/log/redis/* 2>/dev/null
sudo rm /var/log/private/* 2>/dev/null sudo rm /var/log/private/* 2>/dev/null
sudo rm /var/log/nginx/* 2>/dev/null sudo rm /var/log/nginx/* 2>/dev/null
sudo rm /home/admin/*.log 2>/dev/null sudo rm /home/admin/*.log 2>/dev/null
logger -p info "****** RASPIBLITZ RELEASE ******"
echo "OK" echo "OK"
# clean raspiblitz.info toward the values set by sd card build script # clean raspiblitz.info toward the values set by sd card build script
@ -24,20 +29,6 @@ echo "cpu=${cpu}" >> /home/admin/raspiblitz.info
echo "blitzapi=${blitzapi}" >> /home/admin/raspiblitz.info echo "blitzapi=${blitzapi}" >> /home/admin/raspiblitz.info
echo "displayClass=${displayClass}" >> /home/admin/raspiblitz.info echo "displayClass=${displayClass}" >> /home/admin/raspiblitz.info
# SSH Pubkeys (make unique for every sd card image install)
echo
echo "deleting SSH Pub keys ..."
echo "they will get recreated on fresh bootup, by _bootstrap.sh service"
sudo rm /etc/ssh/ssh_host_*
sudo touch /etc/ssh/sshd_init_keys
echo "OK"
# https://github.com/rootzoll/raspiblitz/issues/1068#issuecomment-599267503
echo
echo "deleting local DNS confs ..."
sudo rm /etc/resolv.conf
echo "OK"
# make sure that every install runs API with own secret= # make sure that every install runs API with own secret=
echo echo
echo "deleting old API conf ..." echo "deleting old API conf ..."
@ -46,12 +37,8 @@ echo "OK"
# https://github.com/rootzoll/raspiblitz/issues/1371 # https://github.com/rootzoll/raspiblitz/issues/1371
echo echo
echo "deleting local WIFI conf ..." echo "deactivate local WIFI ..."
sudo rm /boot/wpa_supplicant.conf 2>/dev/null sudo nmcli radio wifi off
# reset entries
echo "ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US" | sudo tee /etc/wpa_supplicant/wpa_supplicant.conf 2>/dev/null
echo "OK" echo "OK"
# make sure that every install runs API with own secret # make sure that every install runs API with own secret
@ -68,6 +55,22 @@ echo "deleting redis data (if still there) ..."
sudo rm /var/lib/redis/dump.rdb 2>/dev/null sudo rm /var/lib/redis/dump.rdb 2>/dev/null
echo "OK" echo "OK"
# https://github.com/rootzoll/raspiblitz/issues/1068#issuecomment-599267503
echo
echo "reset DNS confs ..."
echo -e "nameserver 1.1.1.1\nnameserver 84.200.69.80" | sudo tee /etc/resolv.conf > /dev/null
echo "OK"
# SSH Pubkeys (make unique for every sd card image install)
echo
echo "deleting SSH Pub keys ..."
echo "keys will get recreated and sshd reactivated on fresh bootup, by _bootstrap.sh service"
sudo systemctl stop sshd
sudo systemctl disable sshd
sudo rm /etc/ssh/ssh_host_*
sudo touch /boot/firmware/ssh
echo "OK"
echo echo
echo "Will shutdown now." echo "Will shutdown now."
echo "Wait until Raspberry LEDs show no activity anymore." echo "Wait until Raspberry LEDs show no activity anymore."

View file

@ -191,8 +191,10 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
sudo apt install -y default-jdk sudo apt install -y default-jdk
sudo apt install -y maven sudo apt install -y maven
# make sure mysql/myria db is available # make sure mysql/myria db is available & running
sudo apt-get install -y mariadb-server mariadb-client sudo apt-get install -y mariadb-server mariadb-client
sudo systemctl enable mariadb 2>/dev/null
sudo systemctl start mariadb 2>/dev/null
# create a dedicated user for the app # create a dedicated user for the app
echo "# create user" echo "# create user"

View file

@ -131,6 +131,10 @@ if [ "$1" = "install" ]; then
# make sure needed os dependencies are installed # make sure needed os dependencies are installed
sudo apt-get install -y mariadb-server mariadb-client sudo apt-get install -y mariadb-server mariadb-client
# stop mariadb - will be activated when switched "on"
sudo systemctl stop mariadb
sudo systemctl disable mariadb
# add mempool user # add mempool user
sudo adduser --system --group --home /home/mempool mempool sudo adduser --system --group --home /home/mempool mempool
@ -202,6 +206,10 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
echo "# *** Activate MEMPOOL ***" echo "# *** Activate MEMPOOL ***"
# make sure mariadb is running
sudo systemctl enable mariadb 2>/dev/null
sudo systemctl start mariadb 2>/dev/null
isActive=$(sudo ls /etc/systemd/system/mempool.service 2>/dev/null | grep -c 'mempool.service') isActive=$(sudo ls /etc/systemd/system/mempool.service 2>/dev/null | grep -c 'mempool.service')
if [ ${isActive} -eq 0 ]; then if [ ${isActive} -eq 0 ]; then

View file

@ -216,6 +216,7 @@ elif [ "${eventID}" == "waitsetup" ] && [ "${mode}" == "lcd" ]; then
fi fi
# show default login help info # show default login help info
logger -p info "eventInfoWait.sh: waitsetup dialog"
dialog --backtitle "${backtitle}" --cr-wrap --infobox " dialog --backtitle "${backtitle}" --cr-wrap --infobox "
${welcomeline} ${welcomeline}
------------------------------------ ------------------------------------