aboutsummaryrefslogtreecommitdiff
path: root/upload-os
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-09-13 08:05:54 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-09-13 08:05:54 +0200
commit860b1892a0e9c3b8f33c1428c6f38546995e5d11 (patch)
tree686252dbcb572d4c0cf686998aaca3f25e2e86d1 /upload-os
parent2f106cc55047a8f77d64c28dde0911343013879b (diff)
WIP
Diffstat (limited to 'upload-os')
-rwxr-xr-xupload-os24
1 files changed, 22 insertions, 2 deletions
diff --git a/upload-os b/upload-os
index b573806..dcf295f 100755
--- a/upload-os
+++ b/upload-os
@@ -5,7 +5,7 @@
# If the tftp server host is not specified, then build@build-cache is
# assumed. The images are uploaded to /var/lib/tftpboot/buildos-devel/.
#
-usage="usage: $0 [<user>@<host>]"
+usage="usage: $0 [-a <arch>] [<user>@<host>]"
owd="$(pwd)"
trap "{ cd '$owd'; exit 1; }" ERR
@@ -14,6 +14,26 @@ set -o errtrace # Trap in functions.
function info () { echo "$*" 1>&2; }
function error () { info "$*"; exit 1; }
+arch=
+
+while [ "$#" -gt 0 ]; do
+ case "$1" in
+ -a)
+ shift
+ arch="$1"
+ shift
+ break
+ ;;
+ *)
+ break
+ ;;
+ esac
+done
+
+if [ -z "$arch" ]; then
+ arch="$(uname -m)"
+fi
+
if [ -z "$1" ]; then
host="build@build-cache"
else
@@ -25,5 +45,5 @@ fi
# is a bit more disk space used to temporarily hold copies.
#
rsync -v --progress -lpt -c --copy-unsafe-links --delay-updates \
- buildos-image buildos-initrd buildos-buildid \
+ "buildos-image-$arch" "buildos-initrd-$arch" "buildos-buildid-$arch" \
$host:/var/lib/tftpboot/buildos-devel/