System scripts - femtofox/femtofox GitHub Wiki

Following is a list of the system scripts that make Foxbuntu work. Each script is a tool or collection of tools used by various Foxbuntu features to manage your Femtofox.

Scripts are located in /usr/local/bin, while femto* services are located in /etc/systemd/system.

[!note] All of these scripts are called automatically by the femto-config tool, there is no need to call them separately from command line, unless you enjoy command line shenanigans.

Filename Description Details
femto-config Main configuration menu Primary system management script—launches all other configuration tools.
femto-boot-complete.sh Runs post-boot tasks Confirms successful boot by flashing LED (see Boot Codes)
femto-set-time.sh Manages system time Prevents clock drift, ensuring accurate logs & messages.
femto-meshtasticd-config.sh Configures meshtasticd Automates LoRa radio selection, security keys, and network settings.
femto-runonce.sh First-time boot setup Initial setup script that optimizes storage and security.
button.sh Detects button presses Provides hardware control (Wi-Fi toggle, reboot, shutdown).
femto-kernel-modules.sh Menu for managing kernel modules Allows easy customization without manually modifying system files.
femto-pinout.sh Displays Femtofox hardware pinouts Quick GPIO, UART, I2C, and LoRa pin reference.
femto-license.sh Displays Femtofox, Ubuntu, and Meshtastic licenses Ensures legal compliance for open-source and commercial projects.
femto-usb-config-tool.sh Reads USB config file (femtofox-config.txt) and applies settings Enables plug-and-play configuration via USB drive.
femto-utils.sh System utilities Provides logging, service management, and debugging tools.
femto-software.sh Software package manager GUI Simplifies installing & updating software.
femto-install-wizard.sh First-time setup wizard GUI User-friendly UI for configuring Wi-Fi, hostname, and LoRa.
femto-network-config.sh Wi-Fi, Ethernet, and hostname management Automates network setup for Wi-Fi and Ethernet.
femto-watchclock-dog.sh Detects large time changes (≥1 week) and restarts meshtasticd service Prevents meshtasticd incommunicado bug.
femto-wifi-mesh-control.sh Syncs Wi-Fi settings Keeps Wi-Fi settings synchronized between Linux and Meshtastic

femto-boot-complete.sh

Run by /etc/systemd/system/femto-boot-complete.service. Runs post-boot tasks. Confirms successful boot by flashing the boot complete LED code (see Boot Codes).

femto-set-time.sh

Run by /etc/systemd/system/time-monitor.service.

Manages system time. Prevents clock drift, ensuring accurate logs & messages.

femto-meshtasticd-config.sh

Configures meshtasticd. Automates LoRa radio selection, security keys, and network settings.

sudo femto-meshtasticd-config.sh -h
Options are:
-h             This message
-i             Get important node info
-g             Gets the current configuration URL and QR code
-k             Get current LoRa radio selection
-l "RADIO"     Choose LoRa radio model. Options are `lr1121_tcxo`, `sx1262_tcxo`, `sx1262_xtal`, `none` (simradio)
-q "URL"       Set configuration URL
-u             Get current public key
-U "KEY"       Set public key
-r             Get current private key
-R "KEY"       Set private key
-a             View current admin keys
-A "KEY"       Set admin key
-c             Clear admin keys
-p             Get legacy admin channel state
-o "true"      Set legacy admin channel state (true/false = enabled/disabled), case sensitive
-w             Test mesh connectivity by sending "test" to channel 0 and waiting for. Will attempt 3 times
-s             Start/restart Meshtasticd service
-t             Stop Meshtasticd service
-M "enable"    Enable/disable Meshtasticd service. Options: "enable" "disable"
-S             Get Meshtasticd service state
-z             Upgrade Meshtasticd
-x             Uninstall Meshtasticd
-m             Meshtastic update tool. Syntax: `femto-meshtasticd-config.sh -m \"--set security.admin_channel_enabled false\" 10 \"Disable legacy admin\"`
               Will retry the `--set security.admin_channel_enabled false` command until successful or up to 10 times, and tag status reports with `Disable legacy admin` via echo and to system log.

femto-runonce.sh

Run by /etc/systemd/system/femto-runonce.service.

First-time boot setup. Initial setup script that optimizes storage and security.

* Resize filesystem to fit the SD card
* Allocate the swap file
* Replace the SSH encryption keys
* Add terminal type to user femto's .bashrc
* Set the eth0 MAC to be derivative of CPU serial number

Finally, the Femtofox will reboot.

Re-running this script after first boot should not cause any harm, but may not work as expected.

button.sh

Run by /etc/systemd/system/button.service.

Detects button presses. Provides hardware control (Wi-Fi toggle, reboot, shutdown).

femto-kernel-modules.sh

Menu system for managing kernel modules.

femto-pinout.sh

Displays Femtofox pinouts. Quick GPIO, UART, I2C, and LoRa pin reference.

sudo femto-pinout.sh -h
Options are:
-h             This message
-f             Femtofox pinout
-z             Femtofox Smol/Zero pinout
-t             Femtofox Tiny pinout
-l             Luckfox pinout

femto-license.sh

Displays Femtofox, Ubuntu, and Meshtastic licenses. Ensures legal compliance for open-source and commercial projects.

sudo femto-license.sh -h
Options are:
-h             This message
-a             About Femtofox
-f             Femtofox short-form license
-F             Femtofox long-form license
-m             Meshtastic licensing
-l             Luckfox license
-u             Ubuntu licenses

femto-usb-config-tool.sh

Run by /etc/systemd/system/femto-usb-config-tool.service.

Reads USB config file (femtofox-config.txt) and applies settings. Enables plug-and-play remote configuration via USB drive.

femto-utils.sh

System utilities. Provides logging, service management, and debugging tools.

sudo femto-utils.sh -h
Options are:
-h             This message
-a "enable"    Enable/disable ACT LED. Options: "enable" "disable" "check". If no argument is specified, setting in /etc/femto.conf will be used
-r             Reboot
-s             Shutdown
-l "enable"    Enable/disable logging. Options: "enable" "disable" "check"
-i             System info (all)
-p             Peripherals info
-c             CPU info
-n             Networking info
-o             OS info
-S             Storage & RAM info
-t "enable"    Enable/disable/start/stop/check ttyd (web terminal).  Options: "enable" "disable" "start" "stop" "check"
-E             Generate/overwrite SSH encryption keys
-C "service"   Check if service is enabled, disabled, running
-R "command"   Replace colors for dialog menus
-v             Get Foxbuntu version

femto-software.sh

Software package manager GUI. Simplifies installing & updating software.

femto-install-wizard.sh

First-time setup wizard GUI. User-friendly UI for configuring Wi-Fi, hostname, and LoRa.

femto-network-config.sh

Wi-Fi, Ethernet, and hostname management. Automates network setup for Wi-Fi and Ethernet.

sudo femto-network-config.sh -h
Options are:
-h             This message
-x "up"        Set wifi state (options are "up" or "down")
-T             Toggle wifi state
-s "SSID"      Set Wi-Fi SSID
-p "PSK"       Set Wi-Fi PSK (password)
-c "COUNTRY"   Set Wi-Fi 2-letter country code (such as US, DE)
-r             Restart Wi-Fi
-e             Get ethernet settings
-i             Get IPv4 addresses
-w             Get Wi-Fi settings
-n "HOSTNAME"  Change hostname
-t             Test internet connection

To set Wi-Fi settings, use -r as last argument to trigger reset after wpa_supplicant.conf is modified.

femto-watchclock-dog.sh

Run by /etc/systemd/system/femto-watchclock-dog.service.

Detects large time changes (≥1 week) and restarts meshtasticd service. Prevents meshtasticd incommunicado bug

femto-wifi-mesh-control.sh

Run by \etc\systemd\system\femto-wifi-mesh-control.service.

Keeps Wi-Fi settings synchronized between Linux and Meshtastic. Prevents connectivity issues between Linux and Meshtastic