[Ovirt-devel] [PATCH node] Adds a check for a partition table before installing.

Darryl L. Pierce dpierce at redhat.com
Mon Jan 5 20:31:37 UTC 2009


If no partition table is found then an error message is show to the user
and the system will not continue nor reboot.

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

diff --git a/scripts/ovirt-config-boot b/scripts/ovirt-config-boot
index 8ddd46a..d971c5c 100755
--- a/scripts/ovirt-config-boot
+++ b/scripts/ovirt-config-boot
@@ -142,7 +142,15 @@ if [ -z "$bootparams" ]; then
     bootparams="$OVIRT_BOOTPARAMS"
 fi
 
-ovirt_boot_setup "$disk" "$live" "$bootparams"
+# ensure the disk is not blank
+parted $disk -s "print all" > /dev/null
+
+if [ 0 -eq $? ]; then
+    ovirt_boot_setup "$disk" "$live" "$bootparams"
+else
+    printf "Please configure $disk before attempting to install the node image.\n"
+    doreboot="no"
+fi
 
 if [ -z "$doreboot" -o "$doreboot" = "yes" ]; then
     disable_firstbot
-- 
1.6.0.6




More information about the ovirt-devel mailing list