Option --rw-blockdev: ensure to set device to rw between grub-install runs + don...
[grml2usb.git] / grml2usb
index 05067e4..b0ee2b1 100755 (executable)
--- a/grml2usb
+++ b/grml2usb
@@ -511,11 +511,10 @@ def install_grub(device):
             else:
                 grub_device = device
 
-            set_rw(device)
-            set_rw(grub_device)
-
             logging.info("Installing grub as bootloader")
             for opt in ["", "--force"]:
+                set_rw(device)
+                set_rw(grub_device)
                 logging.debug("grub-install --recheck %s --no-floppy --root-directory=%s %s",
                               opt, device_mountpoint, grub_device)
                 proc = subprocess.Popen([GRUB_INSTALL, "--recheck", opt,
@@ -715,8 +714,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()
@@ -1840,8 +1837,7 @@ def main():
         if not os.path.isdir(device):
             if device[-1:].isdigit():
                 if int(device[-1:]) > 4 or device[-2:].isdigit():
-                    logging.critical("Fatal: installation on partition number >4 not supported. (BIOS won't support it.)")
-                    sys.exit(1)
+                    logging.warn("Warning: installing on partition number >4, booting *might* fail depending on your system.")
 
         # provide upgrade path
         handle_compat_warning(device)