diff --git a/environment-setup/femtofox.chroot b/environment-setup/femtofox.chroot index 19d213c..d0274df 100644 --- a/environment-setup/femtofox.chroot +++ b/environment-setup/femtofox.chroot @@ -62,7 +62,8 @@ systemctl enable femto-boot-complete.service systemctl enable femto-wifi-mesh-control systemctl enable femto-watchclock-dog -systemctl disable meshtasticd +systemctl disable ttyd # enabled on first boot +systemctl disable meshtasticd # enabled on first boot systemctl disable apt-daily.timer systemctl disable unattended-upgrades systemctl disable smbd nmbd # samba services, can be enabled via menu diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/network/interfaces b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/network/interfaces index 315112b..bfde602 100644 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/network/interfaces +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/network/interfaces @@ -8,4 +8,13 @@ iface lo inet loopback allow-hotplug wlan0 iface wlan0 inet dhcp wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf + metric 100 + post-up sleep 5 && dhclient wlan0 + pre-down ip route del default via $(ip route | awk '/default/ {print $3}') dev wlan0 metric 100 + +allow-hotplug eth0 +iface eth0 inet dhcp + metric 10 + post-up ip route replace default via $(ip route | awk '/default/ {print $3}') dev eth0 metric 10 + pre-down ip route del default via $(ip route | awk '/default/ {print $3}') dev eth0 metric 10 diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh index 4ba57a2..a319a38 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh @@ -70,16 +70,16 @@ fi # prevent randomized mac address for eth0. If `eth0`` is already present in /etc/network/interfaces, skip mac="$(awk '/Serial/ {print $3}' /proc/cpuinfo | tail -c 11 | sed 's/^\(.*\)/a2\1/' | sed 's/\(..\)/\1:/g;s/:$//')" -if ! grep -q "eth0" /etc/network/interfaces; then +file="/etc/network/interfaces" +if ! grep -q " hwaddress ether $mac" "$file"; then log_message "Setting eth0 MAC address to $mac (derivative of CPU s/n)" - cat <> /etc/network/interfaces -# static mac address for onboard ethernet (castellated pins) -allow-hotplug eth0 -iface eth0 inet dhcp -hwaddress ether $mac -EOF + awk -v mac="$mac" ' + { print } + /allow-hotplug eth0/ { count=5 } + count && --count == 0 { print " hwaddress ether " mac } + ' "$file" > "$file.tmp" && mv "$file.tmp" "$file" else - log_message "eth0 already exists in /etc/network/interfaces, skipping" + log_message "eth0 mac address already set in /etc/network/interfaces, skipping" fi # Add term stuff to .bashrc @@ -110,11 +110,13 @@ systemctl enable meshtasticd #generate SSH keys log_message "Generating new SSH encryption keys. This can take a couple minutes..." -#femto-utils.sh -E +femto-utils.sh -E #generate ttyd SSL keys log_message "Generating new Web Terminal (ttyd) SSL encryption keys. This can take a couple minutes..." /usr/local/bin/packages/ttyd.sh -k +log_message "Enabling Web Terminal (ttyd) service... +systemctl enable ttyd # remove first boot flag systemctl disable femto-runonce