diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index 27737811e..d24ed7eac 100755 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -87,6 +87,18 @@ if [ "${setupStep}" != "100" ]; then fi 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 systemInitReboot=0 @@ -439,6 +451,9 @@ if [ ${isMounted} -eq 0 ]; then source ${infoFile} 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 echo "Temp mounting data drive ($hddCandidate)" >> $logFile if [ "${hddFormat}" != "btrfs" ]; then diff --git a/home.admin/setup.scripts/eventInfoWait.sh b/home.admin/setup.scripts/eventInfoWait.sh index bc5b54fd3..4cdd2d133 100644 --- a/home.admin/setup.scripts/eventInfoWait.sh +++ b/home.admin/setup.scripts/eventInfoWait.sh @@ -88,6 +88,15 @@ ssh admin@${localip} Use your Password A " 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 if [ "${setupPhase}" == "setup" ] || [ "${setupPhase}" == "update" ] || [ "${setupPhase}" == "recovery" ] || [ "${setupPhase}" == "migration" ]; then