[dracut] Ensure the user can remove -f but it stays as the default
This commit is contained in:
parent
119f3fb4bd
commit
8ea29c271f
@ -36,21 +36,14 @@ def run_dracut():
|
||||
:return:
|
||||
"""
|
||||
# Fetch the job configuration
|
||||
cli_options = ["-f"]
|
||||
initramfs_name = libcalamares.job.configuration.get('initramfsName', None)
|
||||
dracut_options = libcalamares.job.configuration.get('options', [])
|
||||
|
||||
# Parse the custom options if there are any
|
||||
for option in dracut_options:
|
||||
# Deduplication check
|
||||
if option not in cli_options:
|
||||
cli_options.append(option)
|
||||
dracut_options = libcalamares.job.configuration.get('options', ['-f'])
|
||||
|
||||
if initramfs_name:
|
||||
cli_options.append(initramfs_name)
|
||||
dracut_options.append(initramfs_name)
|
||||
|
||||
try:
|
||||
target_env_process_output(['dracut'] + cli_options)
|
||||
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