diff --git a/CHANGES-3.3 b/CHANGES-3.3 index 51ea06a325..c1ec9d8cbb 100644 --- a/CHANGES-3.3 +++ b/CHANGES-3.3 @@ -12,12 +12,14 @@ the history of the 3.2 series (2018-05 - 2022-08). This release contains contributions from (alphabetically by first name): - Adriaan de Groot + - Anke Boersma ## Core ## - No core changes yet ## Modules ## - - No module changes yet + - **Dracut** add option to set a configurable kernel name + - **Localeq** & **Keyboard** moved to using Drawer instead of ComboBox # 3.3.0-alpha2 (2022-08-23) diff --git a/src/modules/dracut/dracut.conf b/src/modules/dracut/dracut.conf new file mode 100644 index 0000000000..98d847d9e2 --- /dev/null +++ b/src/modules/dracut/dracut.conf @@ -0,0 +1,10 @@ +# SPDX-FileCopyrightText: no +# SPDX-License-Identifier: CC0-1.0 +# +# Run dracut(8) with an optional kernel name +--- +# Dracut defaults to setting initramfs-.img +# If you want to specify another filename for the resulting image, +# set a custom kernel name, including the path +# +# kernelName: /boot/initramfs-linux.img diff --git a/src/modules/dracut/dracut.schema.yaml b/src/modules/dracut/dracut.schema.yaml new file mode 100644 index 0000000000..503b1a4f09 --- /dev/null +++ b/src/modules/dracut/dracut.schema.yaml @@ -0,0 +1,9 @@ +# SPDX-FileCopyrightText: 2022 Anke Boersma +# SPDX-License-Identifier: GPL-3.0-or-later +--- +$schema: https://json-schema.org/schema# +$id: https://calamares.io/schemas/dracut +additionalProperties: false +type: object +properties: + kernelName: { type: string } diff --git a/src/modules/dracut/main.py b/src/modules/dracut/main.py index 392dd8a519..071406580a 100644 --- a/src/modules/dracut/main.py +++ b/src/modules/dracut/main.py @@ -7,13 +7,14 @@ # SPDX-FileCopyrightText: 2014 Teo Mrnjavac # SPDX-FileCopyrightText: 2017 Alf Gaida # SPDX-FileCopyrightText: 2019 Adriaan de Groot +# SPDX-FileCopyrightText: 2022 Anke Boersma # SPDX-License-Identifier: GPL-3.0-or-later # # Calamares is Free Software: see the License-Identifier above. # import libcalamares -from libcalamares.utils import target_env_call +from libcalamares.utils import check_target_env_call import gettext @@ -33,7 +34,12 @@ def run_dracut(): :return: """ - return target_env_call(['dracut', '-f']) + kernelName = libcalamares.job.configuration['kernelName'] + + if not kernelName: + return check_target_env_call(['dracut', '-f']) + else: + return check_target_env_call(['dracut', '-f', '{}'.format(kernelName)]) def run(): @@ -46,5 +52,5 @@ def run(): return_code = run_dracut() if return_code != 0: - return ( _("Failed to run dracut on the target"), - _("The exit code was {}").format(return_code) ) + return (_("Failed to run dracut on the target"), + _("The exit code was {}").format(return_code))