OpenBMC reboot loop for POWER hosts

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..78e3d2c
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,14 @@
+Copyright 2017 IBM Corp.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
diff --git a/petitboot.exp b/petitboot.exp
new file mode 100644
index 0000000..5477054
--- /dev/null
+++ b/petitboot.exp
@@ -0,0 +1,12 @@
+#!/usr/bin/expect -df --
+
+set timeout 300
+
+spawn ssh -p2200 $argv
+
+expect {
+	-ex "Petitboot"	{ exit }
+	timeout 	{ exit 1 }
+	eof		{ exit 2 }
+	.*		{ exp_continue }
+}
diff --git a/reboot.sh b/reboot.sh
new file mode 100755
index 0000000..ba674c0
--- /dev/null
+++ b/reboot.sh
@@ -0,0 +1,22 @@
+#!/bin/bash -x
+
+set -euo pipefail
+
+CONNECT=$1
+
+i=0
+
+while true;
+do
+    echo Boot $i
+
+    ssh ${CONNECT} /usr/sbin/obmcutil poweron
+    time expect petitboot.exp ${CONNECT}
+    ssh ${CONNECT} /usr/sbin/obmcutil poweroff
+    sleep 20 # mboxd reload period. Remove when protocol v2 daemon is integrated
+
+    i=$(($i + 1))
+
+    echo
+done
+