On 20.3.2013 09:15, Cristian Rodríguez wrote:
To support MODULES_LOADED_ON_BOOT systemd requires to carry a patch for yet another distribution specific hack.
remove this variable and migrate all users to the distribution-agnostic modules-load.d(5) --- etc/sysconfig.kernel-mkinitrd | 10 ---------- mkinitrd.spec | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/etc/sysconfig.kernel-mkinitrd b/etc/sysconfig.kernel-mkinitrd index 89062a8..a958c2a 100644 --- a/etc/sysconfig.kernel-mkinitrd +++ b/etc/sysconfig.kernel-mkinitrd @@ -31,16 +31,6 @@ NO_KMS_IN_INITRD="no" # DOMU_INITRD_MODULES="xennet xenblk"
-## Type: string -## ServiceRestart: boot.loadmodules -# -# This variable contains the list of modules to be loaded -# once the main filesystem is active -# You will find a few default modules for hardware which -# can not be detected automatically. -# -MODULES_LOADED_ON_BOOT="" - ## Type: string ## Default: "" # diff --git a/mkinitrd.spec b/mkinitrd.spec index cebf70e..916fc66 100644 --- a/mkinitrd.spec +++ b/mkinitrd.spec @@ -157,6 +157,22 @@ install -m 644 etc/purge-kernels.service $RPM_BUILD_ROOT/%{_unitdir}/ %service_add_post purge-kernels.service %endif
+ +if [ -f /etc/sysconfig/kernel ]; then + . /etc/sysconfig/kernel + if [ -n "$MODULES_LOADED_ON_BOOT" ]; then + for m in $MODULES_LOADED_ON_BOOT ; do + if [ ! -f "/etc/modules-load.d/$m.conf" ]; then + tmpf=$(mktemp) || exit 1 + echo $m > $tmpf + mv $tmpf /etc/modules-load.d/$m.conf
Why not just store the whole list as /etc/modules-load.d/sysconfig.conf or similar? BTW, the if [ -n "$MODULES_LOADED_ON_BOOT" is not needed, a loop over an empty list has 0 iterations. Michal -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org