Skip to contentSkip to conversation

kernel-module-split.bbclass: fix autoloading from postinst script

PATCH In review Andreas Oberritter 2 participants 4 messages Mar 23, 2015 – Mar 24, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel-module-split.bbclass: fix autoloading from postinst script

When using KERNEL_MODULE_AUTOLOAD, autoload was empty, causing "modprobe None" to get appended to the postinst script.

---
 meta/classes/kernel-module-split.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/kernel-module-split.bbclass +1 -1
index 68a23f8..e1a70e6 100644
@@ -148,7 +148,7 @@ python split_kernel_module_packages () {
             postinst = d.getVar('pkg_postinst_%s' % pkg, True)
             if not postinst:
                 bb.fatal("pkg_postinst_%s not defined" % pkg)
-            postinst += d.getVar('autoload_postinst_fragment', True) % autoload
+            postinst += d.getVar('autoload_postinst_fragment', True) % (autoload or basename)
             d.setVar('pkg_postinst_%s' % pkg, postinst)
 
         # Write out any modconf fragment
Signature · 1 line
1.9.1
#1 lore raw
Quoted 2 lines · Andreas Oberritter

When using KERNEL_MODULE_AUTOLOAD, autoload was empty, causing "modprobe None" to get appended to the postinst script.

I stared at this a bit and it looks right to me, but let me ask a question. Are you saying
that KERNEL_MODULE_AUTOLOAD isn't working for anyone ? Or just in a specific configuration ?

I don't have a build to check this at the moment, but I swear my autoloads were working!

Bruce

Quoted 27 lines
---
 meta/classes/kernel-module-split.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/kernel-module-split.bbclass +1 -2
index 68a23f8..e1a70e6 100644
@@ -148,7 +148,7 @@ python split_kernel_module_packages () {
             postinst = d.getVar('pkg_postinst_%s' % pkg, True)
             if not postinst:
                 bb.fatal("pkg_postinst_%s not defined" % pkg)
-            postinst += d.getVar('autoload_postinst_fragment', True) % autoload
+            postinst += d.getVar('autoload_postinst_fragment', True) % (autoload or basename)
             d.setVar('pkg_postinst_%s' % pkg, postinst)
 
         # Write out any modconf fragment
--

1.9.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"
#2 lore raw
Quoted 5 lines · Bruce Ashfield
Quoted 2 lines · Andreas Oberritter

When using KERNEL_MODULE_AUTOLOAD, autoload was empty, causing "modprobe None" to get appended to the postinst script.

Quoted 7 lines

I stared at this a bit and it looks right to me, but let me ask a question. Are you saying
that KERNEL_MODULE_AUTOLOAD isn't working for anyone ? Or just in a specific configuration ?

I don't have a build to check this at the moment, but I swear my autoloads were working!

It already works on boot. This patch only fixes autoloading of modules installed from a package feed, i.e. modprobed by a postinst script.

Regards,
Andreas

Quoted 33 lines

Bruce

Quoted 27 lines
---
 meta/classes/kernel-module-split.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/kernel-module-split.bbclass +1 -2
index 68a23f8..e1a70e6 100644
@@ -148,7 +148,7 @@ python split_kernel_module_packages () {
             postinst = d.getVar('pkg_postinst_%s' % pkg, True)
             if not postinst:
                 bb.fatal("pkg_postinst_%s not defined" % pkg)
-            postinst += d.getVar('autoload_postinst_fragment', True) % autoload
+            postinst += d.getVar('autoload_postinst_fragment', True) % (autoload or basename)
             d.setVar('pkg_postinst_%s' % pkg, postinst)
 
         # Write out any modconf fragment
--

1.9.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#3 lore raw
Quoted 11 lines · Andreas Oberritter
Quoted 10 lines · Bruce Ashfield
Quoted 2 lines · Andreas Oberritter

When using KERNEL_MODULE_AUTOLOAD, autoload was empty, causing "modprobe None" to get appended to the postinst script.

I stared at this a bit and it looks right to me, but let me ask a question. Are you saying
that KERNEL_MODULE_AUTOLOAD isn't working for anyone ? Or just in a specific configuration ?

Quoted 5 lines
Quoted 2 lines

I don't have a build to check this at the moment, but I swear my autoloads were working!

It already works on boot. This patch only fixes autoloading of modules installed from a package feed, i.e. modprobed by a postinst script.

Aha! Right you are, and of course the writing of the modules-load.d is already using basename.

The entire routine could use a bit of cleaning up .. but this fix does in fact look
fine to me.

Quoted 38 lines

Regards,
Andreas

Quoted 33 lines

Bruce

Quoted 27 lines
---
 meta/classes/kernel-module-split.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/kernel-module-split.bbclass +1 -2
index 68a23f8..e1a70e6 100644
@@ -148,7 +148,7 @@ python split_kernel_module_packages () {
             postinst = d.getVar('pkg_postinst_%s' % pkg, True)
             if not postinst:
                 bb.fatal("pkg_postinst_%s not defined" % pkg)
-            postinst += d.getVar('autoload_postinst_fragment', True) % autoload
+            postinst += d.getVar('autoload_postinst_fragment', True) % (autoload or basename)
             d.setVar('pkg_postinst_%s' % pkg, postinst)
 
         # Write out any modconf fragment
--

1.9.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"