X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=rescue%2Flinux%2Fusb%2Fwrite_usb_boot_partition;h=a7164691e688f42386843f35a5e7dbc5e8217d83;hb=b626646cfc199d364df7a2b69cabda26e86f7c17;hp=518a5cb1ef31873614c975b74b4837fc8da33c0c;hpb=4afca20b7c7b2c265c8c65ff81717723cf2181b2;p=bacula%2Frescue diff --git a/rescue/linux/usb/write_usb_boot_partition b/rescue/linux/usb/write_usb_boot_partition index 518a5cb..a716469 100755 --- a/rescue/linux/usb/write_usb_boot_partition +++ b/rescue/linux/usb/write_usb_boot_partition @@ -19,6 +19,10 @@ umount ${USB_DEV}1 2>/dev/null 1>/dev/null echo "Reformat USB boot partition" mkfs.vfat -F 16 -n kubuntu8 ${USB_DEV}1 +if [ ! -d ${MOUNT_POINT}/kubuntu8 ] ; then + mkdir -p ${MOUNT_POINT}/kubuntu8 + created="yes" +fi mount ${USB_DEV}1 ${MOUNT_POINT}/kubuntu8 if [ $? -ne 0 ] ; then echo "Mount of USB boot partition failed." @@ -33,8 +37,13 @@ fi echo "Detaring boot image ..." tar xfz ${BOOT_IMAGE} cd ${CWD} -ls -l ${MOUNT_POINT}/kubuntu8 +syslinux -sf ${USB_DEV}1 +install-mbr -p1 ${USB_DEV} echo "syncing ..." sync +sync umount ${MOUNT_POINT}/kubuntu8 +if [ "x$created" = "xyes" ] ; then + rmdir ${MOUNT_POINT}/kubuntu8 +fi