mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-20 21:23:28 +02:00
detect inconsistant sd card image
This commit is contained in:
@@ -87,6 +87,18 @@ if [ "${setupStep}" != "100" ]; then
|
|||||||
fi
|
fi
|
||||||
sudo chmod 777 ${infoFile}
|
sudo chmod 777 ${infoFile}
|
||||||
|
|
||||||
|
######################################
|
||||||
|
# CHECK SD CARD INCONSISTENT STATE
|
||||||
|
|
||||||
|
# when the provision did not ran thru without error (ask user for fresh sd card)
|
||||||
|
provisionFlagExists=$(sudo ls /home/admin/provision.flag | grep -c 'provision.flag')
|
||||||
|
if [ "${provisionFlagExists}" == "1" ]; then
|
||||||
|
sed -i "s/^state=.*/state=inconsistentsystem/g" ${infoFile}
|
||||||
|
sed -i "s/^message=.*/message='provision did not ran thru'/g" ${infoFile}
|
||||||
|
echo "FAIL: 'provision did not ran thru - need fresh sd card!" >> ${logFile}
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
######################################
|
######################################
|
||||||
# SECTION FOR POSSIBLE REBOOT ACTIONS
|
# SECTION FOR POSSIBLE REBOOT ACTIONS
|
||||||
systemInitReboot=0
|
systemInitReboot=0
|
||||||
@@ -439,6 +451,9 @@ if [ ${isMounted} -eq 0 ]; then
|
|||||||
source ${infoFile}
|
source ${infoFile}
|
||||||
echo "# PROVISION PROCESS with setupPhase(${setupPhase})"
|
echo "# PROVISION PROCESS with setupPhase(${setupPhase})"
|
||||||
|
|
||||||
|
# mark system on sd card as in setup process
|
||||||
|
echo "the provision process was started but did not finish yet" > /home/admin/provision.flag
|
||||||
|
|
||||||
# temp mount the HDD
|
# temp mount the HDD
|
||||||
echo "Temp mounting data drive ($hddCandidate)" >> $logFile
|
echo "Temp mounting data drive ($hddCandidate)" >> $logFile
|
||||||
if [ "${hddFormat}" != "btrfs" ]; then
|
if [ "${hddFormat}" != "btrfs" ]; then
|
||||||
|
@@ -88,6 +88,15 @@ ssh admin@${localip}
|
|||||||
Use your Password A
|
Use your Password A
|
||||||
" 7 41
|
" 7 41
|
||||||
|
|
||||||
|
elif [ "${eventID}" == "inconsistentsystem" ]; then
|
||||||
|
|
||||||
|
dialog --backtitle "${backtitle}" --cr-wrap --infobox "
|
||||||
|
PLEASE START WITH A FRESH SD CARD IMAGE
|
||||||
|
---------------------------------------
|
||||||
|
Cut power & remove sd card and then
|
||||||
|
flash a fresh RaspiBlitz image on it.
|
||||||
|
" 8 45
|
||||||
|
|
||||||
elif [ "${eventID}" == "waitsetup" ] && [ "${mode}" == "lcd" ]; then
|
elif [ "${eventID}" == "waitsetup" ] && [ "${mode}" == "lcd" ]; then
|
||||||
|
|
||||||
if [ "${setupPhase}" == "setup" ] || [ "${setupPhase}" == "update" ] || [ "${setupPhase}" == "recovery" ] || [ "${setupPhase}" == "migration" ]; then
|
if [ "${setupPhase}" == "setup" ] || [ "${setupPhase}" == "update" ] || [ "${setupPhase}" == "recovery" ] || [ "${setupPhase}" == "migration" ]; then
|
||||||
|
Reference in New Issue
Block a user