| #!/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. |
| |
| ### do a system OTA |
| |
| ## usage: fx ota [-h|--help] |
| ## |
| ## Ask the target to do an OTA. The target will use any update server available |
| ## to it to do the update. This requires the target have a update server |
| ## available to it. The 'serve' fx command is typically used to make your |
| ## development host available to the target as an update server. |
| ## |
| ## Arguments: |
| ## -h|--help Print out this message. |
| |
| source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/lib/vars.sh || exit $? |
| source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/lib/updates.sh || exit $? |
| fx-config-read |
| |
| function main { |
| fx-standard-switches "$@" |
| set -- "${FX_ARGV[@]}" |
| |
| check-for-amber-server || return -1 |
| |
| fx-command-run shell "$@" amberctl system_update |
| local r=$? |
| echo "Check the target's log for update progress" |
| return $r |
| } |
| |
| main "$@" |