[grubcfg] fix syntax

This commit is contained in:
Philip Müller 2018-09-26 22:22:21 +02:00
parent b7d993d211
commit 1f52bfac4e

View File

@ -157,13 +157,13 @@ def modify_grub_default(partitions, root_mount_point, distributor):
line = line.rstrip("'") line = line.rstrip("'")
existing_params = line.split() existing_params = line.split()
for existing_param in existing_params: if not os.path.exists(os.path.join(root_mount_point, "usr/bin/grub-set-bootflag")):
existing_param_name = existing_param.split("=")[0] for existing_param in existing_params:
existing_param_name = existing_param.split("=")[0]
# the only ones we ever add # the only ones we ever add
if not os.path.exists(os.path.join(root_mount_point, "usr/bin/grub-set-bootflag")) if existing_param_name not in ["quiet", "resume", "splash"]:
and existing_param_name not in ["quiet", "resume", "splash"]: kernel_params.append(existing_param)
kernel_params.append(existing_param)
kernel_cmd = "GRUB_CMDLINE_LINUX_DEFAULT=\"{!s}\"".format( kernel_cmd = "GRUB_CMDLINE_LINUX_DEFAULT=\"{!s}\"".format(
" ".join(kernel_params) " ".join(kernel_params)