]> git.sur5r.net Git - bacula/rescue/blob - rescue/linux/usb/write_usb_boot_partition
Updates
[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 if [ ! -f ${BOOT_IMAGE} ] ; then
14   echo "Could not find boot image: ${BOOT_IMAGE}"
15   exit 1
16 fi
17
18 umount ${USB_DEV}1 2>/dev/null 1>/dev/null
19
20 echo "Reformat USB boot partition"
21 mkfs.vfat -F 16 -n kubuntu8 ${USB_DEV}1
22 mount ${USB_DEV}1 ${MOUNT_POINT}/kubuntu8
23 if [ $? -ne 0 ] ; then
24   echo "Mount of USB boot partition failed."
25   exit 1
26 fi
27 cd ${MOUNT_POINT}/kubuntu8
28 if [ $? -ne 0 ] ; then
29   echo "Could not cd to USB boot partition"
30   exit 1
31 fi
32
33 echo "Detaring boot image ..."
34 tar xfz ${BOOT_IMAGE}
35 cd ${CWD}
36 ls -l ${MOUNT_POINT}/kubuntu8
37
38 echo "syncing ..."
39 sync
40 umount ${MOUNT_POINT}/kubuntu8