#!/bin/sh set -e . ./common-settings || exit 1 . ./common-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!'