Skip to content

Commit 4f3977b

Browse files
Add files via upload
1 parent 4407726 commit 4f3977b

File tree

2 files changed

+48
-14
lines changed

2 files changed

+48
-14
lines changed

create_latest_candle_dev.sh

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ cat /etc/os-release
183183
echo
184184
echo
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
188191
echo "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
21082121
echo "Clearing /tmp"
21092122
rm -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+
21132133
echo '{"optOut": true,"lastUpdateCheck": 0}' > /home/pi/.config/configstore/update-notifier-npm.json
21142134
chown pi:pi /home/pi/.config/configstore/update-notifier-npm.json
21152135

21162136
# Remove files left over by Windows or MacOS
21172137
rm -rf /boot/.Spotlight*
2138+
21182139
if [ -f /boot/._cmdline.txt ]; then
21192140
rm /boot/._cmdline.txt
21202141
fi
@@ -2160,6 +2181,8 @@ fi
21602181
if [ -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"
21632186
fi
21642187

21652188
if [ -d /home/pi/.webthings/etc/wpa_supplicant ] \
@@ -2204,7 +2227,8 @@ then
22042227

22052228
else
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

install_candle_controller.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ then
120120
fi
121121

122122

123-
123+
echo
124124
echo "starting nvm install"
125125
nvm install 12
126126
nvm use 12
@@ -721,10 +721,10 @@ fi
721721

722722

723723

724-
if [ -d /home/pi/.webthings/data/zigbee2mqtt ];
724+
if [ -d /home/pi/.webthings/data/zigbee2mqtt-adapter ];
725725
then
726726

727-
cd /home/pi/.webthings/data/zigbee2mqtt
727+
cd /home/pi/.webthings/data/zigbee2mqtt-adapter
728728

729729
echo
730730
echo "pre-installing Zigbee2MQTT"
@@ -756,6 +756,11 @@ then
756756
#https://api.github.com/repos/Koenkk/zigbee2mqtt/releases/latest
757757

758758
cd /home/pi/
759+
760+
else
761+
echo "Candle: WARNING, /home/pi/.webthings/data/zigbee2mqtt does not exist? Cannot pre-install zigbee2mqtt"
762+
echo "Candle: WARNING, /home/pi/.webthings/data/zigbee2mqtt does not exist? Cannot pre-install zigbee2mqtt" | sudo tee -a /dev/kmsg
763+
echo "$(date) /home/pi/.webthings/data/zigbee2mqtt does not exist? Cannot pre-install zigbee2mqtt" | sudo tee -a /boot/candle_log.txt
759764
fi
760765

761766

0 commit comments

Comments
 (0)