Revision a1d43218

b/common.sh.in
115 115
    exit 1
116 116
  fi
117 117
  $KPARTX -a -p- $blockdev > /dev/null
118
  filesystem_dev="/dev/mapper/$filesystem_dev_base"
118
  filesystem_dev="/dev/mapper/${filesystem_dev_base/-1/}"
119 119
  if [ ! -b "$filesystem_dev" ]; then
120 120
    log_error "Can't find kpartx mapped partition: $filesystem_dev"
121 121
    exit 1
b/create
30 30
      CLEANUP+=("$LOSETUP -d $blockdev")
31 31
    fi
32 32

  
33
    if [ "$PARTITION_STYLE" = "none" ]; then
34
      filesystem_dev=$blockdev
35
    elif [ "$PARTITION_STYLE" = "msdos" ]; then
36
      # Create one big partition, and make it bootable
37
      format_disk0 $blockdev
38
      filesystem_dev=$(map_disk0 $blockdev)
39
      CLEANUP+=("unmap_disk0 $blockdev")
40
    else
41
      echo "Unknown partition style $PARTITION_STYLE"
42
      exit 1
43
    fi
44

  
45
    mke2fs -Fjq $filesystem_dev
46
    root_uuid=$($VOL_ID $filesystem_dev )
33
    # Create 3 partitions, /boot, swap, & /
34
    format_disk0 $blockdev
35
    filesystem_base_dev=$(map_disk0 $blockdev)
36
    root_dev="${filesystem_base_dev}-3"
37
    boot_dev="${filesystem_base_dev}-1"
38
    swap_dev="${filesystem_base_dev}-2"
39
    CLEANUP+=("unmap_disk0 $blockdev")
47 40

  
48
    if [ -n "$swapdev" ]; then
49
      mkswap $swapdev
50
      swap_uuid=$($VOL_ID $swapdev || true )
51
    fi
52

  
53
    ##
54
    # Do magical restore action for fast installs here
55
    ##
41
    # Format /boot
42
    mke2fs -Fjq $boot_dev
43
    # Format /
44
    mke2fs -Fjq $root_dev
45
    # Format swap
46
    mkswap $swap_dev
56 47

  
57 48
    TMPDIR=`mktemp -d` || exit 1
58 49
    CLEANUP+=("rmdir $TMPDIR")
59 50

  
60
    mount $filesystem_dev $TMPDIR
51
    # mount filesystems
52
    mount $root_dev $TMPDIR
53
    mount $boot_dev $TMPDIR/boot
54
    CLEANUP+=("umount $TMPDIR/boot")
61 55
    CLEANUP+=("umount $TMPDIR")
62 56

  
57
    ##
58
    # Do magical restore action for fast installs here
59
    ##
60

  
63 61
    RUN_PARTS=`which run-parts`
64 62

  
65 63
    if [ -n "$RUN_PARTS" -a -n "$CUSTOMIZE_DIR" -a -d "$CUSTOMIZE_DIR" ]; then
b/defaults
9 9
# The scripts are executed using run-parts
10 10
# By default /etc/ganeti/instance-image.d
11 11
# CUSTOMIZE_DIR="/etc/ganeti/instance-image.d"
12

  
13
# PARTITION_STYLE: whether and how the target device should be partitioned.
14
# Allowed values:
15
# 'none': just format the device, but don't partition it
16
# 'msdos': install an msdos partition table on the device, with a single
17
#          partition on it
18
# (more styles may be added in the future)
19
# The default is "msdos" from ganeti 2.0 onwards, but none if installing under
20
# Ganeti 1.2 (os api version 5)
21
# PARTITION_STYLE="none"

Also available in: Unified diff