Skip to content

Commit

Permalink
adding uas stage and updating action to grab artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
ampledata committed Mar 27, 2024
1 parent 70050a7 commit 0dca015
Show file tree
Hide file tree
Showing 20 changed files with 221 additions and 5 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/pi-gen-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: usimd/pi-gen-action@v1
id: build
with:
# Compression to apply on final image (either "none", "zip", "xz" or "gz").
compression: zip
Expand Down Expand Up @@ -108,7 +109,7 @@ jobs:
# images in stage2 (lite), stage4 and stage5. You probably want to hook in custom
# stages before one of the exported stages. Otherwise, the action will make sure
# any custom stage will include an image export directive.
stage-list: stage0 stage1 stage2 ../stage3-base ../stage3-wifi ../stage4-node-red ../stage5-common ../stage6-air ../stage7-sea ../stage8-docker
stage-list: stage0 stage1 stage2 ../stage3-base ../stage3-wifi ../stage4-node-red ../stage5-common ../stage6-air ../stage7-sea ../stage8-uas ../stage9-docker

# System timezone.
timezone: UTC
Expand All @@ -127,3 +128,8 @@ jobs:

# Password of default wifi network to connect to.
wpa-password: aryaos415

- uses: actions/upload-artifact@v3
with:
name: pi-gen-image
path: ${{ steps.build.outputs.image-path }}
6 changes: 3 additions & 3 deletions config
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@

AOS_FLAVOR="AryaOS"

IMG_NAME="aryaos-1.0.0-beta9"
IMG_NAME="aryaos-1.0.0-beta10"

PI_GEN_RELEASE="AryaOS: An Operating System for Modern Situational Awareness."
TARGET_HOSTNAME="aryaos"
FIRST_USER_NAME="pi"
FIRST_USER_PASS="aryaos415"
STAGE_LIST="stage0 stage1 stage2 ../stage3-base ../stage3-wifi ../stage4-node-red ../stage5-common ../stage6-air ../stage7-sea ../stage8-docker"
STAGE_LIST="stage0 stage1 stage2 ../stage3-base ../stage3-wifi ../stage4-node-red ../stage5-common ../stage6-air ../stage7-sea ../stage8-uas ../stage9-docker"
DISABLE_FIRST_BOOT_USER_RENAME=1
RELEASE="bookworm"
WPA_ESSID="AryaOS-WiFi"
Expand All @@ -38,4 +38,4 @@ APT_PROXY="http://172.17.2.88:3142"
DUMP1090_RECEIVER_SERIAL="stx:1090:0"
DUMP978_RECEIVER_SERIAL="stx:978:0"
COMITUP_WEB_PORT="9080"
AOS_SERVICES="AISCOT ADSBCOT LINCOT nodered"
AOS_SERVICES="AISCOT ADSBCOT LINCOT DroneCOT nodered"
6 changes: 5 additions & 1 deletion stage3-base/00-install/files/set_UUID.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ if [ ! grep -qs -e 'NODE_ID' $AOS_CONFIG ]; then
fi

if [ -z "$NODE_ID" ]; then
NEW_NODE_ID=$(python3 -c "import uuid;print(str(uuid.uuid4()).upper())")
if [ -f /sys/firmware/devicetree/base/serial-number ]; then
NEW_NODE_ID=$(cat /sys/firmware/devicetree/base/serial-number)
else
NEW_NODE_ID=$(python3 -c "import uuid;print(str(uuid.uuid4()).upper())")
fi
sed --follow-symlinks -i -E -e "s/NODE_ID.*/NODE_ID=$NEW_NODE_ID/" $AOS_CONFIG
logger "AryaOS NODE_ID is now set to: $NEW_NODE_ID"
else
Expand Down
22 changes: 22 additions & 0 deletions stage8-uas/00-install/00-run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash -e
# AryaOS 00-run.sh
#
# Copyright Sensors & Signals LLC https://www.snstac.com/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

install -v -m 644 files/AryaUAS.service "${ROOTFS_DIR}/lib/systemd/system/"

export APP_NAME="DroneCOT"
install -v -m 644 "files/${APP_NAME}-config.txt" "${ROOTFS_DIR}/boot/"
install -v -m 755 "files/run_${APP_NAME}.sh" "${ROOTFS_DIR}/usr/local/sbin/"
install -v -m 644 "files/${APP_NAME}.service" "${ROOTFS_DIR}/lib/systemd/system/"
23 changes: 23 additions & 0 deletions stage8-uas/00-install/01-run-chroot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash -e
# AryaOS 01-run-chroot.sh
#
# Copyright Sensors & Signals LLC https://www.snstac.com/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#


id dronecot || useradd --system dronecot

python3 -m pip install dronecot --break-system-packages

systemctl disable DroneCOT
systemctl disable AryaUAS
30 changes: 30 additions & 0 deletions stage8-uas/00-install/files/AryaUAS.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# AryaOS AryaUAS.service
#
# Meta-app for AryaOS UAS SA services.
#
# Copyright Sensors & Signals LLC https://www.snstac.com/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

[Unit]
Description=AryaUAS: Meta-app for AryaOS UAS SA services.
Documentation=https://github.com/SNSTAC/AryaOS
Wants=network.target
After=network.target

[Service]
Type=oneshot
ExecStart=/bin/true
RemainAfterExit=yes

[Install]
WantedBy=default.target
17 changes: 17 additions & 0 deletions stage8-uas/00-install/files/DroneCOT-config.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# AryaOS DroneCOT-config.txt
#
# DroneCOT Env configuration file.
#
# Copyright Sensors & Signals LLC https://www.snstac.com/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

37 changes: 37 additions & 0 deletions stage8-uas/00-install/files/DroneCOT.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# AryaOS DroneCOT.service
#
# DroneCOT service for systemd
#
# Copyright Sensors & Signals LLC https://www.snstac.com/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

[Unit]
Description=DroneCOT: Open Drone ID to TAK Gateway
Documentation=https://github.com/SNSTAC/DroneCOT
PartOf=AryaUAS.service
After=AryaUAS.service

[Service]
User=dronecot
RuntimeDirectory=DroneCOT
RuntimeDirectoryMode=0755
ExecStart=/usr/local/sbin/run_DroneCOT.sh
SyslogIdentifier=DroneCOT
Type=simple
Restart=on-failure
RestartSec=20
RestartPreventExitStatus=64
Nice=-5

[Install]
WantedBy=AryaUAS.target
32 changes: 32 additions & 0 deletions stage8-uas/00-install/files/run_DroneCOT.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
# AryaOS run_DroneCOT.sh
#
# Startup file for DroneCOT.
#
# Copyright Sensors & Signals LLC https://www.snstac.com/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

set -a
AOS_CONFIG="/boot/${AOS_FLAVOR:-AryaOS}-config.txt"
TOOL_CONFIG="/boot/DroneCOT-config.txt"

if [ -f $AOS_CONFIG ]; then
. $AOS_CONFIG
fi

if [ -f $TOOL_CONFIG ]; then
. $TOOL_CONFIG
fi

set +a
/usr/local/bin/dronecot
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions stage9-docker/01-install/01-run-chroot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash -e
# AryaOS 01-run-chroot.sh
#
# Copyright Sensors & Signals LLC https://www.snstac.com/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#


usermod -aG docker pi
22 changes: 22 additions & 0 deletions stage9-docker/EXPORT_IMAGE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# AryaOS EXPORT_IMAGE
#
# Export image configuration for AryaOS
#
# Copyright Sensors & Signals LLC https://www.snstac.com/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

IMG_SUFFIX="-build"

if [ "${USE_QEMU}" = "1" ]; then
export IMG_SUFFIX="${IMG_SUFFIX}-qemu"
fi
5 changes: 5 additions & 0 deletions stage9-docker/prerun.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash -e

if [ ! -d "${ROOTFS_DIR}" ]; then
copy_previous
fi

0 comments on commit 0dca015

Please sign in to comment.