From bd97d0034f9777265da6fe4f23fa4b5f3c51a294 Mon Sep 17 00:00:00 2001 From: Guido Trotter Date: Wed, 28 Jan 2009 12:03:16 +0000 Subject: [PATCH] Add the PARTITION_STYLE configuration variable This variable will be used to decide if and how to partition the instance block device. Reviewed-by: iustinp --- create.in | 6 ++++++ defaults | 8 ++++++++ 2 files changed, 14 insertions(+), 0 deletions(-) diff --git a/create.in b/create.in index cbe3ae4..315adc7 100755 --- 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 diff --git a/defaults b/defaults index de52e11..e2c73ae 100644 --- 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" -- 1.7.2.5