* Fixed some typos, cleaned up the indentation.

svn path=/nixos/trunk/; revision=12720
This commit is contained in:
Eelco Dolstra 2008-08-26 12:45:36 +00:00
parent 15e77dfb1c
commit ff6a662f6e

View File

@ -1,33 +1,39 @@
#! @staticShell@ #! @staticShell@
targetRoot=/mnt/root targetRoot=/mnt/root
dialog(){
errorDialog() {
timeout=15 timeout=15
echo echo
echo "Press within $timeout seconds:" echo "Press within $timeout seconds:"
echo " f) to switch finally to an interactive shell having pid 1" echo " i) to launch an interactive shell"
echo " (you'll need this to start stage2 / upstart)" echo " f) to start an interactive shell having pid 1"
echo " i) to launch an intercative shell" echo " (needed if you want to start Stage 2 manually)"
echo " *) to continue immediately (ignoring the failing command)" echo " *) to continue immediately (ignoring the failing command)"
read -t $timeout reply read -t $timeout reply
case $reply in case $reply in
f) exec @staticShell@;; f)
i) echo exec @staticShell@;;
echo "Quit interactive shell with exit status of" i)
echo " 0 : to continue" echo
echo " non zero : to get this dialog again (eg to switch to interactive shell with pid 1" echo "Quit interactive shell with exit status of"
@staticShell@ || fail echo " 0 : to continue"
;; echo " non-zero : to get this dialog again"
*) echo continuing ignoring error;; @staticShell@ || fail
;;
*)
echo continuing ignoring error;;
esac esac
} }
fail(){
fail() {
# If starting stage 2 failed, start an interactive shell. # If starting stage 2 failed, start an interactive shell.
echo "error while running Stage 1" echo "error while running Stage 1"
echo "Stage 1 should mount the root partition containing the nix store on \`$targetRoot'"; echo "Stage 1 should mount the root partition containing the nix store on \`$targetRoot'";
echo echo
dialog errorDialog
} }
trap 'fail' ERR; trap 'fail' ERR;