From 1f328087d94cc81faa6dff010e71ad439e1e8277 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Mon, 18 Nov 2013 14:17:22 +0000 Subject: [PATCH] Add troubleshooting override to deploy ramdisk. We now allow operators to drop into a troubleshooting shell while booting a deploy ramdisk, without having to have pre-configured their desire to do so ahead of time, by means of a 10 second pause for them to press a key. Change-Id: I05ffa1ebaa95c83dee7bd2a2f52ba4c08928bb10 --- elements/ramdisk/extra-data.d/scripts/d/init-func | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/elements/ramdisk/extra-data.d/scripts/d/init-func b/elements/ramdisk/extra-data.d/scripts/d/init-func index a9ae8f67..8a8dcabc 100755 --- a/elements/ramdisk/extra-data.d/scripts/d/init-func +++ b/elements/ramdisk/extra-data.d/scripts/d/init-func @@ -189,6 +189,21 @@ function stop_iscsi_target() { } function troubleshoot() { + if [ "$TROUBLESHOOT" != 1 ]; then + _DO_TROUBLESHOOT="" + _t=0 + echo -n "Troubleshooting required, press t to launch shell." + while [ $_t -lt 10 ]; do + read -n 1 -t 1 _DO_TROUBLESHOOT + _t=$(($_t + 1)) + if [ "$_DO_TROUBLESHOOT" == "t" ]; then + export TROUBLESHOOT=1 + break + fi + echo -n "." + done + echo "" + fi if [ "$TROUBLESHOOT" == 1 ]; then echo "Starting troubleshooting shell." bash