minor tweaks, also correctly import persistent logging setting on first boot, thanks to @TomBric

pull/827/head
Adrian Batzill 2024-04-07 10:08:50 +02:00
rodzic 7c32d0c7bb
commit 6b1adbdf54
3 zmienionych plików z 25 dodań i 9 usunięć

Wyświetl plik

@ -42,11 +42,27 @@ fi
if [ -f /boot/firmware/.stratux-first-boot ]; then
rm /boot/firmware/.stratux-first-boot
if [ -f /boot/firmware/stratux.conf ] && grep -q WiFi /boot/firmware/stratux.conf ; then
# Import old stratux.conf.. apply network settings
/opt/stratux/bin/gen_gdl90 -write-network-config
wLog "re-wrote network configuration for first-boot config import. Rebooting... Bye"
reboot
if [ -f /boot/firmware/stratux.conf ]; then
# In case of US build, a stratux.conf file will always be imported, only containing UAT/OGN options.
# We don't want to force-reboot for that.. Only for network/overlay changes
do_reboot=false
# re-apply overlay
if [ "$(jq -r .PersistentLogging /boot/firmware/stratux.conf)" = "true" ]; then
/sbin/overlayctl disable
do_reboot=true
wLog "overlayctl disabled due to stratux.conf settings"
fi
# write network config
if grep -q WiFi /boot/firmware/stratux.conf ; then
/opt/stratux/bin/gen_gdl90 -write-network-config
do_reboot=true
wLog "re-wrote network configuration for first-boot config import. Rebooting... Bye"
fi
if $do_reboot; then
reboot
fi
fi
fi

Wyświetl plik

@ -111,7 +111,7 @@ func computeRelativeVertical(ti TrafficInfo) (relativeVertical int32) {
func gdl90EmitterCatToNMEA(emitterCat uint8) string {
acType := "0"
switch emitterCat {
case 1, 6: acType = "8" // light/"highly maneuverable > 56" = piston
case 1, 6: acType = "8" // light/"highly maneuverable > 5g" = piston
case 2, 3, 4, 5: acType = "9" // small/large/heavy = jet
case 7: acType = "3" // helicopter = helicopter
case 9: acType = "1" // glider = glider

Wyświetl plik

@ -68,15 +68,15 @@ systemctl disable apt-daily-upgrade.timer
/opt/stratux/bin/gen_gdl90 -write-network-config
# Add optional usb stick mount if it's not already there
if [ "$(grep /dev/sda1 /etc/fstab)" == "" ]; then
if [ "$(grep /dev/sda1 /etc/fstab)" = "" ]; then
echo -e "\n/dev/sda1 /var/log auto defaults,nofail,noatime,x-systemd.device-timeout=1ms 0 2" >> /etc/fstab
fi
cd /
rm -rf /root/stratux-update
# re-enable overlay if it is configured. TODO: switch to jq for json parsing in the future once it's available in all installations
if [ "$(jq -r .PersistentLogging /boot/firmware/stratux.conf)" == "true" ]; then
# re-enable overlay if it is configured.
if [ "$(jq -r .PersistentLogging /boot/firmware/stratux.conf)" = "true" ]; then
/sbin/overlayctl disable
else
/sbin/overlayctl enable