blob: fd0d1b587ec3fbc014c812f704957cc848670645 [file] [log] [blame]
#!/bin/bash
# Copyright 2018 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#### CATEGORY=Software delivery
### run bootserver for paving
## usage: fx pave [extra bootserver arguments]
set -e
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/lib/vars.sh || exit $?
fx-config-read
name_args=()
name="$(get-device-name)" || exit $?
if [[ -n "$name" ]]; then
name_args+=("-n" "${name}")
fi
authkeys_path="$(get-ssh-authkeys)" || {
fx-error "Cannot continue without a valid authorized keys file."
exit 1
}
auth_keys_args=(--authorized-keys "${authkeys_path}" "$@")
if fx-is-bringup; then
auth_keys_args=()
fi
exec "${FUCHSIA_BUILD_DIR}/pave.sh" "${name_args[@]}" "${auth_keys_args[@]}" "$@"