blob: dcf295fef85b9d9f7c8786b433cf7984a303107c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
#! /usr/bin/env bash
# Upload the Build OS images to a TFTP server.
#
# 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 [-a <arch>] [<user>@<host>]"
owd="$(pwd)"
trap "{ cd '$owd'; exit 1; }" ERR
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
host="$1"
fi
# Use --delay-updates to make things a bit more atomic (we don't want to
# start rebooting before kernel/initrd are finished syncing). The cost
# is a bit more disk space used to temporarily hold copies.
#
rsync -v --progress -lpt -c --copy-unsafe-links --delay-updates \
"buildos-image-$arch" "buildos-initrd-$arch" "buildos-buildid-$arch" \
$host:/var/lib/tftpboot/buildos-devel/
|