mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-30 19:05:36 -04:00
[grubcfg] Only replace a GRUB_DISTRIBUTOR line if wanted
This commit is contained in:
parent
aae7d7dd0a
commit
ac3b50fabb
1 changed files with 11 additions and 3 deletions
|
@ -45,7 +45,10 @@ def modify_grub_default(partitions, root_mount_point, distributor):
|
||||||
|
|
||||||
:param partitions:
|
:param partitions:
|
||||||
:param root_mount_point:
|
:param root_mount_point:
|
||||||
:param distributor:
|
:param distributor: name of the distributor to fill in for
|
||||||
|
GRUB_DISTRIBUTOR. Must be a string, but if it is empty ("")
|
||||||
|
then the existing GRUB_DISTRIBUTOR lines are kept instead
|
||||||
|
of replaced by a new line.
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
default_dir = os.path.join(root_mount_point, "etc/default")
|
default_dir = os.path.join(root_mount_point, "etc/default")
|
||||||
|
@ -172,6 +175,7 @@ def modify_grub_default(partitions, root_mount_point, distributor):
|
||||||
have_kernel_cmd = True
|
have_kernel_cmd = True
|
||||||
elif (lines[i].startswith("#GRUB_DISTRIBUTOR")
|
elif (lines[i].startswith("#GRUB_DISTRIBUTOR")
|
||||||
or lines[i].startswith("GRUB_DISTRIBUTOR")):
|
or lines[i].startswith("GRUB_DISTRIBUTOR")):
|
||||||
|
if distributor:
|
||||||
lines[i] = distributor_line
|
lines[i] = distributor_line
|
||||||
have_distributor_line = True
|
have_distributor_line = True
|
||||||
else:
|
else:
|
||||||
|
@ -236,6 +240,10 @@ def run():
|
||||||
|
|
||||||
root_mount_point = libcalamares.globalstorage.value("rootMountPoint")
|
root_mount_point = libcalamares.globalstorage.value("rootMountPoint")
|
||||||
branding = libcalamares.globalstorage.value("branding")
|
branding = libcalamares.globalstorage.value("branding")
|
||||||
|
|
||||||
|
if libcalamares.job.configuration.get("keepDistributor", false):
|
||||||
|
distributor = ""
|
||||||
|
else:
|
||||||
distributor = branding["bootloaderEntryName"]
|
distributor = branding["bootloaderEntryName"]
|
||||||
|
|
||||||
return modify_grub_default(partitions, root_mount_point, distributor)
|
return modify_grub_default(partitions, root_mount_point, distributor)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue