public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/genkernel:experimental commit in: /, doc/
@ 2011-02-24  9:35 Sebastian Pipping
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Pipping @ 2011-02-24  9:35 UTC (permalink / raw
  To: gentoo-commits

commit:     7ae5e10474ef720a50b6ae01574036beaa017c38
Author:     Peter Hjalmarsson <xake <AT> rymdraket <DOT> net>
AuthorDate: Wed Feb 23 06:10:51 2011 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Thu Feb 24 09:27:10 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=7ae5e104

Introducing MDADM_CONFIG

Make it possible to choose a custom mdadm.conf for your ramdisk.
If not set, no mdadm.conf will be copied, and ramdisk will auto-detect.
This also fixes a regression where genkernel always tried to copy
/etc/mdadm.conf to the ramdisk, failing if it was non-existant.

---
 doc/genkernel.8.txt  |    7 +++++--
 gen_cmdline.sh       |    7 ++++++-
 gen_determineargs.sh |    1 +
 gen_initramfs.sh     |   15 +++++++++++++--
 genkernel.conf       |    7 ++++++-
 5 files changed, 31 insertions(+), 6 deletions(-)

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index cd276d2..e82f1ec 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -246,11 +246,14 @@ INITIALIZATION
     exist.
 
 *--mdadm*::
-    Copy '/etc/mdadm.conf' and mdadm/mdmon binaries to initramfs.
+    Include mdadm/mdmon support.
     Without sys-fs/mdadm[static] installed, this will compile mdadm for you.
 
+*--mdadm-config*=<file>::
+    Use <file> as configfile for MDADM.
+
 *--dmraid*::
-    Add DMRAID support.
+    Include DMRAID support.
 
 *--multipath*::
     Include Multipath support

diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index ebf69ea..506ca3f 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -79,7 +79,8 @@ longusage() {
   echo "				--> 'emerge evms' in the host operating system"
   echo "				first"
   echo "	--lvm			Include LVM support"
-  echo "	--mdadm			Copy /etc/mdadm.conf to initramfs"
+  echo "	--mdadm			Include MDADM/MDMON support"
+  echo "	--mdadm-config=<file>	Use file as mdadm.conf in initramfs"
   echo "	--dmraid		Include DMRAID support"
   echo "	--multipath		Include Multipath support"
   echo "	--iscsi			Include iSCSI support"
@@ -248,6 +249,10 @@ parse_cmdline() {
 			CMD_MDADM=1
 			print_info 2 "CMD_MDADM: $CMD_MDADM"
 			;;
+		--mdadm-config=*)
+			CMD_MDADM_CONFIG=`parse_opt "$*"`
+			print_info 2 "CMD_MDADM_CONFIG: $CMD_MDADM_CONFIG"
+			;;
 		--no-busybox)
 			CMD_BUSYBOX=0
 			print_info 2 "CMD_BUSYBOX: ${CMD_BUSYBOX}"

diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index a55ccec..e680569 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -119,6 +119,7 @@ determine_real_args() {
 	set_config_with_override 1 LUKS                 CMD_LUKS
 	set_config_with_override 1 GPG                  CMD_GPG
 	set_config_with_override 1 MDADM                CMD_MDADM
+	set_config_with_override 2 MDADM_CONFIG         CMD_MDADM_CONFIG
 	set_config_with_override 1 MULTIPATH            CMD_MULTIPATH
 	set_config_with_override 1 FIRMWARE             CMD_FIRMWARE
 	set_config_with_override 2 FIRMWARE_DIR         CMD_FIRMWARE_DIR         "/lib/firmware"

diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 582df2c..2d017fd 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -342,8 +342,19 @@ append_mdadm(){
 	mkdir -p "${TEMP}/initramfs-mdadm-temp/sbin/"
 	if [ "${MDADM}" = '1' ]
 	then
-		cp -a /etc/mdadm.conf "${TEMP}/initramfs-mdadm-temp/etc" \
-			|| gen_die "Could not copy mdadm.conf!"
+		if [ -n "${MDADM_CONFIG}" ]
+		then
+			if [ -f "${MDADM_CONFIG}" ]
+			then
+				cp -a "${MDADM_CONFIG}" "${TEMP}/initramfs-mdadm-temp/etc/mdadm.conf" \
+				|| gen_die "Could not copy mdadm.conf!"
+			else
+				gen_die '${MDADM_CONFIG} does not exist!'
+			fi
+		else
+			print_info 1 '		MDADM: Skipping inclusion of mdadm.conf'
+		fi
+
 		if [ -e '/sbin/mdadm' ] && LC_ALL="C" ldd /sbin/mdadm | grep -q 'not a dynamic executable' \
 		&& [ -e '/sbin/mdmon' ] && LC_ALL="C" ldd /sbin/mdmon | grep -q 'not a dynamic executable'
 		then

diff --git a/genkernel.conf b/genkernel.conf
index 779d71f..d510339 100644
--- a/genkernel.conf
+++ b/genkernel.conf
@@ -70,9 +70,14 @@ USECOLOR="yes"
 # If included, busybox is rebuilt if the cached copy is out of date.
 # BUSYBOX="yes"
 
-# Copy /etc/mdadm.conf, mdadm/mdmon binaries to initramfs.
+# Includes mdadm/mdmon binaries in initramfs.
 # Without sys-fs/mdadm[static] installed, this will build a static mdadm.
 # MDADM="no"
+# Specify a custom mdadm.conf.
+# If not set the ramdisk will be built without a mdadm.conf and will auto-detect
+# arrays during bootup.
+# This should generally not be needed.
+# MDADM_CONFIG=""
 
 # Add Multipath support.
 # MULTIPATH="no"



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

* [gentoo-commits] proj/genkernel:experimental commit in: /, doc/
@ 2011-02-24  9:35 Sebastian Pipping
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Pipping @ 2011-02-24  9:35 UTC (permalink / raw
  To: gentoo-commits

commit:     192d298cf0d2ea26ecc7dc4e172462a81fbdc082
Author:     Sebastian Pipping <sebastian <AT> pipping <DOT> org>
AuthorDate: Thu Feb 24 09:34:48 2011 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Thu Feb 24 09:34:48 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=192d298c

docs: Improve docs on MDADM_CONFIG

---
 doc/genkernel.8.txt |    2 ++
 genkernel.conf      |    8 ++++----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index e82f1ec..a74df82 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -251,6 +251,8 @@ INITIALIZATION
 
 *--mdadm-config*=<file>::
     Use <file> as configfile for MDADM.
+    By default the ramdisk will be built *without* an mdadm.conf and
+    will auto-detect arrays during boot-up.
 
 *--dmraid*::
     Include DMRAID support.

diff --git a/genkernel.conf b/genkernel.conf
index d510339..a5988da 100644
--- a/genkernel.conf
+++ b/genkernel.conf
@@ -73,11 +73,11 @@ USECOLOR="yes"
 # Includes mdadm/mdmon binaries in initramfs.
 # Without sys-fs/mdadm[static] installed, this will build a static mdadm.
 # MDADM="no"
+
 # Specify a custom mdadm.conf.
-# If not set the ramdisk will be built without a mdadm.conf and will auto-detect
-# arrays during bootup.
-# This should generally not be needed.
-# MDADM_CONFIG=""
+# By default the ramdisk will be built *without* an mdadm.conf and will auto-detect
+# arrays during bootup.  Usually, this should not be needed.
+# MDADM_CONFIG="/etc/mdadm.conf"
 
 # Add Multipath support.
 # MULTIPATH="no"



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

end of thread, other threads:[~2011-02-24  9:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-24  9:35 [gentoo-commits] proj/genkernel:experimental commit in: /, doc/ Sebastian Pipping
  -- strict thread matches above, loose matches on Subject: below --
2011-02-24  9:35 Sebastian Pipping

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