]> git.sur5r.net Git - bacula/rescue/blob - rescue/linux/usb/write_usb_boot_partition
Update
[bacula/rescue] / rescue / linux / usb / write_usb_boot_partition
1 #!/bin/sh
2 #
3 # tar the disk image
4 #
5 . ./config
6
7 if [ ! `whoami` = "root" ] ; then
8   echo ""
9   echo "You need to be root to run this shell script"
10   echo ""
11   exit 1
12 fi
13
14 umount ${USB_DEV}1 2>/dev/null 1>/dev/null
15 echo "Reformat USB boot partition"
16 mkfs.vfat -F 16 -n kubuntu8 ${USB_DEV}1
17 mount ${USB_DEV}1 ${MOUNT_POINT}/kubuntu8
18 if [ $? -ne 0 ] ; then
19   echo "Mount of USB boot partition failed."
20   exit 1
21 fi
22 cd ${MOUNT_POINT}/kubuntu8
23 if [ $? -ne 0 ] ; then
24   echo "Could not cd to USB boot partition"
25   exit 1
26 fi
27 echo "Detaring boot image ..."
28 tar xfz ${BOOT_IMAGE}
29 cd ${CWD}
30 ls -l ${MOUNT_POINT}/kubuntu8
31 echo "syncing ..."
32 sync
33 umount ${MOUNT_POINT}/kubuntu8