7 if [ ! `whoami` = "root" ] ; then
9 echo "You need to be root to run this shell script"
13 if [ ! -f ${BOOT_IMAGE} ] ; then
14 echo "Could not find boot image: ${BOOT_IMAGE}"
17 if [ "`which syslinux`x" = "x" ] ; then
19 echo "Could not find syslinux. Try \"apt-get install syslinux\""
23 if [ "`which install-mbr`x" = "x" ] ; then
25 echo "Could not find install-mbr. Try \"apt-get install mbr\""
30 umount ${USB_DEV}1 2>/dev/null 1>/dev/null
32 echo "Reformat USB boot partition"
33 mkfs.vfat -F 16 -n kubuntu8 ${USB_DEV}1
34 if [ ! -d ${MOUNT_POINT}/kubuntu8 ] ; then
35 mkdir -p ${MOUNT_POINT}/kubuntu8
38 mount ${USB_DEV}1 ${MOUNT_POINT}/kubuntu8
39 if [ $? -ne 0 ] ; then
40 echo "Mount of USB boot partition failed."
43 cd ${MOUNT_POINT}/kubuntu8
44 if [ $? -ne 0 ] ; then
45 echo "Could not cd to USB boot partition"
49 echo "Detaring boot image ..."
51 # original-partioning.txt was created by partition_usb_key
52 if [ -e ${CWD}/original-partitioning.txt ] ; then
53 cp -f ${CWD}/original-partitioning.txt .
54 rm -f ${CWD}/original-partitioning.txt
58 syslinux -sf ${USB_DEV}1
59 install-mbr -p1 ${USB_DEV}
63 umount ${MOUNT_POINT}/kubuntu8
64 if [ "x$created" = "xyes" ] ; then
65 rmdir ${MOUNT_POINT}/kubuntu8