Add a "stop signal" for VM installs (#4808)

* #4807 use audio device as sVM stop signal
This commit is contained in:
/rootzoll 2024-10-17 19:46:53 +02:00 committed by GitHub
parent 8317349e36
commit 3db54e1c66
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 2 deletions

View File

@ -24,7 +24,15 @@ fi
# special state: copysource
if [ "${state}" = "stop" ]; then
echo "OK ready for manual provision - run 'release' at the end."
echo "***********************************************************"
echo "Stop signal detectecd - OK ready for manual provision."
echo "If your ready for shutdown use the following command:"
echo "release --> for an official release"
echo "release -quick --> during development"
if [ "${vm}" = "1" ]; then
echo "REMOVE AUDIO DEVICE from VM before next boot up."
fi
echo "***********************************************************"
exit
# special state: copysource
elif [ "${state}" = "copysource" ]; then

View File

@ -132,7 +132,6 @@ echo "# raspi_bootdir(${raspi_bootdir})" >> $logFile
# when a file 'stop' is on the sd card bootfs partition root - stop for manual provision
flagExists=$(ls ${raspi_bootdir}/stop 2>/dev/null | grep -c 'stop')
if [ "${flagExists}" == "1" ]; then
# set state info
localip=$(hostname -I | awk '{print $1}')
/home/admin/_cache.sh set state "stop"
/home/admin/_cache.sh set message "stopped for manual provision ${localip}"
@ -143,6 +142,19 @@ if [ "${flagExists}" == "1" ]; then
exit 0
fi
# VM stop signal for manual provision - when an audio device is detected on a VM
flagExists=$(lspci | grep -c "Audio")
if [ "${vm}" == "1" ] && [ ${flagExists} -gt 0 ]; then
localip=$(hostname -I | awk '{print $1}')
/home/admin/_cache.sh set state "stop"
/home/admin/_cache.sh set message "VM stopped for manual provision"
systemctl stop background.service
systemctl stop background.scan.service
# log info
echo "INFO: 'bootstrap stopped - remove the audio device from the VM" >> ${logFile}
exit 0
fi
#########################
# INIT RaspiBlitz Cache
#########################