X-Git-Url: http://git.grml.org/?p=grml2usb.git;a=blobdiff_plain;f=grml2usb;h=072f1b339dbfd138f09c8d07c99f9ba74362030b;hp=9d5c2ef6a9293670c8e13d34df313a4029219c2e;hb=a3dde41af080b40f4fab46eba2950d0ea98b2785;hpb=1fe44d6eb925578552821dd1c281ecb8e694dfe3 diff --git a/grml2usb b/grml2usb index 9d5c2ef..072f1b3 100755 --- a/grml2usb +++ b/grml2usb @@ -493,7 +493,8 @@ def install_grub(device): 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, "--no-floppy", + proc = subprocess.Popen([GRUB_INSTALL, "--recheck", opt, + "--no-floppy", "--target=i386-pc", "--root-directory=%s" % device_mountpoint, grub_device], stdout=file(os.devnull, "r+")) proc.wait() @@ -645,6 +646,10 @@ def install_mbr(mbrtemplate, device, partition, ismirbsdmbr=True): raise Exception("error executing dd (third run)") del tmpf + # make sure we sync filesystems before returning + proc = subprocess.Popen(["sync"]) + proc.wait() + def is_writeable(device): """Check if the device is writeable for the current user @@ -1732,6 +1737,9 @@ def check_options(opts): if opts.grubmbr and not opts.grub: raise CriticalException("--grub-mbr requires --grub option.") + if opts.copyonly and opts.grub: + raise CriticalException("Cannot use --copy-only and --grub at the same time.") + def check_programs(): """check if all needed programs are installed"""