Revision e21b8802

b/common.sh.in
94 94
}
95 95

  
96 96
format_disk0() {
97
  # Create three partitions:
98
  # 1 - 100MB /boot, bootable
99
  # 2 - Size of Memory, swap
100
  # 3 - Rest
101
  $SFDISK -uM -H 255 -S 63 --quiet --Linux "$1" <<EOF
97
    if [ "${SWAP}" = "yes" ] ; then
98
        # Create three partitions:
99
        # 1 - 100MB /boot, bootable
100
        # 2 - Size of Memory, swap
101
        # 3 - Rest
102
        $SFDISK -uM -H 255 -S 63 --quiet --Linux "$1" <<EOF
102 103
,100,L,*
103 104
,$INSTANCE_BE_memory,S
104 105
,,L
105 106
EOF
107
    else
108
        # Create two partitions:
109
        # 1 - 100MB /boot, bootable
110
        # 2 - Rest
111
        $SFDISK -uM -H 255 -S 63 --quiet --Linux "$1" <<EOF
112
,100,L,*
113
,,L
114
EOF
115
    fi
106 116
}
107 117

  
108 118
mount_disk0() {
......
159 169
# only if the user want to specify a mirror in the defaults file we
160 170
# will use it, this declaration is to make sure the variable is set
161 171
: ${CDINSTALL:="yes"}
172
: ${SWAP:="yes"}
162 173
: ${IMAGE_NAME:=""}
163 174
: ${IMAGE_TYPE:="qemu"}
164 175
: ${ARCH:=""}
b/create
48 48
    fi
49 49

  
50 50
    filesystem_base_dev=$(map_disk0 $blockdev)
51
    root_dev="${filesystem_base_dev}-3"
52
    boot_dev="${filesystem_base_dev}-1"
53
    swap_dev="${filesystem_base_dev}-2"
51
    if [ "${SWAP}" = "yes" ] ; then
52
        boot_dev="${filesystem_base_dev}-1"
53
        swap_dev="${filesystem_base_dev}-2"
54
        root_dev="${filesystem_base_dev}-3"
55
    else
56
        boot_dev="${filesystem_base_dev}-1"
57
        root_dev="${filesystem_base_dev}-2"
58
    fi
54 59
    CLEANUP+=("unmap_disk0 $blockdev")
55 60

  
56 61
    if [ "${IMAGE_TYPE}" = "tarball" ] ; then
......
58 63
        mke2fs -Fjq -L /boot $boot_dev
59 64
        # Format /
60 65
        mke2fs -Fjq -L / $root_dev
61
        # Format swap
62
        mkswap $swap_dev
66
        if [ "${SWAP}" = "yes" ] ; then
67
            # Format swap
68
            mkswap $swap_dev
69
        fi
63 70
    fi
64 71

  
65 72
    TMPDIR=`mktemp -d` || exit 1
b/defaults
5 5
# new image
6 6
# CDINSTALL="yes"
7 7

  
8
# SWAP: Create a swap partition
9
# SWAP=yes
10

  
8 11
# IMAGE_NAME: Name of the image to use
9 12
# Generally you use the name of the image with the version of the OS included.
10 13
# Examples include:

Also available in: Unified diff