From: "Amadeusz Żołnowski" <aidecoe-2qtfh70TtYba5EbDDlwbIw@public.gmane.org>
To: "Amadeusz Żołnowski" <aidecoe-2qtfh70TtYba5EbDDlwbIw@public.gmane.org>
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH 2/2] 99base: no modprobe and rmmod if --no-kernel
Date: Mon, 26 Jul 2010 10:17:42 +0200 [thread overview]
Message-ID: <20100726101742.63c1d2c9@aidecoe.name> (raw)
In-Reply-To: <20100726101540.37af47d8-2qtfh70TtYba5EbDDlwbIw@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1482 bytes --]
If we build initramfs without modules, instead of adding modprobe and
rmmod, create symlinks to /bin/true to don't produce unnecessary errors.
Anyway it's a workaround for following desired behaviour:
modprobe tries to insert module only if it's not built into kernel
---
modules.d/99base/install | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/modules.d/99base/install b/modules.d/99base/install
index 6ba9e7e..0fd84ed 100755
--- a/modules.d/99base/install
+++ b/modules.d/99base/install
@@ -1,6 +1,13 @@
#!/bin/bash
-dracut_install mount mknod mkdir modprobe pidof sleep chroot \
- sed ls flock cp mv dmesg rm ln rmmod mkfifo less
+dracut_install mount mknod mkdir pidof sleep chroot \
+ sed ls flock cp mv dmesg rm ln mkfifo less
+if [[ $no_kernel ]]; then
+ inst /bin/true
+ ln -s /bin/true "${initdir}"/sbin/modprobe
+ ln -s /bin/true "${initdir}"/sbin/rmmod
+else
+ dracut_install modprobe rmmod
+fi
if [ ! -e "${initdir}/bin/sh" ]; then
dracut_install bash
(ln -s bash "${initdir}/bin/sh" || :)
@@ -18,7 +25,7 @@ if which switch_root >/dev/null 2>&1; then
dracut_install switch_root
else
inst "$moddir/switch_root" "/sbin/switch_root" \
- || derror "Failed to install switch_root"
+ || derror "Failed to install switch_root"
fi
inst "$moddir/dracut-lib.sh" "/lib/dracut-lib.sh"
inst_hook cmdline 10 "$moddir/parse-root-opts.sh"
--
1.7.1.1
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2010-07-26 8:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-26 8:15 [PATCH 1/2] 10i18n: exit if console already initialized Amadeusz Żołnowski
[not found] ` <20100726101540.37af47d8-2qtfh70TtYba5EbDDlwbIw@public.gmane.org>
2010-07-26 8:17 ` Amadeusz Żołnowski [this message]
2010-08-04 16:31 ` Harald Hoyer
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=20100726101742.63c1d2c9@aidecoe.name \
--to=aidecoe-2qtfh70ttyba5ebddlwbiw@public.gmane.org \
--cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.