From 5b994f85c9cf4601a60bfa6c4dea909f2bcc12d9 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 31 Jan 2022 12:38:13 +0100 Subject: [PATCH] [grubcfg] Keep kernel_params as 'quiet' by default - mark some TODO - tighten up the YAML schema a little bit - when unset, use 'quiet' rather than empty, to preserve compatibility with existing configuration files. SEE #1882 --- src/modules/grubcfg/grubcfg.conf | 8 ++++++-- src/modules/grubcfg/grubcfg.schema.yaml | 3 ++- src/modules/grubcfg/main.py | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/modules/grubcfg/grubcfg.conf b/src/modules/grubcfg/grubcfg.conf index e9adc8acb..afc5e89b8 100644 --- a/src/modules/grubcfg/grubcfg.conf +++ b/src/modules/grubcfg/grubcfg.conf @@ -29,10 +29,14 @@ 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 -# The default kernel params that should always be applied -# This is an array of strings +# The default kernel params that should always be applied. +# This is an array of strings. If it is unset, the default is +# `["quiet"]`. To avoid the default, explicitly set this key +# to an empty list, `[]`. kernel_params: [ "quiet" ] # Default entries to write to /etc/default/grub if it does not exist yet or if diff --git a/src/modules/grubcfg/grubcfg.schema.yaml b/src/modules/grubcfg/grubcfg.schema.yaml index c09c7e7fa..35d63c063 100644 --- a/src/modules/grubcfg/grubcfg.schema.yaml +++ b/src/modules/grubcfg/grubcfg.schema.yaml @@ -7,9 +7,10 @@ additionalProperties: false type: object properties: overwrite: { type: boolean, default: false } + # TODO:3.3:snake-case this key keepDistributor: { type: boolean, default: false } prefer_grub_d: { type: boolean, default: false } - kernel_params: { type: array } + kernel_params: { type: array, items: { type: string } } defaults: type: object additionalProperties: true # Other fields are acceptable diff --git a/src/modules/grubcfg/main.py b/src/modules/grubcfg/main.py index 326e03d53..ec8b01308 100644 --- a/src/modules/grubcfg/main.py +++ b/src/modules/grubcfg/main.py @@ -172,7 +172,7 @@ def modify_grub_default(partitions, root_mount_point, distributor): if partition["fs"] == "zfs" and partition["mountPoint"] == "/": zfs_root_path = get_zfs_root() - kernel_params = libcalamares.job.configuration.get("kernel_params", []) + kernel_params = libcalamares.job.configuration.get("kernel_params", ["quiet"]) # Currently, grub doesn't detect this properly so it must be set manually if zfs_root_path: