X-Git-Url: https://git.grml.org/?p=grml2usb.git;a=blobdiff_plain;f=grml2usb;h=8f689a94d758356906d0a126c10d54dc9ac2dc4a;hp=e2d927995190ad5167e5fa3a1a16d207b789bbcf;hb=HEAD;hpb=073fee44304aa4279c7192b33557a5e139f11b16 diff --git a/grml2usb b/grml2usb index e2d9279..5ac6e76 100755 --- a/grml2usb +++ b/grml2usb @@ -64,7 +64,7 @@ RE_P_PARTITION = re.compile(r"(.*?\d+)p(\d+)$") RE_LOOP_DEVICE = re.compile(r"/dev/loop\d+$") -def syslinux_warning(option, opt, opt_parser): +def syslinux_warning(option, opt, _value, opt_parser): """A helper function for printing a warning about deprecated option""" # pylint: disable-msg=W0613 sys.stderr.write( @@ -75,7 +75,7 @@ def syslinux_warning(option, opt, opt_parser): # if grub option is set, unset syslinux option -def grub_option(option, opt, opt_parser): +def grub_option(option, opt, _value, opt_parser): """A helper function adjusting other option values""" # pylint: disable-msg=W0613 setattr(opt_parser.values, option.dest, True) @@ -806,7 +806,9 @@ def install_mbr(mbrtemplate, device, partition, ismirbsdmbr=True): set_rw(device) logging.debug( - "executing: dd if='%s' of='%s' bs=512 count=1 conv=notrunc", tmpf.name, device + "executing: dd if='%s' of='%s' bs=512 count=1 conv=notrunc,fsync", + tmpf.name, + device, ) proc = subprocess.Popen( [ @@ -815,7 +817,7 @@ def install_mbr(mbrtemplate, device, partition, ismirbsdmbr=True): "of=%s" % device, "bs=512", "count=1", - "conv=notrunc", + "conv=notrunc,fsync", ], stderr=open(os.devnull, "r+"), ) @@ -824,11 +826,6 @@ def install_mbr(mbrtemplate, device, partition, ismirbsdmbr=True): raise Exception("error executing dd (third run)") del tmpf - # make sure we sync filesystems before returning - logging.debug("executing: sync") - proc = subprocess.Popen(["sync"]) - proc.wait() - logging.debug("Probing device via 'blockdev --rereadpt %s'", device) proc = subprocess.Popen(["blockdev", "--rereadpt", device]) proc.wait() @@ -1617,7 +1614,6 @@ def handle_syslinux_config(grml_flavour, target): new_grml_cfg = "%s/%s_grml.cfg" % (syslinux_target, flavour_filename) if os.path.isfile(defaults_file): - # remove default menu entry in menu remove_default_entry(new_default_with_path)