170 |
170 |
|
171 |
171 |
format_disk0() {
|
172 |
172 |
local sfdisk_cmd="$SFDISK -uM -H 255 -S 63 --quiet --Linux --DOS $1"
|
173 |
|
if [ "${SWAP}" = "yes" -a -z "${KERNEL_PATH}" ] ; then
|
|
173 |
if [ "${SWAP}" = "yes" -a "${BOOT}" = "yes" ] ; then
|
174 |
174 |
# Create three partitions:
|
175 |
175 |
# 1 - 100MB /boot, bootable
|
176 |
176 |
# 2 - Size of Memory, swap
|
... | ... | |
180 |
180 |
,${SWAP_SIZE},S
|
181 |
181 |
,,L
|
182 |
182 |
EOF
|
183 |
|
elif [ "${SWAP}" = "no" -a -z "${KERNEL_PATH}" ] ; then
|
|
183 |
elif [ "${SWAP}" = "no" -a "${BOOT}" = "yes" ] ; then
|
184 |
184 |
# Create two partitions:
|
185 |
185 |
# 1 - 100MB /boot, bootable
|
186 |
186 |
# 2 - Rest
|
... | ... | |
188 |
188 |
,100,L,*
|
189 |
189 |
,,L
|
190 |
190 |
EOF
|
191 |
|
elif [ "${SWAP}" = "yes" -a -n "${KERNEL_PATH}" ] ; then
|
|
191 |
elif [ "${SWAP}" = "yes" -a "${BOOT}" = "no" ] ; then
|
192 |
192 |
# Create two partitions:
|
193 |
193 |
# 1 - Size of Memory, swap
|
194 |
194 |
# 2 - Rest
|
... | ... | |
196 |
196 |
,$SWAP_SIZE,S
|
197 |
197 |
,,L
|
198 |
198 |
EOF
|
199 |
|
elif [ "${SWAP}" = "no" -a -n "${KERNEL_PATH}" ] ; then
|
|
199 |
elif [ "${SWAP}" = "no" -a "${BOOT}" = "no" ] ; then
|
200 |
200 |
# Create two partitions:
|
201 |
201 |
# 1 - Whole
|
202 |
202 |
$sfdisk_cmd > /dev/null <<EOF
|
... | ... | |
259 |
259 |
map_partition() {
|
260 |
260 |
filesystem_dev="$1"
|
261 |
261 |
partition="$2"
|
262 |
|
if [ "${SWAP}" = "yes" -a -z "${KERNEL_PATH}" ] ; then
|
|
262 |
if [ "${SWAP}" = "yes" -a "${BOOT}" = "yes" ] ; then
|
263 |
263 |
boot_dev="${filesystem_dev}-1"
|
264 |
264 |
swap_dev="${filesystem_dev}-2"
|
265 |
265 |
root_dev="${filesystem_dev}-3"
|
266 |
|
elif [ "${SWAP}" = "no" -a -z "${KERNEL_PATH}" ] ; then
|
|
266 |
elif [ "${SWAP}" = "no" -a "${BOOT}" = "yes" ] ; then
|
267 |
267 |
boot_dev="${filesystem_dev}-1"
|
268 |
268 |
root_dev="${filesystem_dev}-2"
|
269 |
|
elif [ "${SWAP}" = "yes" -a -n "${KERNEL_PATH}" ] ; then
|
|
269 |
elif [ "${SWAP}" = "yes" -a "${BOOT}" = "no" ] ; then
|
270 |
270 |
swap_dev="${filesystem_dev}-1"
|
271 |
271 |
root_dev="${filesystem_dev}-2"
|
272 |
|
elif [ "${SWAP}" = "no" -a -n "${KERNEL_PATH}" ] ; then
|
|
272 |
elif [ "${SWAP}" = "no" -a "${BOOT}" = "no" ] ; then
|
273 |
273 |
root_dev="${filesystem_dev}-1"
|
274 |
274 |
fi
|
275 |
275 |
echo "$(eval "echo \${$(echo ${partition}_dev)"})"
|
... | ... | |
418 |
418 |
# only if the user want to specify a mirror in the defaults file we
|
419 |
419 |
# will use it, this declaration is to make sure the variable is set
|
420 |
420 |
: ${CDINSTALL:="no"}
|
|
421 |
: ${BOOT:="no"}
|
421 |
422 |
: ${SWAP:="yes"}
|
422 |
423 |
: ${SWAP_SIZE:="${INSTANCE_BE_memory}"}
|
423 |
424 |
: ${FILESYSTEM:="ext3"}
|