From e170805ce6c856a6b36e84e28823e5b68874f2b8 Mon Sep 17 00:00:00 2001 From: nagumii Date: Sat, 21 Dec 2024 17:44:40 +0200 Subject: [PATCH] If runonce.sh is run multiple times, meshtasticd.service will no longer be borked --- .../sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/runonce.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/runonce.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/runonce.sh index f6a11b1..a2d8b8f 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/runonce.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/runonce.sh @@ -25,7 +25,7 @@ EOF # set meshtastic nodeid to derivative of CPU serial number (unique to this board). Check at boot in case of upgrade overwriting this. seed=$(sed -n '/Serial/ s/^.*: \(.*\)$/\U\1/p' /proc/cpuinfo | bc | tail -c 9) #seed=$((0x$(awk '/Serial/ {print $3}' /proc/cpuinfo) & 0x3B9AC9FF)) #alternate method for generating seed - not in use -sed -i "/^ExecStart=/ s:$: -h $seed:" /usr/lib/systemd/system/meshtasticd.service +sed -i "s|^ExecStart=/usr/sbin/meshtasticd.*|ExecStart=/usr/sbin/meshtasticd -h $seed|" /usr/lib/systemd/system/meshtasticd.service msg="First boot: Using Luckfox CPU S/N to generate nodeid for Meshtastic." echo "$msg" logger "$msg"