From: "Richard Yao" <ryao@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/genkernel:master commit in: /, doc/, defaults/
Date: Thu, 19 Jul 2012 20:24:32 +0000 (UTC) [thread overview]
Message-ID: <1342729334.6b7408443e17e74662d2105a86b62240f7194ebc.ryao@gentoo> (raw)
commit: 6b7408443e17e74662d2105a86b62240f7194ebc
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:22:14 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=6b740844
Support module options set in /etc/module.d, amend cmdline options patch
---
defaults/linuxrc | 12 +-----------
defaults/modprobe | 2 +-
doc/genkernel.8.txt | 3 +++
gen_cmdline.sh | 5 +++++
gen_determineargs.sh | 2 ++
gen_initramfs.sh | 37 +++++++++++++++++++++++++++++++++++++
6 files changed, 49 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/doc/genkernel.8.txt b/doc/genkernel.8.txt
index 547b7fe..9a96f32 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -221,6 +221,9 @@ LOW-LEVEL COMPILATION OPTIONS
*--bootdir*=<dir>::
Set the location of the boot-directory, default is '/boot'.
+*--modprobedir*=<dir>::
+ Set the location of the modprobe.d-directory, default is '/etc/modprobe.d'.
+
*--makeopts*=<makeopts>::
GNU Make options such as -j2, etc.
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:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-19 20:24 Richard Yao [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-07-16 15:03 [gentoo-commits] proj/genkernel:master commit in: /, doc/, defaults/ Thomas Deutschmann
2020-03-04 0:02 Thomas Deutschmann
2019-10-02 22:45 Thomas Deutschmann
2019-07-29 20:10 Thomas Deutschmann
2012-10-13 22:52 Robin H. Johnson
2012-07-19 20:56 Richard Yao
2012-07-19 20:43 Richard Yao
2011-08-28 9:19 Fabio Erculiani
2011-07-20 19:24 Fabio Erculiani
2011-07-20 15:55 Fabio Erculiani
2011-06-01 1:44 Sebastian Pipping
2011-05-31 13:18 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=1342729334.6b7408443e17e74662d2105a86b62240f7194ebc.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