[Ovirt-devel] [PATCH node] simplify autoinstall condition

Alan Pevec apevec at redhat.com
Wed Dec 10 22:56:56 UTC 2008


If minimal boot time config parameters are specified, autoinstall is performed.
Minimum are BOOTIF for choosing management NIC (IPv4 DHCP is assumed)
and ovirt_init to select local disk drive to install LVM partitions
(default volume sizes are used if ovirt_vol parameter is missing)
---
 scripts/ovirt-config-storage |    3 +--
 scripts/ovirt-firstboot      |    7 ++++++-
 scripts/ovirt-functions      |   13 -------------
 3 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage
index e2ddec1..12091db 100755
--- a/scripts/ovirt-config-storage
+++ b/scripts/ovirt-config-storage
@@ -270,10 +270,9 @@ ROOT_SIZE=${OVIRT_VOL_ROOT_SIZE:-$default_root_size}
 CONFIG_SIZE=${OVIRT_VOL_CONFIG_SIZE:-$default_config_size}
 LOGGING_SIZE=${OVIRT_VOL_LOGGING_SIZE:-$default_logging_size}
 
+DRIVE=$OVIRT_INIT
 
 if [ "$1" == "AUTO" ]; then
-    # In "AUTO" mode, OVIRT_INIT should be defined in the environment.
-    DRIVE=$OVIRT_INIT
     check_partition_sizes
     printf "Partitioning hard disk..."
     perform_partitioning
diff --git a/scripts/ovirt-firstboot b/scripts/ovirt-firstboot
index 8189864..e422774 100755
--- a/scripts/ovirt-firstboot
+++ b/scripts/ovirt-firstboot
@@ -35,7 +35,12 @@ start ()
     plymouth --quit
     plymouth --wait
 
-    if is_auto_install; then
+    if [ -n "$OVIRT_BOOTIF" -a -n "$OVIRT_INIT" ] ; then
+        # perform autoinstall if minimal parameters are present:
+        # networking - OVIRT_BOOTIF, management NIC
+        #       if other ip bootparams are not specified, IPv4 DHCP is assumed
+        # storage - OVIRT_INIT, local disk to use
+        #       if ovirt_vol is not specified, default volume sizes are set
         ovirt-config-networking AUTO
         newrole -r system_r -t virtd_t -- -c 'ovirt-config-storage AUTO'
         ovirt-config-logging AUTO
diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions
index c0ebc3a..3196d4b 100644
--- a/scripts/ovirt-functions
+++ b/scripts/ovirt-functions
@@ -26,19 +26,6 @@ is_standalone() {
     if is_managed; then return 1; else return 0; fi
 }
 
-# is_auto_install
-# return 0 if all required oVirt boot parameters are present
-is_auto_install() {
-    test -n "$OVIRT_BOOTIF" \
-        -a -n "$OVIRT_OVIRT_STANDALONE" \
-        -a -n "$OVIRT_INIT" \
-        -a -n "$OVIRT_VOL_BOOT_SIZE" \
-        -a -n "$OVIRT_VOL_SWAP_SIZE" \
-        -a -n "$OVIRT_VOL_ROOT_SIZE" \
-        -a -n "$OVIRT_VOL_CONFIG_SIZE" \
-        -a -n "$OVIRT_VOL_LOGGING_SIZE"
-}
-
 # find_srv SERVICE PROTO
 #
 # reads DNS SRV record
-- 
1.6.0.4




More information about the ovirt-devel mailing list