X-Git-Url: https://git.grml.org/?p=grml2usb.git;a=blobdiff_plain;f=grml2usb;h=63c26b37598958f301eed341a6efe1412626b52c;hp=0a34583c9b17e3b9074c9cbb1936a93e34f0627a;hb=5251ce1484272c48247551148a59dbd6bb13f6f1;hpb=7c076d1dd83dc76e700f430d33d81507c322de30 diff --git a/grml2usb b/grml2usb index 0a34583..63c26b3 100755 --- a/grml2usb +++ b/grml2usb @@ -108,6 +108,8 @@ parser.add_option("--syslinux", dest="syslinux", action="callback", default=True help="install syslinux bootloader (deprecated as it's the default)") parser.add_option("--syslinux-mbr", dest="syslinuxmbr", action="store_true", help="install syslinux master boot record (MBR) instead of default") +parser.add_option("--tmpdir", dest="tmpdir", default="/tmp", + help="directory to be used for temporary files") parser.add_option("--verbose", dest="verbose", action="store_true", help="enable verbose mode") parser.add_option("-v", "--version", dest="version", action="store_true", @@ -902,22 +904,15 @@ def copy_addons(iso_mount, target): # grub all-in-one image handle_addon_copy('allinone.img', addons, iso_mount) - # bsd imag + # bsd image handle_addon_copy('bsd4grml', addons, iso_mount) + # DOS image handle_addon_copy('balder10.imz', addons, iso_mount) - # install hdt and pci.ids only when using syslinux (grub doesn't support it) - if options.syslinux: - # hdt (hardware detection tool) image - hdtimg = search_file('hdt.c32', iso_mount) - if hdtimg: - exec_rsync(hdtimg, addons + '/hdt.c32') - - # pci.ids file - picids = search_file('pci.ids', iso_mount) - if picids: - exec_rsync(picids, addons + '/pci.ids') + # syslinux + pci.ids for hdt + for expr in '*.c32', 'pci.ids': + glob_and_copy(iso_mount + '/boot/addons/' + expr, addons) # memdisk image handle_addon_copy('memdisk', addons, iso_mount) @@ -1114,7 +1109,8 @@ def identify_grml_flavour(mountpath): if not version_files: logging.critical("Error: could not find grml-version file.") - raise + cleanup() + sys.exit(1) flavours = [] logging.debug("version_files = %s", version_files) @@ -1436,7 +1432,7 @@ def install(image, device): logging.info("Using %s as install base", image) else: logging.info("Using ISO %s", image) - iso_mountpoint = tempfile.mkdtemp(prefix="grml2usb") + iso_mountpoint = tempfile.mkdtemp(prefix="grml2usb", dir=options.tmpdir) register_tmpfile(iso_mountpoint) remove_image_mountpoint = True try: @@ -1464,7 +1460,7 @@ def install_grml(mountpoint, device): device_mountpoint = device if os.path.isdir(device): - logging.info("Specified device is not a directory, therefore not mounting.") + logging.info("Specified device is a directory, therefore not mounting.") remove_device_mountpoint = False else: device_mountpoint = tempfile.mkdtemp(prefix="grml2usb")