aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Roxell <anders.roxell@linaro.org>2017-12-22 15:49:11 +0100
committerAnders Roxell <anders.roxell@linaro.org>2017-12-22 15:49:11 +0100
commitb8954afd88407dd5fd0d6dde203d2e86c75da6a0 (patch)
tree3323330e88ff208363de481f78694e3ed5d0f011
parent9945adb320cb45f64f289bd1855abc37063fc394 (diff)
deploy-kernel: reboot target
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
-rwxr-xr-xdeploy-kernel14
1 files changed, 13 insertions, 1 deletions
diff --git a/deploy-kernel b/deploy-kernel
index c74def0..6fc1944 100755
--- a/deploy-kernel
+++ b/deploy-kernel
@@ -7,6 +7,7 @@ ROOTDIR=$(dirname $(readlink -f $(type -p $0)))
TOP=${TOP:-$(pwd)}
cd ${TOP}
SSH_USER=root
+reboot=0
usage() {
echo -e "$(basename $0)'s help text"
@@ -14,6 +15,7 @@ usage() {
echo -e " -l staging_buildstr, if not provided it will list all available"
echo -e " for the specified ARCH and wait for input from user, default: ''"
echo -e " -m machine, add machine name"
+ echo -e " -r, reboot target"
}
find_staging_builds() {
@@ -62,7 +64,13 @@ scp_kernel_modules_to_target() {
tar -C ${STAGING}/lib/modules -cf - . | ${SSHTARGET} "tar -C /lib/modules -xf -"
}
-while getopts "i:l:m:h" arg; do
+reboot_target() {
+ if [[ $1 -eq 1 ]]; then
+ ${SSHTARGET} "reboot"
+ fi
+}
+
+while getopts "i:l:m:hr" arg; do
case $arg in
i)
target_ip="$OPTARG"
@@ -73,6 +81,9 @@ while getopts "i:l:m:h" arg; do
m)
machine="$OPTARG"
;;
+ r)
+ reboot=1
+ ;;
h|*)
usage
exit 0
@@ -140,5 +151,6 @@ install_ssh_key ${target_ip}
scp_kernel_modules_to_target
scp_dtb_image_to_target
scp_kernel_image_to_target
+reboot_target ${reboot}
## vim: set sw=4 sts=4 et foldmethod=syntax : ##