summaryrefslogtreecommitdiff
path: root/scripts/install-system
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-09-10 15:42:45 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-09-10 15:42:45 -0700
commitca9a098690f99357a259953d5fb21b8dac014694 (patch)
treef4ea42b84a757ab7c563fe95458e3ce31ac801bb /scripts/install-system
parent7b4a3a28819d980c3e9464820f0c81746f77c6e9 (diff)
downloadvyatta-cfg-quagga-ca9a098690f99357a259953d5fb21b8dac014694.tar.gz
vyatta-cfg-quagga-ca9a098690f99357a259953d5fb21b8dac014694.zip
Move check for livecd install to before filesystem intialization
Check for install-system failure (because of attempt to install from active system), to occur before filesystem is destroyed. Bug 1587
Diffstat (limited to 'scripts/install-system')
-rwxr-xr-xscripts/install-system16
1 files changed, 9 insertions, 7 deletions
diff --git a/scripts/install-system b/scripts/install-system
index d816c159..53b654ed 100755
--- a/scripts/install-system
+++ b/scripts/install-system
@@ -1336,6 +1336,15 @@ if [ -z "$INSTALL_METHOD" ]; then
echo
fi
+# Unless doing union install, must be from live cd
+if [ "$INSTALL_METHOD" == "union" -o "$INSTALL_METHOD" == "u" ] &&
+ [ ! -d /live/image -o -w /live/image ]
+then
+ echo "install-system can only be run from livecd"
+ echo "(except if doing union install)"
+ exit 1
+fi
+
# TODO: Note installs assume an LBA BIOS. So no boot partition currently.
# also note that we are not creating a swap partition right now.
if [ "$INSTALL_METHOD" == "parted" ] || [ "$INSTALL_METHOD" == "p" ]; then
@@ -1368,13 +1377,6 @@ elif [ "$INSTALL_METHOD" == "vyatta" ]; then
sleep 5
fi
-if [ ! -d /live/image -o -w /live/image ]; then
- if [ -z $UNION ]; then
- echo "install-system can only be run from livecd"
- exit 1
- fi
-fi
-
# Install the root filesystem
install_root_filesystem "$ROOT_PARTITION"