Option --rw-blockdev: set r/w also in GRUB specific steps
[grml2usb.git] / grml2usb
index b0ee2b1..e465ebe 100755 (executable)
--- 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 ...")
@@ -511,6 +509,9 @@ def install_grub(device):
             else:
                 grub_device = device
 
+            set_rw(device)
+            mount(device, device_mountpoint, "")
+
             logging.info("Installing grub as bootloader")
             for opt in ["", "--force"]:
                 set_rw(device)
@@ -1027,6 +1028,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.
@@ -1590,6 +1594,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, "")