grubcfg: Quote the GRUB_DISTRIBUTOR value.

This commit is contained in:
Kevin Kofler 2014-11-16 04:58:00 +01:00
parent 76450b44a3
commit cde7356f0d

View File

@ -56,7 +56,7 @@ def modify_grub_default(partitions, root_mount_point, distributor):
elif lines[i].startswith("GRUB_CMDLINE_LINUX_DEFAULT"):
lines[i] = kernel_cmd
elif lines[i].startswith("#GRUB_DISTRIBUTOR") or lines[i].startswith("GRUB_DISTRIBUTOR"):
lines[i] = "GRUB_DISTRIBUTOR=%s" % distributor
lines[i] = "GRUB_DISTRIBUTOR='%s'" % distributor.replace("'", "'\\''")
with open(default_grub, 'w') as grub_file:
grub_file.write("\n".join(lines) + "\n")