From b6d85b04286d30498a11aaac36e75032b1e72801 Mon Sep 17 00:00:00 2001 From: jonas Date: Sat, 10 Jun 2006 18:18:37 +0000 Subject: Added all work so far... git-svn-id: svn+ssh://xayide/home/jonas/private_svn/fleshybrid/trunk@2 8f53b18a-e215-0410-8885-9f593d34873e --- 0_format.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 0_format.sh (limited to '0_format.sh') diff --git a/0_format.sh b/0_format.sh new file mode 100755 index 0000000..6004327 --- /dev/null +++ b/0_format.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +set -e + +. ./config-DEFAULTS || exit 1 +. ./config-HOST || exit 1 +. ./config-TARGET || exit 1 +. ./config-MANDATED || exit 1 +. ./functions || exit 1 + +#sfdisk -l "$usbdev_host" +#TODO: Ask if you really want to erase shown partitions + +# FIXME: Loop and generate partition table dynamically +# (current code assumes alot of stuff about chosen bootloaders) + +# Partition, initialize and mount flash disk +# (Some BIOSes rumored to boot only sticks with specific drive geometry) +# (Some BIOSes, including oldest VIA EPIA mobos, require the -D option) +# (Add "1" in front of first comma if you want room for GRUB stage 1.5) +if [ "$MULTIPLE_BOOTLOADERS" = "yes" ] || [ "$INCOMPATIBLE_FS" = "yes" ]; then +# echo -e ',5,06,*\n,,L' | sfdisk -uM -D -C 125 -H 64 "$usbdev_host" + echo -e ',7,06,*\n,,L' | sfdisk -uM -D "$usbdev_host" + mkdosfs "$bootdev_host" + mke2fs "$rootdev_host" && tune2fs -m0 "$rootdev_host" +# FIXME: untested if GRUB properly supports vfat... +# mkdir "$mountpoint/boot" +# mount "$bootdev_host" "$mountpoint/boot" +else +# echo ',,L' | sfdisk -D -C 125 -H 64 -D "$usbdev_host" + echo ',,L,*' | sfdisk -D "$usbdev_host" + mke2fs "$rootdev_host" && tune2fs -m0 "$rootdev_host" +fi + +echo 'Done formatting target device!' -- cgit v1.2.3