summaryrefslogtreecommitdiff
path: root/0_format.sh
diff options
context:
space:
mode:
authorjonas <jonas@8f53b18a-e215-0410-8885-9f593d34873e>2006-06-10 18:18:37 +0000
committerjonas <jonas@8f53b18a-e215-0410-8885-9f593d34873e>2006-06-10 18:18:37 +0000
commitb6d85b04286d30498a11aaac36e75032b1e72801 (patch)
tree2fc597a2ae2cf69a5cc6b3e7162f02f89613b08d /0_format.sh
parent369cb1e5a343ec9e7c6f05de64f0eb102488d77f (diff)
Added all work so far...
git-svn-id: svn+ssh://xayide/home/jonas/private_svn/fleshybrid/trunk@2 8f53b18a-e215-0410-8885-9f593d34873e
Diffstat (limited to '0_format.sh')
-rwxr-xr-x0_format.sh35
1 files changed, 35 insertions, 0 deletions
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!'