public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] linux-module/autoload: allow defining multiple modules with custom name
@ 2018-09-12 11:42 claudius.heine.ext
  2018-09-12 12:22 ` Henning Schild
  2018-09-25 17:37 ` Maxim Yu. Osipov
  0 siblings, 2 replies; 4+ messages in thread
From: claudius.heine.ext @ 2018-09-12 11:42 UTC (permalink / raw)
  To: isar-users; +Cc: Claudius Heine

From: Claudius Heine <ch@denx.de>

Currently `AUTOLOAD` only supports binary operation that defines if a
module (with the same name as the recipe) should be loaded or not. This
is very cumbersome to work with if one recipe allows deployment of
multiple modules or if the module name differs from the recipe name.

With this patch `AUTOLOAD` will have a new meaning, it revers to a
bitbake array that contains the module names.

This commit breaks the usage of `AUTOLOAD`. Recipes will need to replace
all their:

    AUTOLOAD = "1"

lines with:

    AUTOLOAD = "${PN}"

And their:

    AUTOLOAD = "0"

lines with:

    AUTOLOAD = ""

in order to migrate to the new interface.

Signed-off-by: Claudius Heine <ch@denx.de>
---
 meta-isar/recipes-kernel/example-module/example-module.bb | 2 +-
 meta/recipes-kernel/linux-module/module.inc               | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/meta-isar/recipes-kernel/example-module/example-module.bb b/meta-isar/recipes-kernel/example-module/example-module.bb
index 6b63ae3..1a4554a 100644
--- a/meta-isar/recipes-kernel/example-module/example-module.bb
+++ b/meta-isar/recipes-kernel/example-module/example-module.bb
@@ -11,7 +11,7 @@ SRC_URI += "file://src"
 
 S = "${WORKDIR}/src"
 
-AUTOLOAD = "1"
+AUTOLOAD = "${PN}"
 
 # Cross-compilation is not supported for the default Debian kernels.
 # For example, package with kernel headers for ARM:
diff --git a/meta/recipes-kernel/linux-module/module.inc b/meta/recipes-kernel/linux-module/module.inc
index 7bc29a8..af7526f 100644
--- a/meta/recipes-kernel/linux-module/module.inc
+++ b/meta/recipes-kernel/linux-module/module.inc
@@ -13,7 +13,7 @@ DEPENDS += "linux-headers-${KERNEL_NAME}"
 
 SRC_URI += "file://debian/"
 
-AUTOLOAD ?= "0"
+AUTOLOAD ?= ""
 
 inherit dpkg
 
@@ -24,7 +24,7 @@ do_prepare_prepend() {
            -e 's/@DESCRIPTION@/${DESCRIPTION}/g' \
         ${S}/debian/changelog ${S}/debian/control
 
-    if [ ${AUTOLOAD} = "1" ]; then
-        echo "echo ${PN} >> /etc/modules" >> ${S}/debian/postinst
-    fi
+    for module in "${AUTOLOAD}"; do
+        echo "echo $module >> /etc/modules" >> ${S}/debian/postinst
+    done
 }
-- 
2.18.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-09-25 17:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-12 11:42 [PATCH] linux-module/autoload: allow defining multiple modules with custom name claudius.heine.ext
2018-09-12 12:22 ` Henning Schild
2018-09-12 12:31   ` Henning Schild
2018-09-25 17:37 ` Maxim Yu. Osipov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox