From: unixmania at gmail.com <unixmania@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 2/5] package/busybox: add modules-load init script
Date: Sat, 18 Apr 2020 19:14:08 -0300 [thread overview]
Message-ID: <20200418221411.1549783-3-unixmania@gmail.com> (raw)
In-Reply-To: <20200418221411.1549783-1-unixmania@gmail.com>
From: Carlos Santos <unixmania@gmail.com>
Use some scripting to mimic the systemd "modules-load" and the OpenRC
"modules" services (load kernel modules based on static configuration).
At the moment package/busybox/S02modules-load is a symlink to the kmod
script, since it works with both versions of the "modprobe" utility.
Signed-off-by: Carlos Santos <unixmania@gmail.com>
package/busybox/
---
CC: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
Changes v1->v2:
- Rename S02modules-load to S11modules-load to ensure that it runs after
S10mdev and S10udev, which both are going to trigger cold-plug events
that may in turn trigger module loading, as observed by Yann E. MORIN.
---
package/busybox/S11modules-load | 1 +
package/busybox/busybox.mk | 12 ++++++++++++
2 files changed, 13 insertions(+)
create mode 120000 package/busybox/S11modules-load
diff --git a/package/busybox/S11modules-load b/package/busybox/S11modules-load
new file mode 120000
index 0000000000..44623673ff
--- /dev/null
+++ b/package/busybox/S11modules-load
@@ -0,0 +1 @@
+../kmod/S11modules-load
\ No newline at end of file
diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk
index 5d5f3e92bd..3512bf77b5 100644
--- a/package/busybox/busybox.mk
+++ b/package/busybox/busybox.mk
@@ -264,6 +264,17 @@ define BUSYBOX_INSTALL_LOGGING_SCRIPT
endef
endif
+# Only install our modules-load script if no other package does it.
+ifeq ($(BR2_PACKAGE_KMOD_TOOLS),)
+define BUSYBOX_INSTALL_MODULES_SCRIPT
+ if grep -q CONFIG_MODPROBE=y $(@D)/.config; \
+ then \
+ $(INSTALL) -m 0755 -D package/busybox/S11modules-load \
+ $(TARGET_DIR)/etc/init.d/S11modules-load; \
+ fi
+endef
+endif
+
# Only install our sysctl scripts if no other package does it.
ifeq ($(BR2_PACKAGE_PROCPS_NG),)
define BUSYBOX_INSTALL_SYSCTL_SCRIPT
@@ -368,6 +379,7 @@ define BUSYBOX_INSTALL_INIT_SYSV
$(BUSYBOX_INSTALL_MDEV_SCRIPT)
$(BUSYBOX_INSTALL_LOGGING_SCRIPT)
$(BUSYBOX_INSTALL_WATCHDOG_SCRIPT)
+ $(BUSYBOX_INSTALL_MODULES_SCRIPT)
$(BUSYBOX_INSTALL_SYSCTL_SCRIPT)
$(BUSYBOX_INSTALL_TELNET_SCRIPT)
endef
--
2.18.2
next prev parent reply other threads:[~2020-04-18 22:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-18 22:14 [Buildroot] [PATCH v2 0/5] Add a kernel module loading mechanism unixmania at gmail.com
2020-04-18 22:14 ` [Buildroot] [PATCH v2 1/5] package/kmod: add modules-load init script unixmania at gmail.com
2020-04-19 10:31 ` Yann E. MORIN
2020-04-21 15:27 ` Matthew Weber
2020-04-18 22:14 ` unixmania at gmail.com [this message]
2020-04-19 10:37 ` [Buildroot] [PATCH v2 2/5] package/busybox: " Yann E. MORIN
2020-04-18 22:14 ` [Buildroot] [PATCH v2 3/5] package/dmraid: use modules-load to load the kernel module unixmania at gmail.com
2020-04-19 10:42 ` Yann E. MORIN
2020-04-19 12:49 ` Thomas Petazzoni
2020-04-19 13:24 ` Yann E. MORIN
2020-04-18 22:14 ` [Buildroot] [PATCH v2 4/5] package/owfs: " unixmania at gmail.com
2020-04-18 22:14 ` [Buildroot] [PATCH v2 5/5] package/ti-sgx-km: " unixmania at gmail.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200418221411.1549783-3-unixmania@gmail.com \
--to=unixmania@gmail.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox