@@ -183,6 +183,9 @@ cat /etc/os-release
183183echo
184184echo
185185
186+ echo " /boot/cmdline.txt before:"
187+ cat /boot/cmdline.txt
188+ echo
186189
187190# Wait for IP address for at most 30 seconds
188191echo " Waiting for IP address..." >> /dev/kmsg
@@ -605,13 +608,17 @@ then
605608 # rm -rf /home/pi/.webthings # too dangerous
606609
607610 if [ -f /boot/candle_cutting_edge.txt ]; then
611+ echo " Candle: Starting download of cutting edge controller install script"
608612 echo " Candle: Starting download of cutting edge controller install script" >> /dev/kmsg
609613 echo " Candle: Starting download of cutting edge controller install script" >> /boot/candle_log.txt
614+ echo
610615 wget https://raw.githubusercontent.com/createcandle/install-scripts/main/install_candle_controller.sh -O ./install_candle_controller.sh
611616
612617 else
618+ echo " Candle: Starting download of stable controller install script"
613619 echo " Candle: Starting download of stable controller install script" >> /dev/kmsg
614620 echo " Candle: Starting download of stable controller install script" >> /boot/candle_log.txt
621+ echo
615622 curl -s https://api.github.com/repos/createcandle/install-scripts/releases/latest \
616623 | grep " tarball_url" \
617624 | cut -d : -f 2,3 \
@@ -1027,7 +1034,7 @@ then
10271034 echo " Candle: installing support packages" >> /dev/kmsg
10281035 echo " Candle: installing support packages" >> /boot/candle_log.txt
10291036 echo
1030- for i in arping autoconf ffmpeg libtool mosquitto policykit-1 sqlite3 libolm3 libffi6 nbtscan ufw iptables; do
1037+ for i in arping autoconf ffmpeg libtool mosquitto policykit-1 sqlite3 libolm3 libffi6 nbtscan ufw iptables liblivemedia-dev ; do
10311038 echo " $i "
10321039 echo " Candle: installing $i " >> /dev/kmsg
10331040 echo " Candle: installing $i " >> /boot/candle_log.txt
@@ -1129,6 +1136,8 @@ then
11291136 done
11301137
11311138
1139+ #
1140+
11321141 for i in \
11331142 chromium-browser git \
11341143 autoconf build-essential curl libbluetooth-dev libboost-python-dev libboost-thread-dev libffi-dev \
@@ -1379,7 +1388,9 @@ then
13791388 cd seeed-voicecard
13801389
13811390 if [ ! -f /home/pi/candle/installed_respeaker_version.txt ]; then
1382- touch /home/pi/candle/installed_respeaker_version.txt
1391+ mkdir -p /home/pi/candle
1392+ # touch /home/pi/candle/installed_respeaker_version.txt
1393+ cp ./dkms.conf /home/pi/candle/installed_respeaker_version.txt
13831394 fi
13841395
13851396 if [ -d " /etc/voicecard" ] && [ -f /bin/seeed-voicecard ];
@@ -1966,7 +1977,9 @@ if [ "$SKIP_RO" = no ] || [[ -z "${SKIP_RO}" ]]; then
19661977 if [ $( cat /boot/cmdline.txt | grep -c " init=/bin/ro-root.sh" ) -eq 0 ]
19671978 then
19681979 echo " - Modifying cmdline.txt for read-only file system"
1980+ echo " - - before: $( cat /boot/cmdline.txt) "
19691981 sed -i ' 1 s|.*|& init=/bin/ro-root.sh|' /boot/cmdline.txt
1982+ echo " - - after : $( cat /boot/cmdline.txt) "
19701983 echo " Candle: read-only mode is now enabled" >> /dev/kmsg
19711984 echo " Candle: read-only mode is now enabled" >> /boot/candle_log.txt
19721985 else
@@ -2108,13 +2121,21 @@ fi
21082121echo " Clearing /tmp"
21092122rm -rf /tmp/*
21102123
2111- rm /home/pi/.wget-hsts
2112- rm -rf /home/pi/.config/chromium
2124+ if [ -f /home/pi/.wget-hsts ]; then
2125+ rm /home/pi/.wget-hsts
2126+ fi
2127+
2128+ # TODO: is deleting this a good idea? Won't chromium just recreate it, this time without any modifications?
2129+ if [ -d /home/pi/.config/chromium ]; then
2130+ rm -rf /home/pi/.config/chromium
2131+ fi
2132+
21132133echo ' {"optOut": true,"lastUpdateCheck": 0}' > /home/pi/.config/configstore/update-notifier-npm.json
21142134chown pi:pi /home/pi/.config/configstore/update-notifier-npm.json
21152135
21162136# Remove files left over by Windows or MacOS
21172137rm -rf /boot/.Spotlight*
2138+
21182139if [ -f /boot/._cmdline.txt ]; then
21192140 rm /boot/._cmdline.txt
21202141fi
21602181if [ -f /boot/fstab3.bak ] \
21612182&& [ -f /boot/fstab4.bak ]; then
21622183 echo " /boot/fstab3.bak and /boot/fstab4.bak exist"
2184+ else
2185+ echo " ERROR, /boot/fstab3.bak and /boot/fstab4.bak do not exist"
21632186fi
21642187
21652188if [ -d /home/pi/.webthings/etc/wpa_supplicant ] \
@@ -2204,7 +2227,8 @@ then
22042227
22052228else
22062229 echo
2207- echo " ERROR, SOME VITAL FSTAB MOUNTPOINTS DO NOT EXIST"
2230+ echo " ERROR, SOME VITAL FSTAB MOUNTPOINTS DO NOT EXIST!"
2231+ echo
22082232
22092233 ls /home/pi/.webthings/etc/wpa_supplicant
22102234 ls /home/pi/.webthings/var/lib/bluetooth
@@ -2214,6 +2238,7 @@ else
22142238 ls /home/pi/.webthings/arduino/.arduino15
22152239 ls /home/pi/.webthings/arduino/Arduino
22162240
2241+ # The only reason this is not an error (which would stop the process), is that the process is nearly done anyway.
22172242 echo " Candle: WARNING, SOME VITAL MOUNTPOINTS DO NOT EXIST, NOT CHANGING FSTAB" >> /dev/kmsg
22182243 echo " Candle: WARNING, SOME VITAL MOUNTPOINTS DO NOT EXIST, NOT CHANGING FSTAB" >> /boot/candle_log.txt
22192244 echo
@@ -2229,7 +2254,7 @@ rm -rf /home/pi/configuration-files
22292254
22302255
22312256# if this is not a cutting edge build, then use the cmdline.txt and config.txt from the configuration files
2232- if [ ! -f /boot/candle_cutting_edge.txt ]; then
2257+ if [ ! -f /boot/candle_cutting_edge.txt ]; then # || [ ! -f /boot/candle_first_run_complete.txt ]; then
22332258
22342259 # Copy the Candle cmdline over the old one. This one is disk UUID agnostic.
22352260 if [ -f /boot/cmdline-candle.txt ]; then
@@ -2485,13 +2510,17 @@ then
24852510 echo " ALMOST DONE, RUNNING DEBUG SCRIPT"
24862511 echo
24872512
2488- /home/pi/candle/debug.sh > /boot/debug.txt
2513+ if [ -f /boot/candle_first_run_complete.txt ]; then
2514+ /home/pi/candle/debug.sh > /boot/debug.txt
24892515
2490- echo " " >> /boot/debug.txt
2491- echo " THIS OUTPUT WAS CREATED BY THE SYSTEM UPDATE PROCESS" >> /boot/debug.txt
2492- cat /boot/debug.txt
2516+ echo " " >> /boot/debug.txt
2517+ echo " THIS OUTPUT WAS CREATED BY THE SYSTEM UPDATE PROCESS" >> /boot/debug.txt
2518+ cat /boot/debug.txt
2519+ echo " Candle: DONE. Debug output placed in /boot/debug.txt" >> /dev/kmsg
2520+ else
2521+ /home/pi/candle/debug.sh
2522+ fi
24932523
2494- echo " Candle: DONE. Debug output placed in /boot/debug.txt" >> /dev/kmsg
24952524 echo
24962525 echo
24972526
0 commit comments