[grubcfg] Fix mismatched quoting and escaping.
If we use .replace("'", "'\\''") for escaping, we also need to use single quotes, not double quotes. This was broken by the port from '%' to format, which also randomly changed quoting characters for no good reason. Changing the outer ones does not matter, but \" or ' within a string is not the same thing!
This commit is contained in:
parent
5b2cc2cbb1
commit
2573731cdb
@ -65,7 +65,7 @@ def modify_grub_default(partitions, root_mount_point, distributor):
|
||||
if swap_uuid:
|
||||
kernel_params.append("resume=UUID={!s}".format(swap_uuid))
|
||||
|
||||
distributor_line = "GRUB_DISTRIBUTOR=\"{!s}\"".format(distributor_replace)
|
||||
distributor_line = "GRUB_DISTRIBUTOR='{!s}'".format(distributor_replace)
|
||||
|
||||
if not os.path.exists(default_dir):
|
||||
os.mkdir(default_dir)
|
||||
@ -123,7 +123,7 @@ def modify_grub_default(partitions, root_mount_point, distributor):
|
||||
else:
|
||||
escaped_value = str(value).replace("'", "'\\''")
|
||||
|
||||
lines.append("{!s}=\"{!s}\"".format(key, escaped_value))
|
||||
lines.append("{!s}='{!s}'".format(key, escaped_value))
|
||||
|
||||
if not have_kernel_cmd:
|
||||
kernel_cmd = "GRUB_CMDLINE_LINUX_DEFAULT=\"{!s}\"".format(" ".join(kernel_params))
|
||||
|
Loading…
Reference in New Issue
Block a user