├── README.md ├── setup-pi4-latest.sh ├── setup-pi4-stable-viruspilot.sh └── setup-pi4-stable.sh /README.md: -------------------------------------------------------------------------------- 1 | # Build a Stratux Europe on a Pi3, Pi4, Pi5 or Pi Zero 2W based on a fresh 64bit RasPiOS Lite Image 2 | 3 | - shopping lists: 4 | - https://github.com/VirusPilot/stratux-pi4/wiki/Shopping-List-v3-TX (active cooling with fan, copper heatsink, TX module) 5 | - https://github.com/VirusPilot/stratux-pi4/wiki/Shopping-List-v3 (passive cooling with large copper heatsink) 6 | - https://github.com/VirusPilot/stratux-pi4/wiki/Shopping-List-v2 (active cooling with fan) 7 | - https://github.com/VirusPilot/stratux-pi4/wiki/Shopping-List-v1 (passive cooling with custom aluminium block) 8 | 9 | - both scripts are based on the latest **64bit RasPiOS Lite Bookworm Image**, using **Raspberry Pi Imager** from here: https://www.raspberrypi.com/software/ 10 | 11 | # stratux-pi4-stable 12 | based on https://github.com/stratux/stratux (**as of February 4, 2025**) 13 | 14 | # stratux-pi4-latest 15 | based on https://github.com/stratux/stratux 16 | 17 | # stratux-pi4-stable-viruspilot 18 | based on https://github.com/VirusPilot/stratux (**as of February 4, 2025**): 19 | - main/gps.go: enable GPS LED to indicate a valid GPS fix 20 | - main/gen_gdl90.go: increase GDL90 ownship report from 1Hz to 5Hz 21 | 22 | ## please use these scripts with caution and only on a fresh 64bit RasPiOS Lite Image, because: 23 | - the entire filesystem (except /boot) will be changed to read-only to prevent microSD card corruption 24 | - swapfile will be disabled 25 | 26 | ## prepare script for Pi3, Pi4, Pi5 or Pi Zero 2W: 27 | - flash latest **64bit RasPiOS Lite Bookworm Image**, using latest **Raspberry Pi Imager** with the following settings: 28 | - select appropriate hostname 29 | - enable ssh 30 | - enable user pi with password 31 | - **IMPORTANT**: although Stratux is setting up its own WiFi credentials, it is mandatory to `enable and set up WiFi` and in particular `WiFi Country` in the **Raspberry Pi Imager configuration** because otherwise WiFi might not work at all (even more important for Pi Zero 2W so that the Pi connects to your local WiFi network) 32 | - boot your Pi with this image and wait until it is connected to your LAN or WiFi (this may take a few minutes after the first boot) 33 | - please note that the brightness values of the Pi Zero 2W LED are reversed so it will turn off as soon as Stratux has successfully booted 34 | 35 | ## start build process 36 | login with ssh as `pi` user with the above set password, then: 37 | ``` 38 | sudo su 39 | ``` 40 | **stable** version: 41 | ``` 42 | cd ~/ 43 | apt update 44 | apt full-upgrade -y 45 | sudo bash -c "$(wget -nv -O - https://raw.githubusercontent.com/VirusPilot/stratux-pi4/master/setup-pi4-stable.sh)" 46 | ``` 47 | **latest** version: 48 | ``` 49 | cd ~/ 50 | apt update 51 | apt full-upgrade -y 52 | sudo bash -c "$(wget -nv -O - https://raw.githubusercontent.com/VirusPilot/stratux-pi4/master/setup-pi4-latest.sh)" 53 | ``` 54 | **viruspilot** version: 55 | ``` 56 | cd ~/ 57 | apt update 58 | apt full-upgrade -y 59 | sudo bash -c "$(wget -nv -O - https://raw.githubusercontent.com/VirusPilot/stratux-pi4/master/setup-pi4-stable-viruspilot.sh)" 60 | ``` 61 | - if you are all set then let the sript **reboot** but if you haven't yet programed your SDRs, now would be a good time before Stratux will be claiming the SDRs after a reboot; please follow the instructions under "Remarks - SDR programming" below for each SDR individually 62 | - after reboot Stratux is providing an unprotected WiFi access point with the SSID "stratux" 63 | - after you have connected with this access point, you can open the Stratux web interface: http://192.168.10.1 and modify the settings according to your needs 64 | - Pi Zero 2W users: Stratux will now no longer connect to your local network unless you change this by switching the Stratux WiFi settings to "AP+Client" 65 | 66 | ## optional components: 67 | enabling **Persistent logging** on Stratux settings page is required! 68 | 69 | - you may now install 70 | - stratux radar display: https://github.com/TomBric/stratux-radar-display 71 | - additional maps: https://github.com/stratux/stratux/wiki/Downloading-better-map-data 72 | - if you want to upgrade gloang to the latest version from time to time, you may consider installing https://github.com/stefanmaric/g with the following command: `curl -sSL https://git.io/g-install | sh -s -- -y` 73 | 74 | ## SkyDemon related Remarks 75 | ### connection via Bluetooth LE 76 | - this allows connecting SkyDemon via BLE instead of WiFi: when in range of your Bluetooth device, and with the device powered on, open the Setup menu in SkyDemon and select Connectivity. Then under the Bluetooth heading, choose Add Bluetooth Device. SkyDemon will scan for devices and your device should appear within a second or two. If it does not, check that it is powered on, and that it is a Bluetooth LE device (Bluetooth 4 onwards). You don’t need to pair it with your tablet or phone first. When the Bluetooth device has appeared, select it. You then need to tell SkyDemon what sort of avionics are connected to your device, in case of Stratux choose `NMEA (FLARM or GPS)`. 77 | ### connection via WiFi 78 | - WiFi Settings/Stratux IP Address 192.168.10.1 (default): only **GDL90** can be selected and used in SkyDemon 79 | - WiFi Settings/Stratux IP Address 192.168.1.1: both **GDL90** and **FLARM-NMEA** can be selected and used in SkyDemon 80 | - **GDL90** is labeled as "**GDL90 Compatible Device**" under "**Connectivity/All Devices**" 81 | - **FLARM-NMEA** is labeled as "**Air Avionics AT-1**" or "**FLARM with Air Connect**" under "**Connectivity/All Devices**", the "**Air Connect Key**" can be ignored for Stratux Europe 82 | - info for experts: FLARM-NMEA = TCP:2000, GDL90 = UDP:4000 (for FLARM-NMEA, the EFB initiates the connection, for UDP, Stratux will send unicast to all connected DHCP clients) 83 | - more info here: https://github.com/stratux/stratux/wiki/EFB-Configuration#skydemon-using-flarm-nmea-protocol-recommended 84 | 85 | ## Limitations/Modifications/Issues 86 | - this setup is intended to create a Stratux system, don't use the Pi for any other important stuff as all of your data may be lost during Stratux operation 87 | 88 | ## Remarks - SDR programming simple mode 89 | - only plug in one SDR and then execute 90 | ``` 91 | sdr-tool.sh 92 | ``` 93 | 94 | ## Remarks - SDR programming expert mode (1) 95 | During boot, Stratux tries to identify which SDR to use for which traffic type (ADS-B, OGN) - this is done by reading the "Serial number" entry in each SDRs. You can check or modify these entries as described below, it is recommended for programming to only plug in one SDR at a time, connect the appropriate antenna and label this combination accordingly, e.g. "868" for OGN. 96 | ``` 97 | stxstop (stop Stratux from claiming the SDRs) 98 | rtl_eeprom 99 | ``` 100 | will report something like the following: 101 | ``` 102 | Current configuration: 103 | __________________________________________ 104 | Vendor ID: 0x0bda 105 | Product ID: 0x2838 106 | Manufacturer: Realtek 107 | Product: RTL2838UHIDIR 108 | Serial number: stx:868:0 109 | Serial number enabled: yes 110 | IR endpoint enabled: yes 111 | Remote wakeup enabled: no 112 | __________________________________________ 113 | ``` 114 | This SDR is obviosly programmed for Stratux (stx), OGN (868MHz), and a ppm correction of "0", the ppm can be modified later, see below. If your SDR comes pre-programed (it would be labled with e.g. with "1090") there is no need to program it. 115 | 116 | You can program the `Serial number` entry with the following command: 117 | ``` 118 | rtl_eeprom -s stx:1090:0 119 | ``` 120 | to prepare it e.g. for ADS-B (1090MHz) use. A reboot is necessary to activate the new serial number. 121 | 122 | If for some reasons an error occurs while programming, please consider preparing the SDR with the default values: 123 | ``` 124 | rtl_eeprom -g realtek 125 | ``` 126 | At this point you can already test your SDR and receive ADS-B traffic with the following command: 127 | ``` 128 | rtl_adsb -V 129 | ``` 130 | Or listen to you favorite FM radio station (my station below is at 106.9MHz) by pluging in a headset and run the following command: 131 | ``` 132 | rtl_fm -M fm -f 106.9M -s 32000 -g 60 -l 10 - | aplay -t raw -r 32000 -c 1 -f S16_LE 133 | ``` 134 | ## Remarks - SDR programming expert mode (2) 135 | During boot, Stratux furthermore reads the ppm correction from the SDR `Serial number`, e.g. if the `Serial number` is `stx:1090:28` then the ppm used by Stratux is +28. If the appropriate ppm for the SDR is unknown, here are the steps to find out (again it is useful to have only one SDR plugged in to avoid confusion): 136 | 137 | `stxstop` (in case Stratux is already running) 138 | 139 | `kal -s GSM900` and note donw the channel number with the highest power (e.g. 4) 140 | 141 | `kal -b GSM900 -c 4` and note down the average absolute error (e.g. 16.325 ppm) 142 | 143 | Once you have found the appropriate ppm (e.g. +16 as in the example above), the SDR `Serial number` needs to be programmed once again: 144 | ``` 145 | rtl_eeprom -s stx:868:16 146 | reboot 147 | ``` 148 | For more information on how to use `kal` please visit https://github.com/steve-m/kalibrate-rtl/blob/master/README.md 149 | -------------------------------------------------------------------------------- /setup-pi4-latest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #set -x 3 | 4 | # prepare libs 5 | apt install \ 6 | libjpeg62-turbo-dev \ 7 | libconfig9 \ 8 | rpi-update \ 9 | dnsmasq \ 10 | git \ 11 | libusb-1.0-0-dev \ 12 | build-essential \ 13 | autoconf \ 14 | libtool \ 15 | i2c-tools \ 16 | libfftw3-dev \ 17 | libncurses-dev \ 18 | python3-serial \ 19 | jq \ 20 | ifplugd \ 21 | iptables \ 22 | libttspico-utils \ 23 | bluez \ 24 | bluez-firmware \ 25 | libdbus-1-dev \ 26 | libglib2.0-dev \ 27 | libudev-dev \ 28 | libical-dev \ 29 | libreadline-dev \ 30 | python3-pygments -y 31 | apt install cmake debhelper -y 32 | 33 | # install esptool for tracker flashing 34 | apt install python3-pip -y 35 | pip install --break-system-packages esptool 36 | 37 | # install latest golang 38 | cd /root 39 | wget https://go.dev/dl/go1.24.3.linux-arm64.tar.gz 40 | rm -rf /root/go 41 | rm -rf /root/go_path 42 | tar xzf *.gz 43 | rm *.gz 44 | 45 | # compile and install librtlsdr from https://github.com/osmocom/rtl-sdr 46 | cd /root 47 | rm -rf /root/rtl-sdr 48 | git clone https://github.com/osmocom/rtl-sdr 49 | cd rtl-sdr 50 | sudo dpkg-buildpackage -b --no-sign 51 | cd /root 52 | sudo dpkg -i *.deb 53 | rm -f *.deb 54 | rm -f *.buildinfo 55 | rm -f *.changes 56 | 57 | # install kalibrate-rtl 58 | cd /root 59 | rm -rf /root/kalibrate-rtl 60 | git clone https://github.com/steve-m/kalibrate-rtl 61 | cd kalibrate-rtl 62 | ./bootstrap && CXXFLAGS='-W -Wall -O3' 63 | ./configure 64 | make -j8 && make install 65 | rm -rf /root/kalibrate-rtl 66 | 67 | # Prepare wiringpi for ogn trx via GPIO 68 | cd /root 69 | rm -rf /root/WiringPi 70 | git clone https://github.com/WiringPi/WiringPi.git 71 | cd WiringPi 72 | ./build 73 | 74 | # clone stratux 75 | cd /root 76 | rm -rf /root/stratux 77 | git clone --recursive https://github.com/stratux/stratux.git /root/stratux 78 | cd /root/stratux 79 | 80 | # copy various files from /root/stratux/image 81 | cd /root/stratux/image_build/stage2/10-stratux/files 82 | cp -f config.txt /boot/firmware/config.txt # modified in https://github.com/VirusPilot/stratux 83 | cp -f bashrc.txt /root/.bashrc 84 | cp -f rc.local /etc/rc.local 85 | cp -f modules.txt /etc/modules 86 | cp -f motd /etc/motd 87 | cp -f rtl-sdr-blacklist.conf /etc/modprobe.d/ 88 | cp -f stxAliases.txt /root/.stxAliases 89 | cp -f stratux-dnsmasq.conf /etc/dnsmasq.d/stratux-dnsmasq.conf 90 | cp -f wpa_supplicant_ap.conf /etc/wpa_supplicant/wpa_supplicant_ap.conf 91 | cp -f interfaces /etc/network/interfaces 92 | cp -f sshd_config /etc/ssh/sshd_config 93 | 94 | #rootfs overlay stuff 95 | cp -f overlayctl init-overlay /sbin/ 96 | overlayctl install 97 | # init-overlay replaces raspis initial partition size growing.. Make sure we call that manually (see init-overlay script) 98 | #touch /var/grow_root_part 99 | mkdir -p /overlay/robase # prepare so we can bind-mount root even if overlay is disabled 100 | 101 | # So we can import network settings if needed 102 | touch /boot/firmware/.stratux-first-boot 103 | 104 | # Optionally mount /dev/sda1 as /var/log - for logging to USB stick 105 | #echo -e "\n/dev/sda1 /var/log auto defaults,nofail,noatime,x-systemd.device-timeout=1ms 0 2" >> /etc/fstab 106 | 107 | #disable serial console, disable rfkill state restore, enable wifi on boot 108 | sed -i /boot/firmware/cmdline.txt -e "s/console=serial0,[0-9]\+ /systemd.restore_state=0 rfkill.default_state=1 /" 109 | 110 | # prepare services 111 | systemctl enable ssh 112 | systemctl disable dnsmasq # we start it manually on respective interfaces 113 | #systemctl disable hciuart 114 | systemctl disable triggerhappy 115 | systemctl disable wpa_supplicant 116 | systemctl disable apt-daily.timer 117 | systemctl disable apt-daily-upgrade.timer 118 | systemctl disable man-db.timer 119 | systemctl disable systemd-timesyncd 120 | 121 | # Run DHCP on eth0 when cable is plugged in 122 | sed -i -e 's/INTERFACES=""/INTERFACES="eth0"/g' /etc/default/ifplugd 123 | 124 | # Generate ssh key for all installs. Otherwise it would have to be done on each boot, which takes a couple of seconds 125 | ssh-keygen -A -v 126 | systemctl disable regenerate_ssh_host_keys 127 | # This is usually done by the console-setup service that takes quite long of first boot.. 128 | /lib/console-setup/console-setup.sh 129 | 130 | # build Stratux Europe 131 | source /root/.bashrc 132 | cd /root/stratux 133 | make 134 | make install 135 | 136 | # disable swapfile 137 | systemctl disable dphys-swapfile 138 | apt purge dphys-swapfile -y 139 | apt autoremove -y 140 | apt clean 141 | 142 | # disable autologin 143 | rm -f rm /etc/systemd/system/getty@tty1.service.d/autologin.conf 144 | 145 | # ask for reboot 146 | echo 147 | read -t 1 -n 10000 discard 148 | read -p "Reboot now? [y/n]" -n 1 -r 149 | echo 150 | if [[ $REPLY =~ ^[Yy]$ ]]; then 151 | reboot 152 | fi 153 | -------------------------------------------------------------------------------- /setup-pi4-stable-viruspilot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #set -x 3 | 4 | # prepare libs 5 | apt install \ 6 | libjpeg62-turbo-dev \ 7 | libconfig9 \ 8 | rpi-update \ 9 | dnsmasq \ 10 | git \ 11 | libusb-1.0-0-dev \ 12 | build-essential \ 13 | autoconf \ 14 | libtool \ 15 | i2c-tools \ 16 | libfftw3-dev \ 17 | libncurses-dev \ 18 | python3-serial \ 19 | jq \ 20 | ifplugd \ 21 | iptables \ 22 | libttspico-utils \ 23 | bluez \ 24 | bluez-firmware \ 25 | libdbus-1-dev \ 26 | libglib2.0-dev \ 27 | libudev-dev \ 28 | libical-dev \ 29 | libreadline-dev \ 30 | python3-pygments -y 31 | apt install cmake debhelper -y 32 | 33 | # install esptool for tracker flashing 34 | apt install python3-pip -y 35 | pip install --break-system-packages esptool 36 | 37 | # install latest golang 38 | cd /root 39 | wget https://go.dev/dl/go1.24.3.linux-arm64.tar.gz 40 | rm -rf /root/go 41 | rm -rf /root/go_path 42 | tar xzf *.gz 43 | rm *.gz 44 | 45 | # compile and install librtlsdr from https://github.com/osmocom/rtl-sdr 46 | cd /root 47 | rm -rf /root/rtl-sdr 48 | git clone https://github.com/osmocom/rtl-sdr 49 | cd rtl-sdr 50 | sudo dpkg-buildpackage -b --no-sign 51 | cd /root 52 | sudo dpkg -i *.deb 53 | rm -f *.deb 54 | rm -f *.buildinfo 55 | rm -f *.changes 56 | 57 | # install kalibrate-rtl 58 | cd /root 59 | rm -rf /root/kalibrate-rtl 60 | git clone https://github.com/steve-m/kalibrate-rtl 61 | cd kalibrate-rtl 62 | ./bootstrap && CXXFLAGS='-W -Wall -O3' 63 | ./configure 64 | make -j8 && make install 65 | rm -rf /root/kalibrate-rtl 66 | 67 | # Prepare wiringpi for ogn trx via GPIO 68 | cd /root 69 | rm -rf /root/WiringPi 70 | git clone https://github.com/WiringPi/WiringPi.git 71 | cd WiringPi 72 | ./build 73 | 74 | # clone stratux 75 | cd /root 76 | rm -rf /root/stratux 77 | git clone --recursive https://github.com/VirusPilot/stratux.git /root/stratux 78 | cd /root/stratux 79 | git checkout 5283a06 # last verified version as of February 4, 2025 80 | 81 | # copy various files from /root/stratux/image 82 | cd /root/stratux/image 83 | cp -f config.txt /boot/firmware/config.txt # modified in https://github.com/VirusPilot/stratux 84 | cp -f bashrc.txt /root/.bashrc 85 | cp -f rc.local /etc/rc.local 86 | cp -f modules.txt /etc/modules 87 | cp -f motd /etc/motd 88 | cp -f rtl-sdr-blacklist.conf /etc/modprobe.d/ 89 | cp -f stxAliases.txt /root/.stxAliases 90 | cp -f stratux-dnsmasq.conf /etc/dnsmasq.d/stratux-dnsmasq.conf 91 | cp -f wpa_supplicant_ap.conf /etc/wpa_supplicant/wpa_supplicant_ap.conf 92 | cp -f interfaces /etc/network/interfaces 93 | cp -f sshd_config /etc/ssh/sshd_config 94 | 95 | #rootfs overlay stuff 96 | cp -f overlayctl init-overlay /sbin/ 97 | overlayctl install 98 | # init-overlay replaces raspis initial partition size growing.. Make sure we call that manually (see init-overlay script) 99 | #touch /var/grow_root_part 100 | mkdir -p /overlay/robase # prepare so we can bind-mount root even if overlay is disabled 101 | 102 | # So we can import network settings if needed 103 | touch /boot/firmware/.stratux-first-boot 104 | 105 | # Optionally mount /dev/sda1 as /var/log - for logging to USB stick 106 | #echo -e "\n/dev/sda1 /var/log auto defaults,nofail,noatime,x-systemd.device-timeout=1ms 0 2" >> /etc/fstab 107 | 108 | #disable serial console, disable rfkill state restore, enable wifi on boot 109 | sed -i /boot/firmware/cmdline.txt -e "s/console=serial0,[0-9]\+ /systemd.restore_state=0 rfkill.default_state=1 /" 110 | 111 | # prepare services 112 | systemctl enable ssh 113 | systemctl disable dnsmasq # we start it manually on respective interfaces 114 | #systemctl disable hciuart 115 | systemctl disable triggerhappy 116 | systemctl disable wpa_supplicant 117 | systemctl disable apt-daily.timer 118 | systemctl disable apt-daily-upgrade.timer 119 | systemctl disable man-db.timer 120 | systemctl disable systemd-timesyncd 121 | 122 | # Run DHCP on eth0 when cable is plugged in 123 | sed -i -e 's/INTERFACES=""/INTERFACES="eth0"/g' /etc/default/ifplugd 124 | 125 | # Generate ssh key for all installs. Otherwise it would have to be done on each boot, which takes a couple of seconds 126 | ssh-keygen -A -v 127 | systemctl disable regenerate_ssh_host_keys 128 | # This is usually done by the console-setup service that takes quite long of first boot.. 129 | /lib/console-setup/console-setup.sh 130 | 131 | # build Stratux Europe 132 | source /root/.bashrc 133 | cd /root/stratux 134 | make 135 | make install 136 | 137 | # disable swapfile 138 | systemctl disable dphys-swapfile 139 | apt purge dphys-swapfile -y 140 | apt autoremove -y 141 | apt clean 142 | 143 | # disable autologin 144 | rm -f rm /etc/systemd/system/getty@tty1.service.d/autologin.conf 145 | 146 | # ask for reboot 147 | echo 148 | read -t 1 -n 10000 discard 149 | read -p "Reboot now? [y/n]" -n 1 -r 150 | echo 151 | if [[ $REPLY =~ ^[Yy]$ ]]; then 152 | reboot 153 | fi 154 | -------------------------------------------------------------------------------- /setup-pi4-stable.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #set -x 3 | 4 | # prepare libs 5 | apt install \ 6 | libjpeg62-turbo-dev \ 7 | libconfig9 \ 8 | rpi-update \ 9 | dnsmasq \ 10 | git \ 11 | libusb-1.0-0-dev \ 12 | build-essential \ 13 | autoconf \ 14 | libtool \ 15 | i2c-tools \ 16 | libfftw3-dev \ 17 | libncurses-dev \ 18 | python3-serial \ 19 | jq \ 20 | ifplugd \ 21 | iptables \ 22 | libttspico-utils \ 23 | bluez \ 24 | bluez-firmware \ 25 | libdbus-1-dev \ 26 | libglib2.0-dev \ 27 | libudev-dev \ 28 | libical-dev \ 29 | libreadline-dev \ 30 | python3-pygments -y 31 | apt install cmake debhelper -y 32 | 33 | # install esptool for tracker flashing 34 | apt install python3-pip -y 35 | pip install --break-system-packages esptool 36 | 37 | # install latest golang 38 | cd /root 39 | wget https://go.dev/dl/go1.24.3.linux-arm64.tar.gz 40 | rm -rf /root/go 41 | rm -rf /root/go_path 42 | tar xzf *.gz 43 | rm *.gz 44 | 45 | # compile and install librtlsdr from https://github.com/osmocom/rtl-sdr 46 | cd /root 47 | rm -rf /root/rtl-sdr 48 | git clone https://github.com/osmocom/rtl-sdr 49 | cd rtl-sdr 50 | sudo dpkg-buildpackage -b --no-sign 51 | cd /root 52 | sudo dpkg -i *.deb 53 | rm -f *.deb 54 | rm -f *.buildinfo 55 | rm -f *.changes 56 | 57 | # install kalibrate-rtl 58 | cd /root 59 | rm -rf /root/kalibrate-rtl 60 | git clone https://github.com/steve-m/kalibrate-rtl 61 | cd kalibrate-rtl 62 | ./bootstrap && CXXFLAGS='-W -Wall -O3' 63 | ./configure 64 | make -j8 && make install 65 | rm -rf /root/kalibrate-rtl 66 | 67 | # Prepare wiringpi for ogn trx via GPIO 68 | cd /root 69 | rm -rf /root/WiringPi 70 | git clone https://github.com/WiringPi/WiringPi.git 71 | cd WiringPi 72 | ./build 73 | 74 | # clone stratux 75 | cd /root 76 | rm -rf /root/stratux 77 | git clone --recursive https://github.com/stratux/stratux.git /root/stratux 78 | cd /root/stratux 79 | git checkout 5283a06 # last verified version as of February 4, 2025 80 | 81 | # copy various files from /root/stratux/image 82 | cd /root/stratux/image 83 | cp -f config.txt /boot/firmware/config.txt # modified in https://github.com/VirusPilot/stratux 84 | cp -f bashrc.txt /root/.bashrc 85 | cp -f rc.local /etc/rc.local 86 | cp -f modules.txt /etc/modules 87 | cp -f motd /etc/motd 88 | cp -f rtl-sdr-blacklist.conf /etc/modprobe.d/ 89 | cp -f stxAliases.txt /root/.stxAliases 90 | cp -f stratux-dnsmasq.conf /etc/dnsmasq.d/stratux-dnsmasq.conf 91 | cp -f wpa_supplicant_ap.conf /etc/wpa_supplicant/wpa_supplicant_ap.conf 92 | cp -f interfaces /etc/network/interfaces 93 | cp -f sshd_config /etc/ssh/sshd_config 94 | 95 | #rootfs overlay stuff 96 | cp -f overlayctl init-overlay /sbin/ 97 | overlayctl install 98 | # init-overlay replaces raspis initial partition size growing.. Make sure we call that manually (see init-overlay script) 99 | #touch /var/grow_root_part 100 | mkdir -p /overlay/robase # prepare so we can bind-mount root even if overlay is disabled 101 | 102 | # So we can import network settings if needed 103 | touch /boot/firmware/.stratux-first-boot 104 | 105 | # Optionally mount /dev/sda1 as /var/log - for logging to USB stick 106 | #echo -e "\n/dev/sda1 /var/log auto defaults,nofail,noatime,x-systemd.device-timeout=1ms 0 2" >> /etc/fstab 107 | 108 | #disable serial console, disable rfkill state restore, enable wifi on boot 109 | sed -i /boot/firmware/cmdline.txt -e "s/console=serial0,[0-9]\+ /systemd.restore_state=0 rfkill.default_state=1 /" 110 | 111 | # prepare services 112 | systemctl enable ssh 113 | systemctl disable dnsmasq # we start it manually on respective interfaces 114 | #systemctl disable hciuart 115 | systemctl disable triggerhappy 116 | systemctl disable wpa_supplicant 117 | systemctl disable apt-daily.timer 118 | systemctl disable apt-daily-upgrade.timer 119 | systemctl disable man-db.timer 120 | systemctl disable systemd-timesyncd 121 | 122 | # Run DHCP on eth0 when cable is plugged in 123 | sed -i -e 's/INTERFACES=""/INTERFACES="eth0"/g' /etc/default/ifplugd 124 | 125 | # Generate ssh key for all installs. Otherwise it would have to be done on each boot, which takes a couple of seconds 126 | ssh-keygen -A -v 127 | systemctl disable regenerate_ssh_host_keys 128 | # This is usually done by the console-setup service that takes quite long of first boot.. 129 | /lib/console-setup/console-setup.sh 130 | 131 | # build Stratux Europe 132 | source /root/.bashrc 133 | cd /root/stratux 134 | make 135 | make install 136 | 137 | # disable swapfile 138 | systemctl disable dphys-swapfile 139 | apt purge dphys-swapfile -y 140 | apt autoremove -y 141 | apt clean 142 | 143 | # disable autologin 144 | rm -f rm /etc/systemd/system/getty@tty1.service.d/autologin.conf 145 | 146 | # ask for reboot 147 | echo 148 | read -t 1 -n 10000 discard 149 | read -p "Reboot now? [y/n]" -n 1 -r 150 | echo 151 | if [[ $REPLY =~ ^[Yy]$ ]]; then 152 | reboot 153 | fi 154 | --------------------------------------------------------------------------------