X-Git-Url: https://git.grml.org/?p=grml2usb.git;a=blobdiff_plain;f=grml2usb;h=e85d5745273eb9adc5bc25bf6aaff4092aab596e;hp=8560f34396123529e2b690958e300ecf4ab52a94;hb=b79a4cc0cfb42be3f9f4aa33993f928bffedd692;hpb=3836a7165cd7f3e82ffca1b841fca16eb789a6ce diff --git a/grml2usb b/grml2usb index 8560f34..e85d574 100755 --- a/grml2usb +++ b/grml2usb @@ -22,7 +22,7 @@ import uuid import struct # global variables -PROG_VERSION = "0.9.26" +PROG_VERSION = "0.9.27~git" MOUNTED = set() # register mountpoints TMPFILES = set() # register tmpfiles DATESTAMP = time.mktime(datetime.datetime.now().timetuple()) # unique identifier for syslinux.cfg @@ -649,7 +649,7 @@ def install_grub(device): grub_device = device logging.info("Installing grub as bootloader") - logging.debug("grub-install --recheck --no-floppy --root-directory=%s %s", + logging.debug("grub-install --recheck --force --no-floppy --root-directory=%s %s", device_mountpoint, grub_device) proc = subprocess.Popen(["grub-install", "--recheck", "--force", "--no-floppy", "--root-directory=%s" % device_mountpoint, grub_device], @@ -974,19 +974,19 @@ def check_for_fat(partition): @partition: device name of partition""" + if not os.access(partition, os.R_OK): + raise CriticalException("Failed to read device %s" + " (wrong UID/permissions or device/directory not present?)" % partition) + try: udev_info = subprocess.Popen(["/sbin/blkid", "-s", "TYPE", "-o", "value", partition], stdout=subprocess.PIPE, stderr=subprocess.PIPE) filesystem = udev_info.communicate()[0].rstrip() - if udev_info.returncode == 2: - raise CriticalException("Failed to read device %s" - " (wrong UID/permissions or device/directory not present?)" % partition) - if filesystem != "vfat": raise CriticalException( - "Partition %s does not contain a FAT16 filesystem." % (partition) \ - + "(Use --fat16 or run mkfs.vfat %s)" % (partition)) + "Partition %s does not contain a FAT16 filesystem. " + "(Use --fat16 or run mkfs.vfat %s)" % (partition, partition)) except OSError: raise CriticalException("Sorry, /sbin/blkid not available (install e2fsprogs?)")