Add the PARTITION_STYLE configuration variable
authorGuido Trotter <ultrotter@google.com>
Wed, 28 Jan 2009 12:03:16 +0000 (12:03 +0000)
committerGuido Trotter <ultrotter@google.com>
Wed, 28 Jan 2009 12:03:16 +0000 (12:03 +0000)
This variable will be used to decide if and how to partition the
instance block device.

Reviewed-by: iustinp

create.in
defaults

index cbe3ae4..315adc7 100755 (executable)
--- a/create.in
+++ b/create.in
@@ -50,6 +50,7 @@ fi
 : ${EXTRA_PKGS:=""}
 : ${GENERATE_CACHE:="yes"}
 : ${CLEAN_CACHE:="14"} # number of days to keep a cache file
+: ${PARTITION_STYLE:="none"} # disk partition style
 
 CACHE_DIR="@localstatedir@/cache/ganeti-instance-debootstrap"
 
@@ -70,6 +71,11 @@ if [ ! -b $blockdev ]; then
   CLEANUP+=("losetup -d $blockdev")
 fi
 
+if [ "$PARTITION_STYLE" != "none" ]; then
+  echo "Unknown partition style $PARTITION_STYLE"
+  exit 1
+fi
+
 mke2fs -Fjq $blockdev
 root_uuid=$($VOL_ID -u $blockdev )
 if [ -n "$swapdev" ]; then
index de52e11..e2c73ae 100644 (file)
--- a/defaults
+++ b/defaults
@@ -46,3 +46,11 @@ GENERATE_CACHE="yes"
 # clean the cache; the default is 14 (two weeks); to disable cache
 # cleaning, set it to an empty value ("")
 CLEAN_CACHE="14"
+
+# PARTITION_STYLE: whether and how the target device should be partitioned.
+# Allowed values:
+# 'none': just format the device, but don't partition it
+# 'msdos': install an msdos partition table on the device, with a single
+#          partition on it
+# (more styles may be added in the future)
+PARTITION_STYLE="none"