Skip to content

Commit

Permalink
Merge branch 'main' into feat/kalman-rust
Browse files Browse the repository at this point in the history
  • Loading branch information
matteocarnelos committed May 18, 2024
2 parents 1697bbb + 9dd6f73 commit d0afc0a
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 9 deletions.
7 changes: 2 additions & 5 deletions .make/sailtrack-package
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,8 @@ cp -v README.md $root_dir/boot/sailtrack-README.md
cp -v dietpi.txt $root_dir/boot/dietpi.txt
cp -v Automation_Custom_Script.sh $root_dir/boot/Automation_Custom_Script.sh
mkdir -p $root_dir/boot/sailtrack
cp -vr sailtrack $root_dir/boot
for binary in src/bin/*.rs
do
cp -v target/armv7-unknown-linux-gnueabihf/release/"$(basename "$binary" .rs)" $root_dir/boot/sailtrack
done
cp -v sailtrack/sailtrack-* $root_dir/boot/sailtrack
cp -v target/aarch64-unknown-linux-gnu/release/sailtrack-*[!.d] $root_dir/boot/sailtrack
cp -vrT rootfs $root_dir

# Unmount image
Expand Down
2 changes: 1 addition & 1 deletion Automation_Custom_Script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ G_EXEC rm /etc/systemd/system/dietpi-vpn.service
G_EXEC rm /etc/systemd/system/dietpi-cloudshell.service

# Install required packages
G_AGI telegraf rsync
G_AGI telegraf
G_EXEC_OUTPUT=1 G_EXEC_OUTPUT_COL="\e[90m" G_EXEC pip3 install gpiozero paho-mqtt smbus2 timeloop

# Enable SailTrack services
Expand Down
22 changes: 22 additions & 0 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,28 @@ Since DietPi-Automation's built-in features aren't enough to fully configure the
This script runs after the DietPi configuration, and it finishes the steps needed to set up SailTrack Core (e.g. it installs the missing packages, it sets up authentication tokens, etc.).
Once the script ends, the Raspberry Pi is rebooted, and SailTrack Core is then successfully deployed.

### Upload scripts to a running instance

To update the `sailtrack-*` scripts on o running SailTrack Core instance, the `cargo make upload` task can be used while being connected to "SailTrack-CoreNet":

```bash
cargo make upload
```

This task will build and upload all the `sailtrack-*` scripts found locally.
By default, the upload process will target SailTrack Core's default IP, namely `192.168.42.1`.
However, an optional argument can be passed to specify a custom IP address:

```bash
cargo make upload <IP-ADDRESS>
```

Where `<IP-ADDRESS>` is the IP address of SailTrack Core in the local network.

> [!NOTE]
> The `upload` task only uploads the scripts.
> If the script is run by a service, the service needs to be restarted to actually run the new script.
## Components

In this section, each component of the system will be analyzed in detail.
Expand Down
11 changes: 8 additions & 3 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ command = "cross"
[tasks.package]
clear = true
condition = { platforms = [ "linux" ] }
dependencies = [
"default"
]
dependencies = ["default"]
command = "sudo"
args = ["./.make/sailtrack-package"]

[tasks.upload]
dependencies = ["default"]
script = '''
scp sailtrack/sailtrack-* target/aarch64-unknown-linux-gnu/release/sailtrack-*[!.d] \
root@${1-192.168.42.1}:/boot/sailtrack
'''

0 comments on commit d0afc0a

Please sign in to comment.