From: "Richard Yao" <ryao@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/genkernel:master commit in: /, defaults/
Date: Thu, 19 Jul 2012 20:12:28 +0000 (UTC) [thread overview]
Message-ID: <1342728419.84e2ab615bd81a902c9ce2cea9cf654205474b0f.ryao@gentoo> (raw)
commit: 84e2ab615bd81a902c9ce2cea9cf654205474b0f
Author: Richard Yao <ryao <AT> cs <DOT> stonybrook <DOT> edu>
AuthorDate: Thu Jul 19 19:59:03 2012 +0000
Commit: Richard Yao <ryao <AT> gentoo <DOT> org>
CommitDate: Thu Jul 19 20:06:59 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=84e2ab61
Support module options set in /etc/module.d, amend cmdline options patch
---
defaults/linuxrc | 12 +-----------
defaults/modprobe | 2 +-
gen_cmdline.sh | 5 +++++
gen_determineargs.sh | 2 ++
gen_initramfs.sh | 37 +++++++++++++++++++++++++++++++++++++
5 files changed, 46 insertions(+), 12 deletions(-)
diff --git a/defaults/linuxrc b/defaults/linuxrc
index 91a3396..6e9e9d8 100755
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -241,23 +241,13 @@ do
nounionfs)
USE_UNIONFS_NORMAL=0
;;
- ## for "module.param[=val]" we creating
- ## /etc/modprobe.d/module.param.conf: "options module param[=val]"
- ## /etc/cmdline/module.param:"param[=val]"
- ## first for CONFIG_MODPROBE_SMALL=n, next for script modprobe
*=*)
case "${x%%=*}" in
*.*)
- y="${x%%[=/]*}"
- echo "options ${x%%.*} ${x#*.}" >"/etc/modprobe.d/$y.conf"
- echo "${x#*.}" >"/etc/cmdline/$y"
+ echo "options ${x%%.*} ${x#*.}" >> "/etc/module_options/${x%%[=/]*}.conf"
;;
esac
;;
- *.*)
- echo "options ${x%%.*} ${x#*.}" >"/etc/modprobe.d/${x%%/*}.conf"
- echo "${x#*.}" >"/etc/cmdline/${x%%/*}"
- ;;
esac
done
diff --git a/defaults/modprobe b/defaults/modprobe
index 1f606bd..6bbe7e4 100755
--- a/defaults/modprobe
+++ b/defaults/modprobe
@@ -112,7 +112,7 @@ modprobe2() {
done
# placing options into x
x="${real_path##*/}"
- x="`cat "/etc/cmdline/${x%.ko*}".* 2>/dev/null`"
+ x="`cat "/etc/module_options/${x%.ko*}".* 2>/dev/null`"
${INSMOD} ${real_path} ${x} > /dev/null 2>&1
ret=$?
if [ ${ret} -eq 0 ]
diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index 184db65..938b1a5 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -75,6 +75,7 @@ longusage() {
echo " --mountboot Mount BOOTDIR automatically if mountable"
echo " --no-mountboot Don't mount BOOTDIR automatically"
echo " --bootdir=<dir> Set the location of the boot-directory, default is /boot"
+ echo " --modprobedir=<dir> Set the location of the modprobe.d-directory, default is /etc/modprobe.d"
echo " Initialization"
echo " --splash=<theme> Enable framebuffer splash using <theme>"
echo " --splash-res=<res> Select splash theme resolutions to install"
@@ -248,6 +249,10 @@ parse_cmdline() {
CMD_BOOTDIR=`parse_opt "$*"`
print_info 2 "CMD_BOOTDIR: ${CMD_BOOTDIR}"
;;
+ --modprobedir=*)
+ CMD_MODPROBEDIR=`parse_opt "$*"`
+ print_info 2 "CMD_MODPROBEDIR: ${CMD_MODPROBEDIR}"
+ ;;
--do-keymap-auto)
CMD_DOKEYMAPAUTO=1
CMD_KEYMAP=1
diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index bbff166..3bc1b29 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -90,6 +90,7 @@ determine_real_args() {
set_config_with_override STRING KERNEL_CROSS_COMPILE CMD_KERNEL_CROSS_COMPILE
set_config_with_override STRING UTILS_CROSS_COMPILE CMD_UTILS_CROSS_COMPILE
set_config_with_override STRING BOOTDIR CMD_BOOTDIR "/boot"
+ set_config_with_override STRING MODPROBEDIR CMD_MODPROBEDIR "/etc/modprobe.d"
set_config_with_override BOOL SPLASH CMD_SPLASH
set_config_with_override BOOL POSTCLEAR CMD_POSTCLEAR
@@ -135,6 +136,7 @@ determine_real_args() {
BOOTDIR=`arch_replace "${BOOTDIR}"`
BOOTDIR=${BOOTDIR%/} # Remove any trailing slash
+ MODPROBEDIR=${MODPROBEDIR%/} # Remove any trailing slash
CACHE_DIR=`arch_replace "${CACHE_DIR}"`
BUSYBOX_BINCACHE=`cache_replace "${BUSYBOX_BINCACHE}"`
diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 43ef155..ac90830 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -577,6 +577,41 @@ append_modules() {
rm -r "${TEMP}/initramfs-modules-${KV}-temp/"
}
+append_modprobed() {
+ local TDIR="${TEMP}/initramfs-modprobe.d-temp"
+ if [ -d "${TDIR}" ]
+ then
+ rm -r "${TDIR}"
+ fi
+
+ mkdir -p "${TDIR}/etc/module_options/"
+
+ # Load module parameters
+ for dir in $(find "${MODPROBEDIR}"/*)
+ do
+ while read x
+ do
+ case "${x}" in
+ options*)
+ module_name="$(echo "$x" | cut -d ' ' -f 2)"
+ [ "${module_name}" != "$(echo)" ] || continue
+ module_options="$(echo "$x" | cut -d ' ' -f 3-)"
+ [ "${module_options}" != "$(echo)" ] || continue
+ echo "${module_options}" >> "${TDIR}/etc/module_options/${module_name}.conf"
+ ;;
+ esac
+ done < "${dir}"
+ done
+
+ cd "${TDIR}"
+ log_future_cpio_content
+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \
+ || gen_die "compressing modprobe.d cpio"
+
+ cd "${TEMP}"
+ rm -rf "${TDIR}" > /dev/null
+}
+
# check for static linked file with objdump
is_static() {
LANG="C" LC_ALL="C" objdump -T $1 2>&1 | grep "not a dynamic object" > /dev/null
@@ -729,6 +764,8 @@ create_initramfs() {
append_data 'splash' "${SPLASH}"
+ append_data 'modprobed'
+
if isTrue "${FIRMWARE}" && [ -n "${FIRMWARE_DIR}" ]
then
append_data 'firmware'
next reply other threads:[~2012-07-19 20:12 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-19 20:12 Richard Yao [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-07-23 23:57 [gentoo-commits] proj/genkernel:master commit in: /, defaults/ Thomas Deutschmann
2019-11-26 13:50 Thomas Deutschmann
2019-07-21 16:26 Thomas Deutschmann
2017-09-04 5:36 Robin H. Johnson
2017-01-08 1:57 Robin H. Johnson
2017-01-07 23:50 Robin H. Johnson
2017-01-02 23:25 Robin H. Johnson
2016-05-16 6:55 Robin H. Johnson
2016-01-05 19:39 Robin H. Johnson
2016-01-05 19:39 Robin H. Johnson
2013-06-06 3:36 [gentoo-commits] proj/genkernel:ryao " Richard Yao
2013-06-03 23:49 ` [gentoo-commits] proj/genkernel:master " Richard Yao
2013-04-25 6:22 Fabio Erculiani
2012-10-16 0:03 Robin H. Johnson
2012-10-03 16:24 Sebastian Pipping
2012-08-30 16:20 Fabio Erculiani
2012-08-12 19:04 Sebastian Pipping
2012-07-24 18:01 Robin H. Johnson
2012-07-24 17:29 Robin H. Johnson
2012-07-24 8:29 Robin H. Johnson
2012-07-09 17:51 Sebastian Pipping
2012-07-08 17:05 Sebastian Pipping
2012-05-17 18:34 Sebastian Pipping
2012-03-17 1:27 Sebastian Pipping
2012-03-17 1:27 Sebastian Pipping
2012-03-17 1:27 Sebastian Pipping
2012-03-17 1:27 Sebastian Pipping
2012-02-20 6:58 Robin H. Johnson
2012-02-09 7:42 Robin H. Johnson
2012-02-06 9:35 Robin H. Johnson
2012-02-06 8:19 Robin H. Johnson
2012-01-14 23:22 Sebastian Pipping
2012-01-13 23:19 Sebastian Pipping
2012-01-13 23:19 Sebastian Pipping
2012-01-06 6:37 Robin H. Johnson
2011-11-08 17:21 Sebastian Pipping
2011-10-08 21:22 Fabio Erculiani
2011-09-13 9:54 Fabio Erculiani
2011-09-11 7:40 Fabio Erculiani
2011-08-30 15:34 Sebastian Pipping
2011-07-27 17:38 Sebastian Pipping
2011-05-31 10:58 Sebastian Pipping
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=1342728419.84e2ab615bd81a902c9ce2cea9cf654205474b0f.ryao@gentoo \
--to=ryao@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox