mirror of
https://github.com/femtofox/femtofox.git
synced 2026-11-20 06:56:29 -05:00
Limit nodeid seed to 32 bits
This commit is contained in:
parent
ec0d4d44db
commit
35c1c386df
1 changed files with 6 additions and 2 deletions
|
|
@ -14,12 +14,16 @@ if ! grep -A 1 "iface eth0 inet dhcp" /etc/network/interfaces | grep -q "hwaddre
|
|||
echo "Making current eth0 MAC address permanent."
|
||||
fi
|
||||
|
||||
#run once to set meshtastic nodeid to derivative of CPU serial number (unique to this board)
|
||||
#run once to set meshtastic nodeid to derivative of CPU serial number (unique to this board). Check at boot in case of upgrade overwriting this.
|
||||
if ! grep -q "^ExecStart=.*--hwid" /usr/lib/systemd/system/meshtasticd.service; then
|
||||
sed -i "/^ExecStart=/ s:$: --hwid $((16#$(cat /proc/cpuinfo | grep Serial | awk '{print $3}' | tail -c 8))):" /usr/lib/systemd/system/meshtasticd.service
|
||||
sed -i "/^ExecStart=/ s:$: --hwid $((0x$(awk '/Serial/ {print $3}' /proc/cpuinfo) & 0xFFFFFFFF)):" /usr/lib/systemd/system/meshtasticd.service
|
||||
echo "Used Luckfox CPU S/N to generate unique nodeid seed for Meshtastic."
|
||||
systemctl stop meshtasticd
|
||||
systemctl daemon-reload
|
||||
systemctl start meshtasticd
|
||||
fi
|
||||
|
||||
|
||||
# try enable RTC
|
||||
echo 'ds1307 0x68' | sudo tee /sys/class/i2c-adapter/i2c-3/new_device > /dev/null 2>&1
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue