otherwise, the value of this variable will be taken as the number of
days after which to remove the cache file; the default is 14 (two
weeks)
+- PARTITION_STYLE: if 'none' the device will be formatted directly, if 'msdos'
+ a partition table will be installed on it. You need to have kpartx installed
+ to use the 'msdos' option.
Note that the settings file is important on the node that the instance
is installed on, not the cluster master. This is indeed not a very good
CLEANUP+=("losetup -d $blockdev")
fi
-if [ "$PARTITION_STYLE" != "none" ]; then
+if [ "$PARTITION_STYLE" = "none" ]; then
+ filesystem_dev=$blockdev
+elif [ "$PARTITION_STYLE" = "msdos" ]; then
+ # Create one big partition, and make it bootable
+ sfdisk --quiet --Linux $blockdev <<EOF
+0,,L,*
+EOF
+ block_base=`basename $blockdev`
+ filesystem_dev_base=`kpartx -l -p- $blockdev | \
+ grep -m 1 "^$block_base.*$blockdev" | \
+ awk '{print $1}'`
+ kpartx -a -p- $blockdev
+ CLEANUP+=("kpartx -d -p- $blockdev")
+ filesystem_dev="/dev/mapper/$filesystem_dev_base"
+else
echo "Unknown partition style $PARTITION_STYLE"
exit 1
fi
-mke2fs -Fjq $blockdev
-root_uuid=$($VOL_ID -u $blockdev )
+mke2fs -Fjq $filesystem_dev
+root_uuid=$($VOL_ID -u $filesystem_dev )
+
if [ -n "$swapdev" ]; then
mkswap $swapdev
swap_uuid=$($VOL_ID -u $swapdev )
TMPDIR=`mktemp -d` || exit 1
CLEANUP+=("rmdir $TMPDIR")
-mount $blockdev $TMPDIR
+mount $filesystem_dev $TMPDIR
CLEANUP+=("umount $TMPDIR")
# remove the cache file if it's old (> 2 weeks) and writable by the owner (the