aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common.sh8
-rwxr-xr-xdevices.sh14
2 files changed, 18 insertions, 4 deletions
diff --git a/common.sh b/common.sh
index 4f005de..1af840d 100644
--- a/common.sh
+++ b/common.sh
@@ -35,6 +35,11 @@ sshdest() {
awk -F- 'NF > 1 { print $2"."$1; exit } { print $1 }' <<<"$1"
}
+# Reverse opeartion for sshdest
+sshhost() {
+ awk -F. 'NF > 1 { print $2"-"$1; exit } { print $1 }' <<<"$1"
+}
+
_sh() {
if [ $# -gt 1 ]; then
"$@"
@@ -92,6 +97,9 @@ build() {
if [ "$(device_system "$device")" = "armv7l-linux" ]; then
toplevel=".config.system.build.cross.x86_64-linux${toplevel}"
fi
+ if [ "$(device_system "$device")" = "aarch64-linux" ]; then
+ toplevel=".config.system.build.cross.x86_64-linux${toplevel}"
+ fi
stage "Building system for device: $device"
nix build \
diff --git a/devices.sh b/devices.sh
index 3a2dce5..6c1f30b 100755
--- a/devices.sh
+++ b/devices.sh
@@ -42,11 +42,17 @@ operation="${1:-}"
declare -a selected_devices
if [ $# -gt 0 ]; then
for device in "$@"; do
- if ! valid_device "$device"; then
- error "No such device: $device" >&2
- exit 2
+ if valid_device "$device"; then
+ selected_devices+=("$device")
+ else
+ asdev="$(sshhost "$device")"
+ if valid_device "$asdev"; then
+ selected_devices+=("$asdev")
+ else
+ error "No such device: $device" >&2
+ exit 2
+ fi
fi
- selected_devices+=("$device")
done
else
selected_devices=("${devices[@]}")