From 3fb1220251e63ced810985ef69108089c4fa4831 Mon Sep 17 00:00:00 2001 From: Stefan Fiedler Date: Sun, 23 Nov 2008 13:07:24 +0000 Subject: [PATCH] Stefan Fiedler: 1st-stage: handle errors when downloading 2nd stage from network [2008101514193922956] (https://www.rocklinux.net/submaster) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@9345 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- package/target-finish/1st-stage/linuxrc.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/package/target-finish/1st-stage/linuxrc.sh b/package/target-finish/1st-stage/linuxrc.sh index a0842e2f6..6d11d2bf9 100644 --- a/package/target-finish/1st-stage/linuxrc.sh +++ b/package/target-finish/1st-stage/linuxrc.sh @@ -121,7 +121,7 @@ EOF echo "[ ${url} ]" export ROCK_INSTALL_SOURCE_URL=${baseurl} - if ! mkdir /mnt_root ; then + if ! mkdir -p /mnt_root ; then echo "Can't create /mnt_root" return 1 fi @@ -131,10 +131,16 @@ EOF return 1 fi - wget -O - ${url} | tar ${STAGE_2_COMPRESS_ARG} -C /mnt_root -xf - - - echo "finished ... now booting 2nd stage" - doboot + if ! wget -O - ${url} | tar ${STAGE_2_COMPRESS_ARG} -C /mnt_root -xf - ; then + echo "Downloading and extracting image to /mnt_root failed" + else + echo "finished ... now booting 2nd stage" + + if ! doboot ; then + echo "Booting 2nd stage failed" + fi + fi + umount /mnt_root } # }}} load_modules() { # {{{ # this starts the module loading shell