[Ovirt-devel] [PATCH node] Disable o-c-storage on systems booted from local storage.

Darryl L. Pierce dpierce at redhat.com
Tue Mar 3 22:39:03 UTC 2009


Signed-off-by: Darryl L. Pierce <dpierce at redhat.com>
---
 scripts/ovirt-config-boot         |    3 +++
 scripts/ovirt-config-boot-wrapper |    2 +-
 scripts/ovirt-config-storage      |    6 ++++++
 3 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/scripts/ovirt-config-boot b/scripts/ovirt-config-boot
index 40b3a6b..3ee0665 100755
--- a/scripts/ovirt-config-boot
+++ b/scripts/ovirt-config-boot
@@ -155,6 +155,9 @@ EOF
     # mark new Root ready to go, reboot() in ovirt-function switches it to active
     lvrename HostVG RootNew RootUpdate
 
+    # remove the o-c-storage script symlink so it won't show in the firstboot menu
+    rm -f /etc/ovirt-config-setup.d/98_*
+
     rm -rf $tmpdir
     log "done."
 }
diff --git a/scripts/ovirt-config-boot-wrapper b/scripts/ovirt-config-boot-wrapper
index 4ac742a..5264bed 100755
--- a/scripts/ovirt-config-boot-wrapper
+++ b/scripts/ovirt-config-boot-wrapper
@@ -15,7 +15,7 @@ Please ensure that you have configured the local storage \n\
 and networking correctly on the previous menu before \n\
 continuing."
     printf "\n\n"
-    read -p "Do you wish to continue? (Y|N)? "
+    read -p "Do you wish to continue (Y/n)? "
     r=$(echo $REPLY|tr '[[:lower:]]' '[[:upper:]]')
     if [ "$r" == "Y" ]; then
         mount_live \
diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage
index c9225f7..c2ab88e 100755
--- a/scripts/ovirt-config-storage
+++ b/scripts/ovirt-config-storage
@@ -15,6 +15,12 @@ die() { warn "$*"; exit 1; }
 trap '__st=$?; stop_log; exit $__st' 0
 trap 'exit $?' 1 2 13 15
 
+# check that we're not booted from local storage; if so then exit with an error
+grep \/dev\/HostVG\/Root /proc/cmdline > /dev/null
+if [ 0 -eq $? ]; then 
+    die "You cannot configure storage on a running system. Please boot from CD/USB to configure local storage."
+fi
+
 default_overcommit=0.5
 
 default_boot_size=50
-- 
1.6.0.6




More information about the ovirt-devel mailing list