Default configuration file is always overridden by presets, even if it is the same
From my understanding, _f_config=/etc/mkinitcpio.conf
which is initialized in the beginning :
13 # needed files/directories
14 _f_functions=functions
15 _f_config=mkinitcpio.conf
is thereafter never used, because it is always overridden by ALL_config
or PRESET_config
from the preset file, even if it is the same. At the moment, as far as I understand it, mkinitcpio
is always run with -c
whether or not a non-standard config file is used.
I suggest modifying hooks.preset
to comment out ALL_config
by default :
#ALL_config="/etc/mkinitcpio.conf"
and modifying the following so that if no configuration file is specified, the process goes on with the default.
421 preset_config=${p}_config
422 if [[ ${!preset_config:-$ALL_config} ]]; then
423 preset_cmd+=(-c "${!preset_config:-$ALL_config}")
424 else
425 warning "No configuration file specified. Skipping image \`%s'" "$p"
426 continue
427 fi
That way, to use a different configuration file in linux.preset
, you uncomment and modify the line, otherwise the default is used, which seems more logical than having the default set in two different places.
The idea behind this is that it would make it easier to solve #108 (closed) if it's known whether the config is the default, or has been modified with -c
one way or another.
I'd like to do it myself but I fail to understand while the process stops if there is no configuration file specified in the preset file with the code as it is.