diff options
-rw-r--r-- | common.sh | 8 | ||||
-rwxr-xr-x | devices.sh | 14 |
2 files changed, 18 insertions, 4 deletions
@@ -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 \ @@ -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[@]}") |