Add an example about how to run hooks
[ext/instance-debootstrap.git] / common.sh.in
index 7ce75a5..a35eadd 100644 (file)
@@ -91,8 +91,8 @@ format_disk0() {
   # some versions of sfdisk need manual specification of
   # head/sectors for devices such as drbd which don't
   # report geometry
-  sfdisk -H 255 -S 63 --quiet --Linux "$1" <<EOF
-0,,L,*
+  sfdisk -H 64 -S 32 -u S --quiet --Linux "$1" <<EOF
+${PARTITION_ALIGNMENT},,L,*
 EOF
 }
 
@@ -142,19 +142,22 @@ fi
 # will use it, this declaration is to make sure the variable is set
 : ${MIRROR:=""}
 : ${PROXY:=""}
-: ${SUITE:="squeeze"}
+: ${SUITE:="wheezy"}
 : ${ARCH:=""}
 : ${EXTRA_PKGS:=""}
+: ${COMPONENTS:=""}
 : ${CUSTOMIZE_DIR:="@sysconfdir@/ganeti/instance-debootstrap/hooks"}
 : ${VARIANTS_DIR:="@sysconfdir@/ganeti/instance-debootstrap/variants"}
 : ${GENERATE_CACHE:="yes"}
 : ${CLEAN_CACHE:="14"} # number of days to keep a cache file
+: ${PARTITION_ALIGNMENT:=2048} # sectors to align partition (1Mib default)
 if [ -z "$OS_API_VERSION" -o "$OS_API_VERSION" = "5" ]; then
   DEFAULT_PARTITION_STYLE="none"
 else
   DEFAULT_PARTITION_STYLE="msdos"
 fi
 : ${PARTITION_STYLE:=$DEFAULT_PARTITION_STYLE} # disk partition style
+: ${OSP_FILESYSTEM:="ext4"}
 
 CACHE_DIR="@localstatedir@/cache/ganeti-instance-debootstrap"
 
@@ -182,7 +185,8 @@ if [ -z "$OS_API_VERSION" -o "$OS_API_VERSION" = "5" ]; then
   GETOPT_RESULT=`getopt -o o:n:i:b:s: -n '$0' -- "$@"`
   if [ $? != 0 ] ; then log_error "Terminating..."; exit 1 ; fi
   get_api5_arguments $GETOPT_RESULT
-elif [ "$OS_API_VERSION" = "10" -o "$OS_API_VERSION" = "15" ]; then
+elif [ "$OS_API_VERSION" = "10" -o "$OS_API_VERSION" = "15" -o \
+       "$OS_API_VERSION" = "20" ]; then
   get_api10_arguments
 else
   log_error "Unknown OS API VERSION $OS_API_VERSION"