X-Git-Url: https://git.grml.org/?p=grml2usb.git;a=blobdiff_plain;f=grml2usb;h=c4d178abfdabdc04f0550c08b6a52615e96edfe6;hp=f06ab9a7a1aedeb34bc1367d789ceffa16bc47a0;hb=80ba784ddef12e27a63e0cb88cc1332d0259cb32;hpb=e4a774796aafe18d465cc9d1891d56c3e8be5409 diff --git a/grml2usb b/grml2usb index f06ab9a..c4d178a 100755 --- a/grml2usb +++ b/grml2usb @@ -502,8 +502,6 @@ def install_grub(device): device_mountpoint = tempfile.mkdtemp(prefix="grml2usb") register_tmpfile(device_mountpoint) try: - mount(device, device_mountpoint, "") - # If using --grub-mbr then make sure we install grub in MBR instead of PBR if options.grubmbr: logging.debug("Using option --grub-mbr ...") @@ -512,15 +510,18 @@ def install_grub(device): grub_device = device set_rw(device) - set_rw(grub_device) + mount(device, device_mountpoint, "") logging.info("Installing grub as bootloader") - for opt in ["", "--force"]: - logging.debug("grub-install --recheck %s --no-floppy --root-directory=%s %s", - opt, device_mountpoint, grub_device) - proc = subprocess.Popen([GRUB_INSTALL, "--recheck", opt, + for opt in ["--", "--force"]: + set_rw(device) + set_rw(grub_device) + logging.debug("%s --recheck --no-floppy --target=i386-pc --root-directory=%s %s %s", + GRUB_INSTALL, device_mountpoint, opt, grub_device) + proc = subprocess.Popen([GRUB_INSTALL, "--recheck", "--no-floppy", "--target=i386-pc", - "--root-directory=%s" % device_mountpoint, grub_device], + "--root-directory=%s" % device_mountpoint, + opt, grub_device], stdout=file(os.devnull, "r+")) proc.wait() if proc.returncode == 0: @@ -715,8 +716,6 @@ def mount(source, target, mount_options): logging.debug("Source %s is not a device, therefore not mounting.", source) return 0 - set_rw(source) - logging.debug("mount %s %s %s", mount_options, source, target) proc = subprocess.Popen(["mount"] + list(mount_options) + [source, target]) proc.wait() @@ -1030,6 +1029,9 @@ def copy_addons(iso_mount, target): # ipxe.lkrn handle_addon_copy('ipxe.lkrn', addons, iso_mount) + # netboot.xyz + handle_addon_copy('netboot.xyz.lkrn', addons, iso_mount) + def build_loopbackcfg(target): """Generate GRUB's loopback.cfg based on existing config files. @@ -1593,6 +1595,8 @@ def install_grml(mountpoint, device): check_for_fat(device) if not options.skipbootflag: check_boot_flag(device) + + set_rw(device) mount(device, device_mountpoint, ['-o', 'utf8,iocharset=iso8859-1']) except CriticalException as error: mount(device, device_mountpoint, "")