[grubcfg] snake-case one configuration key

This makes all the keys in grubcfg consistently
snake-case (rather than one being a camel).
This commit is contained in:
Adriaan de Groot 2022-02-02 15:02:58 +01:00
parent d1e4740e70
commit a352bd946e
6 changed files with 11 additions and 14 deletions

View File

@ -9,7 +9,7 @@
#
# Calculated values are:
# - GRUB_DISTRIBUTOR, branding module, *bootloaderEntryName* (this
# string is sanitized, and see also setting *keepDistributor*)
# string is sanitized, and see also setting *keep_distributor*)
# - GRUB_ENABLE_CRYPTODISK, based on the presence of filesystems
# that use LUKS
# - GRUB_CMDLINE_LINUX_DEFAULT, adding LUKS setup and plymouth
@ -29,9 +29,7 @@ prefer_grub_d: false
# kept, not updated to the *bootloaderEntryName* from the branding file.
# Use this if the GRUB_DISTRIBUTOR setting in the file is "smart" in
# some way (e.g. uses shell-command substitution).
#
# TODO:3.3:snake-case this key
keepDistributor: false
keep_distributor: false
# The default kernel params that should always be applied.
# This is an array of strings. If it is unset, the default is

View File

@ -7,8 +7,7 @@ additionalProperties: false
type: object
properties:
overwrite: { type: boolean, default: false }
# TODO:3.3:snake-case this key
keepDistributor: { type: boolean, default: false }
keep_istributor: { type: boolean, default: false }
prefer_grub_d: { type: boolean, default: false }
kernel_params: { type: array, items: { type: string } }
defaults:

View File

@ -95,10 +95,10 @@ def modify_grub_default(partitions, root_mount_point, distributor):
:param root_mount_point:
:param distributor: name of the distributor to fill in for
GRUB_DISTRIBUTOR. Must be a string. If the job setting
*keepDistributor* is set, then this is only used if no
GRUB_DISTRIBUTOR is found at all (otherwise, when *keepDistributor*
*keep_distributor* is set, then this is only used if no
GRUB_DISTRIBUTOR is found at all (otherwise, when *keep_distributor*
is set, the GRUB_DISTRIBUTOR lines are left unchanged).
If *keepDistributor* is unset or false, then GRUB_DISTRIBUTOR
If *keep_distributor* is unset or false, then GRUB_DISTRIBUTOR
is always updated to set this value.
:return:
"""
@ -230,11 +230,11 @@ def modify_grub_default(partitions, root_mount_point, distributor):
have_kernel_cmd = True
elif (lines[i].startswith("#GRUB_DISTRIBUTOR")
or lines[i].startswith("GRUB_DISTRIBUTOR")):
if libcalamares.job.configuration.get("keepDistributor", False):
if libcalamares.job.configuration.get("keep_distributor", False):
lines[i] = distributor_line
have_distributor_line = True
else:
# We're not updating because of *keepDistributor*, but if
# We're not updating because of *keep_distributor*, but if
# this was a comment line, then it's still not been set.
have_distributor_line = have_distributor_line or not lines[i].startswith("#")
# If btrfs or f2fs is used, don't save default

View File

@ -2,7 +2,7 @@
# SPDX-License-Identifier: CC0-1.0
---
overwrite: true
keepDistributor: false
keep_distributor: false
defaults:
GRUB_TIMEOUT: 5
GRUB_DEFAULT: "saved"

View File

@ -3,7 +3,7 @@
---
overwrite: true
prefer_grub_d: true # But it doesn't exist
keepDistributor: false
keep_distributor: false
defaults:
GRUB_TIMEOUT: 5
GRUB_DEFAULT: "saved"

View File

@ -3,7 +3,7 @@
---
overwrite: true
prefer_grub_d: true
keepDistributor: false
keep_distributor: false
defaults:
GRUB_TIMEOUT: 5
GRUB_DEFAULT: "saved"