Merge pull request #2401 from lubuntu-team/tsimonq2/dracut-options
[dracut] Add an options setting for additional Dracut parameters
This commit is contained in:
commit
6176fb4d12
@ -8,3 +8,7 @@
|
||||
# set a custom name, including the path
|
||||
#
|
||||
initramfsName: /boot/initramfs-freebsd.img
|
||||
|
||||
# Optional: define a list of strings to be passed as arguments to Dracut
|
||||
# By default, -f is always included
|
||||
options: [ "-f" ]
|
||||
|
@ -7,3 +7,4 @@ additionalProperties: false
|
||||
type: object
|
||||
properties:
|
||||
initramfsName: { type: string }
|
||||
options: { type: array, items: { type: string } }
|
||||
|
@ -35,15 +35,15 @@ def run_dracut():
|
||||
|
||||
:return:
|
||||
"""
|
||||
# Fetch the job configuration
|
||||
initramfs_name = libcalamares.job.configuration.get('initramfsName', None)
|
||||
dracut_options = libcalamares.job.configuration.get('options', ['-f'])
|
||||
|
||||
if initramfs_name:
|
||||
dracut_options.append(initramfs_name)
|
||||
|
||||
try:
|
||||
initramfs_name = libcalamares.job.configuration['initramfsName']
|
||||
target_env_process_output(['dracut', '-f', initramfs_name])
|
||||
except KeyError:
|
||||
try:
|
||||
target_env_process_output(['dracut', '-f'])
|
||||
except subprocess.CalledProcessError as cpe:
|
||||
libcalamares.utils.warning(f"Dracut failed with output: {cpe.output}")
|
||||
return cpe.returncode
|
||||
target_env_process_output(['dracut'] + dracut_options)
|
||||
except subprocess.CalledProcessError as cpe:
|
||||
libcalamares.utils.warning(f"Dracut failed with output: {cpe.output}")
|
||||
return cpe.returncode
|
||||
|
Loading…
Reference in New Issue
Block a user