[opensuse-kernel] [PATCH] Axe MODULES_LOADED_ON_BOOT and migrate users to modules-load.d(5)
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 + fi + done + fi +fi + +%{remove_and_set -n kernel MODULES_LOADED_ON_BOOT} + %postun %insserv_cleanup %if 0%{?suse_version} >= 1210 -- 1.8.1.4 -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
On 3/20/13 4:15 AM, 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)
It's distribution-agnostic but is a systemd feature, not a general system feature. /etc/init.d/boot.loadmodules, also part of mkinitrd, should be adjusted to parse that when sysvinit is used. The loadmodules.service file masks it for systemd already. I am 100% in favor of getting rid of as many initrd hacks as we can. :) -Jeff
--- 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 + fi + done + fi +fi + +%{remove_and_set -n kernel MODULES_LOADED_ON_BOOT} + %postun %insserv_cleanup %if 0%{?suse_version} >= 1210
-- Jeff Mahoney SUSE Labs
On Wed 20 Mar 2013 09:41:54 AM CLST, Jeff Mahoney wrote:
It's distribution-agnostic but is a systemd feature, not a general system feature. /etc/init.d/boot.loadmodules, also part of mkinitrd, should be adjusted to parse that when sysvinit is used.
well, sysvinit is no longer supported and this patch is intented for future products so we can drop the systemd patch to support MODULE_LOADED_ON_BOOT in the next release boot.loadmodules is never used by systemd either. -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
At Wed, 20 Mar 2013 12:59:25 -0300, Cristian Rodríguez wrote:
On Wed 20 Mar 2013 09:41:54 AM CLST, Jeff Mahoney wrote:
It's distribution-agnostic but is a systemd feature, not a general system feature. /etc/init.d/boot.loadmodules, also part of mkinitrd, should be adjusted to parse that when sysvinit is used.
well, sysvinit is no longer supported and this patch is intented for future products so we can drop the systemd patch to support MODULE_LOADED_ON_BOOT in the next release
boot.loadmodules is never used by systemd either.
Well, the question is why you add such a hack into mkinitrd.spec in the first place? mkinitrd has nothing to do with that stuff. Takashi -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
El mié 20 mar 2013 13:24:42 CLST, Takashi Iwai escribió:
At Wed, 20 Mar 2013 12:59:25 -0300, Cristian Rodríguez wrote:
On Wed 20 Mar 2013 09:41:54 AM CLST, Jeff Mahoney wrote:
It's distribution-agnostic but is a systemd feature, not a general system feature. /etc/init.d/boot.loadmodules, also part of mkinitrd, should be adjusted to parse that when sysvinit is used.
well, sysvinit is no longer supported and this patch is intented for future products so we can drop the systemd patch to support MODULE_LOADED_ON_BOOT in the next release
boot.loadmodules is never used by systemd either.
Well, the question is why you add such a hack into mkinitrd.spec in the first place? mkinitrd has nothing to do with that stuff.
??? mkinitrd is what provides this MODULE_LOADED_ON_BOOT thing, where do you want me to deprecate the sysconfig variable ? -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
At Wed, 20 Mar 2013 13:58:31 -0300, Cristian Rodríguez wrote:
El mié 20 mar 2013 13:24:42 CLST, Takashi Iwai escribió:
At Wed, 20 Mar 2013 12:59:25 -0300, Cristian Rodríguez wrote:
On Wed 20 Mar 2013 09:41:54 AM CLST, Jeff Mahoney wrote:
It's distribution-agnostic but is a systemd feature, not a general system feature. /etc/init.d/boot.loadmodules, also part of mkinitrd, should be adjusted to parse that when sysvinit is used.
well, sysvinit is no longer supported and this patch is intented for future products so we can drop the systemd patch to support MODULE_LOADED_ON_BOOT in the next release
boot.loadmodules is never used by systemd either.
Well, the question is why you add such a hack into mkinitrd.spec in the first place? mkinitrd has nothing to do with that stuff.
??? mkinitrd is what provides this MODULE_LOADED_ON_BOOT thing, where do you want me to deprecate the sysconfig variable ?
Ah, that's the place it introduced. Hrm. It should have been in another package. Now it hits us back... Takashi -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
El mié 20 mar 2013 14:08:54 CLST, Takashi Iwai escribió: Hrm. It should have been in
another package. Now it hits us back...
Yep, too late now. :-P module-init-tools or suse-module-tools would have been a better place. -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
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
El jue 21 mar 2013 13:46:20 CLST, Michal Marek escribió:
Why not just store the whole list as /etc/modules-load.d/sysconfig.conf
That 's another option , however I do prefer the way I did it. - No longer want to load foo module ? simple remove foo.conf do not have to open the file to see what's in. -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
participants (4)
-
Cristian Rodríguez
-
Jeff Mahoney
-
Michal Marek
-
Takashi Iwai