Merge pull request #320 from femtofox/eth0_test

Use eth0 mac address for meshtasticd
This commit is contained in:
noon92 2025-02-13 15:02:11 +02:00 • committed by GitHub
commit abac1e33cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 12 additions and 6 deletions

View file

@ -56,13 +56,13 @@ echo "femtofox" | tee /etc/hostname > /dev/null
echo "Configuring autostart of systemd services..."
systemctl enable button
systemctl enable meshtasticd
systemctl enable femto-runonce.service
systemctl enable femto-usb-config-tool.service
systemctl enable femto-boot-complete.service
systemctl enable femto-wifi-mesh-control
systemctl enable femto-watchclock-dog
systemctl disable meshtasticd
systemctl disable apt-daily.timer
systemctl disable unattended-upgrades
systemctl disable smbd nmbd # samba services, can be enabled via menu

View file

@ -0,0 +1,4 @@
# this sets the mac address source to eth0, replacing the previous code that derived a seed from the CPU s/n.
# of course, eth0 also has its mac address derived from CPU s/n, but this way meshtastic uses the exact mac address, instead of a bastardized version converted to a 9 digit int with `| bc | tail -c -9`.
General:
MACAddressSource: eth0

View file

@ -1,6 +1,6 @@
[Unit]
Description=Foxbuntu First Boot
After=meshtasticd.service
After=rc-local.service
Before=serial-getty@ttyFIQ0.service
DefaultDependencies=no

View file

@ -1,6 +1,6 @@
[Unit]
Description=Foxbuntu USB Configuration Tool
After=meshtasticd.service
After=rc-local.service
Before=serial-getty@ttyFIQ0.service
DefaultDependencies=no

View file

@ -1,6 +1,4 @@
[Service]
ExecStart=
ExecStart=/bin/sh -c '/usr/sbin/meshtasticd -h $(sed -n "/Serial/ s/^.*: \\(.*\\)$/\\U\\1/p" /proc/cpuinfo | bc | tail -c 9)'
Nice=-20
[Unit]

View file

@ -108,4 +108,4 @@ Note: Dependencies are loaded/unloaded automatically." 0 0
fi
done
exit 0
exit 0

View file

@ -22,6 +22,7 @@ Re-running this script will:\n\
* Set the eth0 MAC to be derivative of CPU serial number\n\
* Add terminal type to user femto's .bashrc\n\
* Add a shortcut \`sfc\` to user femto's .bashrc\n\
* Enable the meshtasticd service\n\
\n\
Finally, the Femtofox will reboot.\n\
\n\
@ -106,6 +107,9 @@ else
log_message "\`alias sfc='sudo femto-config'\` already present in .bashrc, skipping"
fi
log_message "Enabling meshtasticd service"
systemctl enable meshtasticd
# remove first boot flag
sed -i -E 's/^first_boot=.*/first_boot=false/' /etc/femto.conf
log_message "Removing first boot flag and rebooting in 5 seconds..."