All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/14] For review
@ 2009-07-15 16:50 Harald Hoyer
       [not found] ` <1247676646-3837-1-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 18+ messages in thread
From: Harald Hoyer @ 2009-07-15 16:50 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Harald Hoyer

Here the latest patches for review.

Highlights: 
- LVM, LUKS, MD, DM handling can be specified on the command line
- redhat-i18n now supports all languages and keyboard layouts 
  in the generic case and can be set on the kernel command line
- testsuite for booting from degenerated raid arrays
- command line hook scripts should extend initrdargs for later 
  stripping
- generated lvm filters
- info() vinfo() getargs() in dracut-lib

Hans de Goede (3):
  10redhat-i18n: Fix handling of kbd maps which are a symlink
  Make Intel BIOS raid use mdraid instead of dmraid when mdadm 3.0 is
    available
  Fix lvm on top of dmraid

Harald Hoyer (11):
  dracut-lib add getargs()
  dmraid.rules changed comment in header
  change the way init arguments are stripped from the command line
  limit the devices for which lvm vgscan will scan
  remove partitions from raid devices before they are used for
    something else
  add info() and vinfo() to dracut-lib
  add command line parameters to specify exact actions for root
    assembly
  extend TEST-12-RAID-DEG to check for UUID command line parameters
  Makefile: add debug module to the testimage target
  install all /lib/kbd to initramfs, if not host only
  dracut-lib: if "quiet" is specified, do not print info() to console

 Makefile                                        |    2 +-
 dracut.8                                        |   53 ++++++++
 modules.d/10redhat-i18n/install                 |  148 +++++++++++++----------
 modules.d/10redhat-i18n/parse-i18n.sh           |   14 ++
 modules.d/50plymouth/cryptroot-ask.sh           |   28 ++++-
 modules.d/90crypt/cryptroot-ask.sh              |   25 +++-
 modules.d/90crypt/install                       |    1 +
 modules.d/90crypt/parse-crypt.sh                |    6 +
 modules.d/90dmraid/61-dmraid-imsm.rules         |   21 +++
 modules.d/90dmraid/61-dmraid.rules              |    9 +-
 modules.d/90dmraid/dmraid.sh                    |   14 ++-
 modules.d/90dmraid/install                      |    6 +-
 modules.d/90dmraid/parse-dm.sh                  |    5 +
 modules.d/90lvm/64-lvm-vol_id.rules             |    3 +-
 modules.d/90lvm/64-lvm.rules                    |    3 +-
 modules.d/90lvm/install                         |    1 +
 modules.d/90lvm/lvm_scan.sh                     |   27 ++++-
 modules.d/90lvm/parse-lvm.sh                    |    6 +
 modules.d/90mdraid/61-mdadm.rules               |   16 +---
 modules.d/90mdraid/65-md-incremental-imsm.rules |   21 +++
 modules.d/90mdraid/65-md-incremental.rules      |   32 ++++--
 modules.d/90mdraid/install                      |   10 ++-
 modules.d/90mdraid/mdraid_start.sh              |   14 ++-
 modules.d/90mdraid/parse-md.sh                  |   27 ++++
 modules.d/99base/dracut-lib.sh                  |   42 ++++++-
 modules.d/99base/init                           |   14 +--
 test/TEST-12-RAID-DEG/create-root.sh            |    9 ++-
 test/TEST-12-RAID-DEG/test.sh                   |   39 ++++++-
 28 files changed, 471 insertions(+), 125 deletions(-)
 rewrite modules.d/10redhat-i18n/install (62%)
 create mode 100644 modules.d/10redhat-i18n/parse-i18n.sh
 create mode 100755 modules.d/90crypt/parse-crypt.sh
 create mode 100644 modules.d/90dmraid/61-dmraid-imsm.rules
 create mode 100644 modules.d/90dmraid/parse-dm.sh
 create mode 100644 modules.d/90lvm/parse-lvm.sh
 rewrite modules.d/90mdraid/61-mdadm.rules (100%)
 create mode 100644 modules.d/90mdraid/65-md-incremental-imsm.rules
 rewrite modules.d/90mdraid/65-md-incremental.rules (70%)
 create mode 100644 modules.d/90mdraid/parse-md.sh

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 01/14] dracut-lib add getargs()
       [not found] ` <1247676646-3837-1-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2009-07-15 16:50   ` Harald Hoyer
  2009-07-15 16:50   ` [PATCH 02/14] 10redhat-i18n: Fix handling of kbd maps which are a symlink Harald Hoyer
                     ` (12 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Harald Hoyer @ 2009-07-15 16:50 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Harald Hoyer

getargs returns a space seperated list with all values found for a key
on the kernel command line
---
 modules.d/99base/dracut-lib.sh |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index 96ecbb0..a26949c 100644
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -8,6 +8,20 @@ getarg() {
     return 1
 }
 
+getargs() {
+    local o line found
+    [ "$CMDLINE" ] || read CMDLINE </proc/cmdline;
+    for o in $CMDLINE; do
+	[ "$o" = "$1" ] && return 0
+	if [ "${o%%=*}" = "${1%=}" ]; then
+	    echo -n "${o#*=} "; 
+	    found=1;
+	fi
+    done
+    [ -n "$found" ] && return 0
+    return 1
+}
+
 source_all() {
     local f
     [ "$1" ] && [  -d "/$1" ] || return
-- 
1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 02/14] 10redhat-i18n: Fix handling of kbd maps which are a symlink
       [not found] ` <1247676646-3837-1-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  2009-07-15 16:50   ` [PATCH 01/14] dracut-lib add getargs() Harald Hoyer
@ 2009-07-15 16:50   ` Harald Hoyer
  2009-07-15 16:50   ` [PATCH 03/14] Make Intel BIOS raid use mdraid instead of dmraid when mdadm 3.0 is available Harald Hoyer
                     ` (11 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Harald Hoyer @ 2009-07-15 16:50 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Hans de Goede

From: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Some keyboard maps are symlinks to others, we were not handling this
properly, this patch fixes this.
---
 modules.d/10redhat-i18n/install |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/modules.d/10redhat-i18n/install b/modules.d/10redhat-i18n/install
index 3658193..a6dbc07 100755
--- a/modules.d/10redhat-i18n/install
+++ b/modules.d/10redhat-i18n/install
@@ -32,6 +32,14 @@ if [[ -f /etc/sysconfig/keyboard || -f /etc/sysconfig/console/default.kmap ]]; t
         findkeymap $KEYMAP
 
         for FN in $KEYMAPS; do
+            if [ -L $FN ]; then
+		TARGET=$(readlink -f $FN)
+		TG=$(echo $TARGET | sed -e 's/\.gz$//' -e 's/\.bz2$//')
+		LN=$(echo $FN | sed -e 's/\.gz$//' -e 's/\.bz2$//')
+                mkdir -p "$initdir/$(dirname $LN)"
+                ln -s "$TG" "$initdir/$LN"
+                FN=$TARGET
+            fi
             inst $FN
             case $FN in
                 *.gz) gzip -d "$initdir$FN" ;;
-- 
1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 03/14] Make Intel BIOS raid use mdraid instead of dmraid when mdadm 3.0 is available
       [not found] ` <1247676646-3837-1-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  2009-07-15 16:50   ` [PATCH 01/14] dracut-lib add getargs() Harald Hoyer
  2009-07-15 16:50   ` [PATCH 02/14] 10redhat-i18n: Fix handling of kbd maps which are a symlink Harald Hoyer
@ 2009-07-15 16:50   ` Harald Hoyer
       [not found]     ` <1247676646-3837-4-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  2009-07-15 16:50   ` [PATCH 04/14] dmraid.rules changed comment in header Harald Hoyer
                     ` (10 subsequent siblings)
  13 siblings, 1 reply; 18+ messages in thread
From: Harald Hoyer @ 2009-07-15 16:50 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Hans de Goede

From: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Intel BIOS raid is being shifted from dmraid to mdraid because mdraid offers
more features. So if an imsm metadata capable mdadm is present use mdraid
instead of dmraid for isw_raid_member's

This patch also adds code to mdraid_start.sh so that the raidsets
inside the imsm containers get started once udev is done probing
(doing this earlier leads to potentially degraded use of the sets and
 an unwanted resync).
---
 modules.d/90dmraid/61-dmraid-imsm.rules         |   15 +++++++++++++++
 modules.d/90dmraid/install                      |    6 +++++-
 modules.d/90mdraid/65-md-incremental-imsm.rules |   10 ++++++++++
 modules.d/90mdraid/install                      |    8 ++++++--
 modules.d/90mdraid/mdraid_start.sh              |   11 ++++++++++-
 5 files changed, 46 insertions(+), 4 deletions(-)
 create mode 100644 modules.d/90dmraid/61-dmraid-imsm.rules
 create mode 100644 modules.d/90mdraid/65-md-incremental-imsm.rules

diff --git a/modules.d/90dmraid/61-dmraid-imsm.rules b/modules.d/90dmraid/61-dmraid-imsm.rules
new file mode 100644
index 0000000..e06ea3f
--- /dev/null
+++ b/modules.d/90dmraid/61-dmraid-imsm.rules
@@ -0,0 +1,15 @@
+# This file causes block devices with Linux RAID (mdadm) signatures to
+# automatically cause mdadm to be run.
+# See udev(8) for syntax
+
+SUBSYSTEM!="block", GOTO="dm_end"
+ACTION!="add|change", GOTO="dm_end"
+
+ENV{ID_FS_TYPE}=="linux_raid_member", GOTO="dm_end"
+ENV{ID_FS_TYPE}=="isw_raid_member", GOTO="dm_end"
+
+ENV{ID_FS_TYPE}=="*_raid_member", \
+    TEST!="/tmp/.dmraid_scan-%k", \
+    RUN+="/bin/sh -c '>/tmp/.dmraid_scan-%k; /bin/ln -fs /sbin/dmraid_scan /initqueue/dmraid_scan.sh'"
+
+LABEL="dm_end"
diff --git a/modules.d/90dmraid/install b/modules.d/90dmraid/install
index fadaf0f..d8aca57 100755
--- a/modules.d/90dmraid/install
+++ b/modules.d/90dmraid/install
@@ -2,4 +2,8 @@
 dracut_install dmraid
 inst "$moddir/dmraid.sh" /sbin/dmraid_scan
 inst_rules 64-md-raid.rules
-inst_rules "$moddir/61-dmraid.rules"
+if [ ! -x /lib/udev/vol_id ] && mdadm -Q -e imsm /dev/null &> /dev/null; then
+    inst_rules "$moddir/61-dmraid-imsm.rules"
+else
+    inst_rules "$moddir/61-dmraid.rules"
+fi
diff --git a/modules.d/90mdraid/65-md-incremental-imsm.rules b/modules.d/90mdraid/65-md-incremental-imsm.rules
new file mode 100644
index 0000000..7dcdf33
--- /dev/null
+++ b/modules.d/90mdraid/65-md-incremental-imsm.rules
@@ -0,0 +1,10 @@
+# This file causes block devices with Linux RAID (mdadm) signatures to
+# automatically cause mdadm to be run.
+# See udev(8) for syntax
+
+SUBSYSTEM=="block", ACTION=="add", \
+        ENV{ID_FS_TYPE}=="linux_raid_member|isw_raid_member", \
+        TEST!="/tmp/.mdraid_start-%k", \
+	IMPORT{program}="/sbin/mdadm --examine --export $tempnode", \
+	RUN+="/sbin/mdadm -I --no-degraded $env{DEVNAME}", \
+	RUN+="/bin/sh -c '>/tmp/.mdraid_start-%k; /bin/ln -s /sbin/mdraid_start /initqueue/mdraid_start.sh'"
diff --git a/modules.d/90mdraid/install b/modules.d/90mdraid/install
index eef6567..0391957 100755
--- a/modules.d/90mdraid/install
+++ b/modules.d/90mdraid/install
@@ -12,7 +12,11 @@ instmods =drivers/md
 if [ -x /lib/udev/vol_id ]; then
     inst_rules "$moddir/61-mdadm.rules"
 else
-    inst_rules "$moddir/65-md-incremental.rules"
+    if mdadm -Q -e imsm /dev/null &> /dev/null; then
+        inst_rules "$moddir/65-md-incremental-imsm.rules"
+    else
+        inst_rules "$moddir/65-md-incremental.rules"
+    fi
     inst_rules 64-md-raid.rules
 fi
 
@@ -24,4 +28,4 @@ if [ -x  /sbin/mdmon ] ; then
 fi 
 
 inst "$moddir/mdraid_start.sh" /sbin/mdraid_start
-
+inst grep
diff --git a/modules.d/90mdraid/mdraid_start.sh b/modules.d/90mdraid/mdraid_start.sh
index 3475b7e..7293ded 100755
--- a/modules.d/90mdraid/mdraid_start.sh
+++ b/modules.d/90mdraid/mdraid_start.sh
@@ -4,5 +4,14 @@ if $UDEV_QUEUE_EMPTY >/dev/null 2>&1; then
     [ -h "$job" ] && rm -f "$job"
     # run mdadm if udev has settled
     mdadm -IRs
+    # and activate any containers
+    for md in /dev/md?*; do
+        case $md in
+            /dev/md*p*) ;;
+            *)
+                if mdadm --export --detail $md | grep -q container; then
+                    mdadm -IR $md
+                fi
+        esac
+    done
 fi
-
-- 
1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 04/14] dmraid.rules changed comment in header
       [not found] ` <1247676646-3837-1-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
                     ` (2 preceding siblings ...)
  2009-07-15 16:50   ` [PATCH 03/14] Make Intel BIOS raid use mdraid instead of dmraid when mdadm 3.0 is available Harald Hoyer
@ 2009-07-15 16:50   ` Harald Hoyer
  2009-07-15 16:50   ` [PATCH 05/14] change the way init arguments are stripped from the command line Harald Hoyer
                     ` (9 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Harald Hoyer @ 2009-07-15 16:50 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Harald Hoyer

---
 modules.d/90dmraid/61-dmraid-imsm.rules |    4 ++--
 modules.d/90dmraid/61-dmraid.rules      |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules.d/90dmraid/61-dmraid-imsm.rules b/modules.d/90dmraid/61-dmraid-imsm.rules
index e06ea3f..3b3eb7f 100644
--- a/modules.d/90dmraid/61-dmraid-imsm.rules
+++ b/modules.d/90dmraid/61-dmraid-imsm.rules
@@ -1,5 +1,5 @@
-# This file causes block devices with Linux RAID (mdadm) signatures to
-# automatically cause mdadm to be run.
+# This file causes block devices with RAID (dmraid) signatures to
+# automatically cause dmraid to be run.
 # See udev(8) for syntax
 
 SUBSYSTEM!="block", GOTO="dm_end"
diff --git a/modules.d/90dmraid/61-dmraid.rules b/modules.d/90dmraid/61-dmraid.rules
index e8e9d65..c4c1717 100644
--- a/modules.d/90dmraid/61-dmraid.rules
+++ b/modules.d/90dmraid/61-dmraid.rules
@@ -1,5 +1,5 @@
-# This file causes block devices with Linux RAID (mdadm) signatures to
-# automatically cause mdadm to be run.
+# This file causes block devices with RAID (dmraid) signatures to
+# automatically cause dmraid to be run.
 # See udev(8) for syntax
 
 SUBSYSTEM!="block", GOTO="dm_end"
-- 
1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 05/14] change the way init arguments are stripped from the command line
       [not found] ` <1247676646-3837-1-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
                     ` (3 preceding siblings ...)
  2009-07-15 16:50   ` [PATCH 04/14] dmraid.rules changed comment in header Harald Hoyer
@ 2009-07-15 16:50   ` Harald Hoyer
  2009-07-15 16:50   ` [PATCH 06/14] limit the devices for which lvm vgscan will scan Harald Hoyer
                     ` (8 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Harald Hoyer @ 2009-07-15 16:50 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Harald Hoyer

$initrdargs now holds all command line options we want to strip from the
command line. Command line parsers can extend this space separated list.
---
 modules.d/99base/init |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/modules.d/99base/init b/modules.d/99base/init
index 4c90f2b..ae71763 100755
--- a/modules.d/99base/init
+++ b/modules.d/99base/init
@@ -203,16 +203,12 @@ for i in $(export -p); do
 done
 
 initargs=""
+initrdargs="$initrdargs console BOOT_IMAGE rdbreak rdinitdebug rdudevinfo rdudevdebug rdnetdebug rdcopystate rdshell"
+
 for x in "$@"; do
-    [ "${x%%=*}" = "console" ] && continue
-    [ "${x%%=*}" = "BOOT_IMAGE" ] && continue
-    [ "${x%%=*}" = "rdbreak" ] && continue
-    [ "${x%%=*}" = "rdinitdebug" ] && continue
-    [ "${x%%=*}" = "rdudevinfo" ] && continue
-    [ "${x%%=*}" = "rdudevdebug" ] && continue
-    [ "${x%%=*}" = "rdnetdebug" ] && continue
-    [ "${x%%=*}" = "rdcopystate" ] && continue
-    [ "${x%%=*}" = "rdshell" ] && continue
+    for s in $initrdargs; do       
+	[ "${x%%=*}" = $s ] && continue 1
+    done
     initargs="$initargs $x"
 done
 
-- 
1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 06/14] limit the devices for which lvm vgscan will scan
       [not found] ` <1247676646-3837-1-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
                     ` (4 preceding siblings ...)
  2009-07-15 16:50   ` [PATCH 05/14] change the way init arguments are stripped from the command line Harald Hoyer
@ 2009-07-15 16:50   ` Harald Hoyer
  2009-07-15 16:50   ` [PATCH 07/14] remove partitions from raid devices before they are used for something else Harald Hoyer
                     ` (7 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Harald Hoyer @ 2009-07-15 16:50 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Harald Hoyer

Build the filter list and create /etc/lvm/lvm.conf for all LVM_member
devices found by udev.
---
 modules.d/90lvm/lvm_scan.sh |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/modules.d/90lvm/lvm_scan.sh b/modules.d/90lvm/lvm_scan.sh
index cd843aa..489c7a1 100755
--- a/modules.d/90lvm/lvm_scan.sh
+++ b/modules.d/90lvm/lvm_scan.sh
@@ -3,6 +3,25 @@
 if $UDEV_QUEUE_EMPTY >/dev/null 2>&1; then
     [ -h "$job" ] && rm -f "$job"
     # run lvm scan if udev has settled
+
+    [ -d /etc/lvm ] || mkdir -p /etc/lvm
+    # build a list of devices to scan
+    lvmdevs=$(
+	for f in /tmp/.lvm_scan-*; do
+	    [ -e "$f" ] || continue
+	    echo ${f##/tmp/.lvm_scan-}
+	done
+	)
+    {
+	echo 'devices {';
+	echo -n '    filter = [ '
+	for dev in $lvmdevs; do
+	    printf '"a|^/dev/%s$|", ' $dev;
+	done;
+	echo '"r/.*/" ]';
+	echo '}';	  
+    } > /etc/lvm/lvm.conf
+
     lvm vgscan
     lvm vgchange -ay
 fi
-- 
1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 07/14] remove partitions from raid devices before they are used for something else
       [not found] ` <1247676646-3837-1-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
                     ` (5 preceding siblings ...)
  2009-07-15 16:50   ` [PATCH 06/14] limit the devices for which lvm vgscan will scan Harald Hoyer
@ 2009-07-15 16:50   ` Harald Hoyer
       [not found]     ` <1247676646-3837-8-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  2009-07-15 16:50   ` [PATCH 08/14] add info() and vinfo() to dracut-lib Harald Hoyer
                     ` (6 subsequent siblings)
  13 siblings, 1 reply; 18+ messages in thread
From: Harald Hoyer @ 2009-07-15 16:50 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Harald Hoyer

---
 modules.d/90dmraid/61-dmraid-imsm.rules         |    6 ++++++
 modules.d/90dmraid/61-dmraid.rules              |    5 +++++
 modules.d/90dmraid/dmraid.sh                    |    2 +-
 modules.d/90mdraid/61-mdadm.rules               |    5 +++++
 modules.d/90mdraid/65-md-incremental-imsm.rules |    6 ++++++
 modules.d/90mdraid/65-md-incremental.rules      |    5 +++++
 6 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/modules.d/90dmraid/61-dmraid-imsm.rules b/modules.d/90dmraid/61-dmraid-imsm.rules
index 3b3eb7f..6bcf052 100644
--- a/modules.d/90dmraid/61-dmraid-imsm.rules
+++ b/modules.d/90dmraid/61-dmraid-imsm.rules
@@ -12,4 +12,10 @@ ENV{ID_FS_TYPE}=="*_raid_member", \
     TEST!="/tmp/.dmraid_scan-%k", \
     RUN+="/bin/sh -c '>/tmp/.dmraid_scan-%k; /bin/ln -fs /sbin/dmraid_scan /initqueue/dmraid_scan.sh'"
 
+
+ENV{ID_FS_TYPE}=="*_raid_member", \
+    TEST!="/tmp/.dmraid_scan-%k", \
+    ATTR{partition}!="?*", \
+    RUN+="/sbin/partx -d $env{DEVNAME}"
+
 LABEL="dm_end"
diff --git a/modules.d/90dmraid/61-dmraid.rules b/modules.d/90dmraid/61-dmraid.rules
index c4c1717..7a5f9af 100644
--- a/modules.d/90dmraid/61-dmraid.rules
+++ b/modules.d/90dmraid/61-dmraid.rules
@@ -11,4 +11,9 @@ ENV{ID_FS_TYPE}=="*_raid_member", \
     TEST!="/tmp/.dmraid_scan-%k", \
     RUN+="/bin/sh -c '>/tmp/.dmraid_scan-%k; /bin/ln -fs /sbin/dmraid_scan /initqueue/dmraid_scan.sh'"
 
+ENV{ID_FS_TYPE}=="*_raid_member", \
+    TEST!="/tmp/.dmraid_scan-%k", \
+    ATTR{partition}!="?*", \
+    RUN+="/sbin/partx -d $env{DEVNAME}"
+
 LABEL="dm_end"
diff --git a/modules.d/90dmraid/dmraid.sh b/modules.d/90dmraid/dmraid.sh
index 4a14722..f6cb26f 100755
--- a/modules.d/90dmraid/dmraid.sh
+++ b/modules.d/90dmraid/dmraid.sh
@@ -3,6 +3,6 @@
 if $UDEV_QUEUE_EMPTY >/dev/null 2>&1; then
     [ -h "$job" ] && rm -f "$job"
     # run dmraid if udev has settled
-    dmraid -ay -Z
+    dmraid -ay 
 fi
 
diff --git a/modules.d/90mdraid/61-mdadm.rules b/modules.d/90mdraid/61-mdadm.rules
index 18b1627..23c5baf 100644
--- a/modules.d/90mdraid/61-mdadm.rules
+++ b/modules.d/90mdraid/61-mdadm.rules
@@ -12,4 +12,9 @@ ENV{ID_FS_TYPE}=="linux_raid_member", \
     RUN+="/sbin/mdadm -I $env{DEVNAME}", \
     RUN+="/bin/sh -c '>/tmp/.mdraid_start-%k; /bin/ln -s /sbin/mdraid_start /initqueue/mdraid_start.sh'"
 
+ENV{ID_FS_TYPE}=="linux_raid_member", \
+    TEST!="/tmp/.mdraid_start-%k", \
+    ATTR{partition}!="?*", \
+    RUN+="/sbin/partx -d $env{DEVNAME}"
+
 LABEL="raid_end"
diff --git a/modules.d/90mdraid/65-md-incremental-imsm.rules b/modules.d/90mdraid/65-md-incremental-imsm.rules
index 7dcdf33..edef6b0 100644
--- a/modules.d/90mdraid/65-md-incremental-imsm.rules
+++ b/modules.d/90mdraid/65-md-incremental-imsm.rules
@@ -8,3 +8,9 @@ SUBSYSTEM=="block", ACTION=="add", \
 	IMPORT{program}="/sbin/mdadm --examine --export $tempnode", \
 	RUN+="/sbin/mdadm -I --no-degraded $env{DEVNAME}", \
 	RUN+="/bin/sh -c '>/tmp/.mdraid_start-%k; /bin/ln -s /sbin/mdraid_start /initqueue/mdraid_start.sh'"
+
+SUBSYSTEM=="block", ACTION=="add", \
+        ENV{ID_FS_TYPE}=="linux_raid_member|isw_raid_member", \
+        TEST!="/tmp/.mdraid_start-%k", \
+	ATTR{partition}!="?*", \
+	RUN+="/sbin/partx -d $env{DEVNAME}"
diff --git a/modules.d/90mdraid/65-md-incremental.rules b/modules.d/90mdraid/65-md-incremental.rules
index 203b1c9..f679c4b 100644
--- a/modules.d/90mdraid/65-md-incremental.rules
+++ b/modules.d/90mdraid/65-md-incremental.rules
@@ -7,3 +7,8 @@ SUBSYSTEM=="block", ACTION=="add", ENV{ID_FS_TYPE}=="linux_raid_member", \
 	IMPORT{program}="/sbin/mdadm --examine --export $tempnode", \
 	RUN+="/sbin/mdadm -I $env{DEVNAME}", \
 	RUN+="/bin/sh -c '>/tmp/.mdraid_start-%k; /bin/ln -s /sbin/mdraid_start /initqueue/mdraid_start.sh'"
+
+SUBSYSTEM=="block", ACTION=="add", ENV{ID_FS_TYPE}=="linux_raid_member", \
+        TEST!="/tmp/.mdraid_start-%k", \
+	ATTR{partition}!="?*", \
+	RUN+="/sbin/partx -d $env{DEVNAME}"
-- 
1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 08/14] add info() and vinfo() to dracut-lib
       [not found] ` <1247676646-3837-1-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
                     ` (6 preceding siblings ...)
  2009-07-15 16:50   ` [PATCH 07/14] remove partitions from raid devices before they are used for something else Harald Hoyer
@ 2009-07-15 16:50   ` Harald Hoyer
  2009-07-15 16:50   ` [PATCH 09/14] Fix lvm on top of dmraid Harald Hoyer
                     ` (5 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Harald Hoyer @ 2009-07-15 16:50 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Harald Hoyer

- corrected the loglevel for warn()
- prepended with "dracut: " for kmesg to seperate from kernel messages

you can pipe to vinfo() for informational messages
---
 modules.d/99base/dracut-lib.sh |   26 +++++++++++++++++++++++---
 1 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index a26949c..aa808a7 100644
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -29,13 +29,33 @@ source_all() {
 }
 
 die() {
-    printf "<1>FATAL: $1\n" > /dev/kmsg
-    printf "<1>Refusing to continue\n" > /dev/kmsg
+    {
+        echo "<1>dracut: FATAL: $@";
+        echo "<1>dracut: Refusing to continue";
+    } > /dev/kmsg
+
+    {
+        echo "dracut: FATAL: $@";
+        echo "dracut: Refusing to continue";
+    } > /dev/console 
+    
     exit 1
 }
 
 warn() {
-    printf "<1>Warning: $1\n" > /dev/kmsg
+    echo "<4>dracut Warning: $@" > /dev/kmsg
+    echo "dracut Warning: $@" > /dev/console
+}
+
+info() {
+    echo "<6>dracut: $@" > /dev/kmsg
+    echo "dracut: $@" > /dev/console
+}
+
+vinfo() {
+    while read line; do 
+        info $line;
+    done
 }
 
 check_occurances() {
-- 
1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 09/14] Fix lvm on top of dmraid
       [not found] ` <1247676646-3837-1-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
                     ` (7 preceding siblings ...)
  2009-07-15 16:50   ` [PATCH 08/14] add info() and vinfo() to dracut-lib Harald Hoyer
@ 2009-07-15 16:50   ` Harald Hoyer
  2009-07-15 16:50   ` [PATCH 10/14] add command line parameters to specify exact actions for root assembly Harald Hoyer
                     ` (4 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Harald Hoyer @ 2009-07-15 16:50 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Hans de Goede

From: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

The lvm rules were failing to identify PV's on mdraid because
blkid/vol_id has not been run on md raidsets by previous rules.
---
 modules.d/90lvm/64-lvm-vol_id.rules |    3 ++-
 modules.d/90lvm/64-lvm.rules        |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules.d/90lvm/64-lvm-vol_id.rules b/modules.d/90lvm/64-lvm-vol_id.rules
index d3a07c1..faafffa 100644
--- a/modules.d/90lvm/64-lvm-vol_id.rules
+++ b/modules.d/90lvm/64-lvm-vol_id.rules
@@ -7,7 +7,8 @@
 SUBSYSTEM!="block", GOTO="lvm_end"
 ACTION!="add|change", GOTO="lvm_end"
 
-KERNEL=="dm-*", IMPORT{program}="vol_id --export $tempnode"
+KERNEL=="dm-[0-9]*", IMPORT{program}="vol_id --export $tempnode"
+KERNEL=="md[0-9]*|md/*", IMPORT{program}="vol_id --export $tempnode"
 
 ENV{ID_FS_TYPE}=="LVM2_member", \
     TEST!="/tmp/.lvm_scan-%k", \
diff --git a/modules.d/90lvm/64-lvm.rules b/modules.d/90lvm/64-lvm.rules
index 3403020..881eacd 100644
--- a/modules.d/90lvm/64-lvm.rules
+++ b/modules.d/90lvm/64-lvm.rules
@@ -7,7 +7,8 @@
 SUBSYSTEM!="block", GOTO="lvm_end"
 ACTION!="add|change", GOTO="lvm_end"
 
-KERNEL=="dm-*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
+KERNEL=="dm-[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
+KERNEL=="md[0-9]*|md/*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
 
 ENV{ID_FS_TYPE}=="LVM2_member", \
     TEST!="/tmp/.lvm_scan-%k", \
-- 
1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 10/14] add command line parameters to specify exact actions for root assembly
       [not found] ` <1247676646-3837-1-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
                     ` (8 preceding siblings ...)
  2009-07-15 16:50   ` [PATCH 09/14] Fix lvm on top of dmraid Harald Hoyer
@ 2009-07-15 16:50   ` Harald Hoyer
  2009-07-15 16:50   ` [PATCH 11/14] extend TEST-12-RAID-DEG to check for UUID command line parameters Harald Hoyer
                     ` (3 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Harald Hoyer @ 2009-07-15 16:50 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Harald Hoyer

LVM
       rd_NO_LVM
              disable LVM detection

       rd_LVM_VG=<volume group name>
              only activate the volume groups with the given name

crypto LUKS
       rd_NO_LUKS
              disable crypto LUKS detection

       rd_LUKS_UUID=<luks uuid>
              only activate the LUKS partitions with the given UUID

MD
       rd_NO_MD
              disable MD RAID detection

       rd_MD_UUID=<md uuid>
              only activate the raid sets with the given UUID

DMRAID
       rd_NO_DM
              disable DM RAID detection

       rd_DM_UUID=<dmraid uuid>
              only activate the raid sets with the given UUID
---
 dracut.8                                        |   32 +++++++++++++++++++
 modules.d/50plymouth/cryptroot-ask.sh           |   28 +++++++++++++++--
 modules.d/90crypt/cryptroot-ask.sh              |   25 ++++++++++++---
 modules.d/90crypt/install                       |    1 +
 modules.d/90crypt/parse-crypt.sh                |    6 ++++
 modules.d/90dmraid/dmraid.sh                    |   14 ++++++++-
 modules.d/90dmraid/parse-dm.sh                  |    5 +++
 modules.d/90lvm/install                         |    1 +
 modules.d/90lvm/lvm_scan.sh                     |   10 ++++--
 modules.d/90lvm/parse-lvm.sh                    |    6 ++++
 modules.d/90mdraid/61-mdadm.rules               |   21 +------------
 modules.d/90mdraid/65-md-incremental-imsm.rules |   37 +++++++++++++----------
 modules.d/90mdraid/65-md-incremental.rules      |   37 ++++++++++++++--------
 modules.d/90mdraid/install                      |   14 +++++----
 modules.d/90mdraid/mdraid_start.sh              |   13 ++++----
 modules.d/90mdraid/parse-md.sh                  |   27 ++++++++++++++++
 16 files changed, 202 insertions(+), 75 deletions(-)
 create mode 100755 modules.d/90crypt/parse-crypt.sh
 create mode 100644 modules.d/90dmraid/parse-dm.sh
 create mode 100644 modules.d/90lvm/parse-lvm.sh
 rewrite modules.d/90mdraid/61-mdadm.rules (100%)
 rewrite modules.d/90mdraid/65-md-incremental-imsm.rules (80%)
 rewrite modules.d/90mdraid/65-md-incremental.rules (78%)
 create mode 100644 modules.d/90mdraid/parse-md.sh

diff --git a/dracut.8 b/dracut.8
index 4d6ac29..e121bf5 100644
--- a/dracut.8
+++ b/dracut.8
@@ -78,6 +78,38 @@ root filesystem.
 specify e.g. \fI/dev/sda1\fR or
 \fI/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1\fR
 
+.SH LVM
+.TP
+.B rd_NO_LVM
+disable LVM detection
+.TP
+.B rd_LVM_VG=<volume group name>
+only activate the volume groups with the given name
+
+.SH crypto LUKS
+.TP
+.B rd_NO_LUKS
+disable crypto LUKS detection
+.TP
+.B rd_LUKS_UUID=<luks uuid>
+only activate the LUKS partitions with the given UUID
+
+.SH MD
+.TP
+.B rd_NO_MD
+disable MD RAID detection
+.TP
+.B rd_MD_UUID=<md uuid>
+only activate the raid sets with the given UUID
+
+.SH DMRAID
+.TP
+.B rd_NO_DM
+disable DM RAID detection
+.TP
+.B rd_DM_UUID=<dmraid uuid>
+only activate the raid sets with the given UUID
+
 .SH DHCP
 .TP
 .B root=dhcp
diff --git a/modules.d/50plymouth/cryptroot-ask.sh b/modules.d/50plymouth/cryptroot-ask.sh
index 2d0f357..75c6550 100755
--- a/modules.d/50plymouth/cryptroot-ask.sh
+++ b/modules.d/50plymouth/cryptroot-ask.sh
@@ -9,13 +9,33 @@
 # we already asked for this device
 [ -f /tmp/cryptroot-asked-$2 ] && exit 0
 
-# flock against other interactive activities
-{ flock -s 9; 
-/bin/plymouth ask-for-password --prompt "$1 is password protected" --command="/sbin/cryptsetup luksOpen -T1 $1 $2"
-} 9>/.console.lock
+. /lib/dracut-lib.sh
+LUKS=$(getargs rd_LUKS_UUID=)
+ask=1
+
+if [ -n "$LUKS" ]; then
+    ask=0
+    for luks in $LUKS; do
+	if [ "${2##$luks}" != "$2" ]; then
+	    ask=1
+	fi
+    done
+fi
+
+if [ $ask -gt 0 ]; then
+    # flock against other interactive activities
+    { flock -s 9; 
+	/bin/plymouth ask-for-password \
+	    --prompt "$1 is password protected" \
+	    --command="/sbin/cryptsetup luksOpen -T1 $1 $2"
+    } 9>/.console.lock
+fi
 
 # mark device as asked
 >> /tmp/cryptroot-asked-$2
 
+unset LUKS
+unset ask
+unset luks
 exit 0
 
diff --git a/modules.d/90crypt/cryptroot-ask.sh b/modules.d/90crypt/cryptroot-ask.sh
index d87c2ea..5b5d895 100755
--- a/modules.d/90crypt/cryptroot-ask.sh
+++ b/modules.d/90crypt/cryptroot-ask.sh
@@ -9,11 +9,26 @@
 # we already asked for this device
 [ -f /tmp/cryptroot-asked-$2 ] && exit 0
 
-# flock against other interactive activities
-{ flock -s 9; 
-    echo -n "$1 is password protected " 
-    /sbin/cryptsetup luksOpen -T1 $1 $2
-} 9>/.console.lock
+. /lib/dracut-lib.sh
+LUKS=$(getargs rd_LUKS_UUID=)
+ask=1
+
+if [ -n "$LUKS" ]; then
+    ask=0
+    for luks in $LUKS; do
+	if [ "${2##$luks}" != "$2" ]; then
+	    ask=1
+	fi
+    done
+fi
+
+if [ $ask -gt 0 ]; then
+    # flock against other interactive activities
+    { flock -s 9; 
+	echo -n "$1 is password protected " 
+	/sbin/cryptsetup luksOpen -T1 $1 $2
+    } 9>/.console.lock
+fi
 
 # mark device as asked
 >> /tmp/cryptroot-asked-$2
diff --git a/modules.d/90crypt/install b/modules.d/90crypt/install
index a3a856d..9ffe90e 100755
--- a/modules.d/90crypt/install
+++ b/modules.d/90crypt/install
@@ -3,3 +3,4 @@ inst cryptsetup
 instmods dm_crypt cbc aes sha256 xts
 inst_rules "$moddir/70-luks.rules"
 inst "$moddir"/cryptroot-ask.sh /sbin/cryptroot-ask
+inst_hook cmdline 30 "$moddir/parse-crypt.sh"
diff --git a/modules.d/90crypt/parse-crypt.sh b/modules.d/90crypt/parse-crypt.sh
new file mode 100755
index 0000000..4a39c21
--- /dev/null
+++ b/modules.d/90crypt/parse-crypt.sh
@@ -0,0 +1,6 @@
+initrdargs="$initrdargs rd_NO_LUKS rd_LUKS_UUID" 
+
+if getarg rd_NO_LUKS; then
+    rm -f /etc/udev/rules.d/70-luks.rules
+fi
+
diff --git a/modules.d/90dmraid/dmraid.sh b/modules.d/90dmraid/dmraid.sh
index f6cb26f..f706e57 100755
--- a/modules.d/90dmraid/dmraid.sh
+++ b/modules.d/90dmraid/dmraid.sh
@@ -2,7 +2,19 @@
 
 if $UDEV_QUEUE_EMPTY >/dev/null 2>&1; then
     [ -h "$job" ] && rm -f "$job"
+    DM_RAIDS=$(getargs rd_DM_UUID=)
     # run dmraid if udev has settled
-    dmraid -ay 
+    info "Scanning for dmraid devices $DM_RAIDS"
+    SETS=$(dmraid -c -s)
+    info "Found dmraid sets:"
+    echo $SETS|vinfo
+    for r in $DM_RAIDS; do 
+	for s in $SETS; do 
+	    if [ "${s##$r}" != "$s" ]; then
+		info "Activating $s"
+		dmraid -ay $s | vinfo
+	    fi
+	done
+    done
 fi
 
diff --git a/modules.d/90dmraid/parse-dm.sh b/modules.d/90dmraid/parse-dm.sh
new file mode 100644
index 0000000..a047d2d
--- /dev/null
+++ b/modules.d/90dmraid/parse-dm.sh
@@ -0,0 +1,5 @@
+initrdargs="$initrdargs rd_DM_UUID rd_NO_DM" 
+
+if getarg rd_NO_DM; then
+    rm /etc/udev/rules.d/61-dmraid*.rules
+fi
\ No newline at end of file
diff --git a/modules.d/90lvm/install b/modules.d/90lvm/install
index cba321b..ad5e485 100755
--- a/modules.d/90lvm/install
+++ b/modules.d/90lvm/install
@@ -7,3 +7,4 @@ else
 fi
 
 inst "$moddir/lvm_scan.sh" /sbin/lvm_scan
+inst_hook cmdline 30 "$moddir/parse-lvm.sh"
diff --git a/modules.d/90lvm/lvm_scan.sh b/modules.d/90lvm/lvm_scan.sh
index 489c7a1..81c48c0 100755
--- a/modules.d/90lvm/lvm_scan.sh
+++ b/modules.d/90lvm/lvm_scan.sh
@@ -4,12 +4,14 @@ if $UDEV_QUEUE_EMPTY >/dev/null 2>&1; then
     [ -h "$job" ] && rm -f "$job"
     # run lvm scan if udev has settled
 
+    VGS=$(getargs rd_LVM_VG=)
+
     [ -d /etc/lvm ] || mkdir -p /etc/lvm
     # build a list of devices to scan
     lvmdevs=$(
 	for f in /tmp/.lvm_scan-*; do
 	    [ -e "$f" ] || continue
-	    echo ${f##/tmp/.lvm_scan-}
+	    echo -n "${f##/tmp/.lvm_scan-} "
 	done
 	)
     {
@@ -19,10 +21,12 @@ if $UDEV_QUEUE_EMPTY >/dev/null 2>&1; then
 	    printf '"a|^/dev/%s$|", ' $dev;
 	done;
 	echo '"r/.*/" ]';
+	echo 'types = [ "blkext", 1024 ]'
 	echo '}';	  
     } > /etc/lvm/lvm.conf
 
-    lvm vgscan
-    lvm vgchange -ay
+    info "Scanning devices $lvmdevs for LVM volume groups $VGS"
+    lvm vgscan 2>&1 | vinfo
+    lvm vgchange -ay $VGS 2>&1 | vinfo
 fi
 
diff --git a/modules.d/90lvm/parse-lvm.sh b/modules.d/90lvm/parse-lvm.sh
new file mode 100644
index 0000000..00dba38
--- /dev/null
+++ b/modules.d/90lvm/parse-lvm.sh
@@ -0,0 +1,6 @@
+initrdargs="$initrdargs rd_NO_LVM rd_LVM_VG" 
+
+if getarg rd_NO_LVM; then
+    rm -f /etc/udev/rules.d/64-lvm*.rules
+fi
+
diff --git a/modules.d/90mdraid/61-mdadm.rules b/modules.d/90mdraid/61-mdadm.rules
dissimilarity index 100%
index 23c5baf..87becdc 100644
--- a/modules.d/90mdraid/61-mdadm.rules
+++ b/modules.d/90mdraid/61-mdadm.rules
@@ -1,20 +1 @@
-# This file causes block devices with Linux RAID (mdadm) signatures to
-# automatically cause mdadm to be run.
-# See udev(8) for syntax
-
-SUBSYSTEM!="block", GOTO="raid_end"
-ACTION!="add|change", GOTO="raid_end"
-KERNEL=="md/*", GOTO="raid_end"
-
-KERNEL=="md*", IMPORT{program}="vol_id --export $tempnode"
-ENV{ID_FS_TYPE}=="linux_raid_member", \
-    TEST!="/tmp/.mdraid_start-%k", \
-    RUN+="/sbin/mdadm -I $env{DEVNAME}", \
-    RUN+="/bin/sh -c '>/tmp/.mdraid_start-%k; /bin/ln -s /sbin/mdraid_start /initqueue/mdraid_start.sh'"
-
-ENV{ID_FS_TYPE}=="linux_raid_member", \
-    TEST!="/tmp/.mdraid_start-%k", \
-    ATTR{partition}!="?*", \
-    RUN+="/sbin/partx -d $env{DEVNAME}"
-
-LABEL="raid_end"
+SUBSYSTEM=="block", ACTION=="add|change", KERNEL=="md[0-9]*|md_d[0-9]*|md/*", IMPORT{program}="vol_id --export $tempnode"
diff --git a/modules.d/90mdraid/65-md-incremental-imsm.rules b/modules.d/90mdraid/65-md-incremental-imsm.rules
dissimilarity index 80%
index edef6b0..f6efb56 100644
--- a/modules.d/90mdraid/65-md-incremental-imsm.rules
+++ b/modules.d/90mdraid/65-md-incremental-imsm.rules
@@ -1,16 +1,21 @@
-# This file causes block devices with Linux RAID (mdadm) signatures to
-# automatically cause mdadm to be run.
-# See udev(8) for syntax
-
-SUBSYSTEM=="block", ACTION=="add", \
-        ENV{ID_FS_TYPE}=="linux_raid_member|isw_raid_member", \
-        TEST!="/tmp/.mdraid_start-%k", \
-	IMPORT{program}="/sbin/mdadm --examine --export $tempnode", \
-	RUN+="/sbin/mdadm -I --no-degraded $env{DEVNAME}", \
-	RUN+="/bin/sh -c '>/tmp/.mdraid_start-%k; /bin/ln -s /sbin/mdraid_start /initqueue/mdraid_start.sh'"
-
-SUBSYSTEM=="block", ACTION=="add", \
-        ENV{ID_FS_TYPE}=="linux_raid_member|isw_raid_member", \
-        TEST!="/tmp/.mdraid_start-%k", \
-	ATTR{partition}!="?*", \
-	RUN+="/sbin/partx -d $env{DEVNAME}"
+# This file causes block devices with Linux RAID (mdadm) signatures to
+# automatically cause mdadm to be run.
+# See udev(8) for syntax
+
+ACTION!="add", GOTO="md_inc_end"
+SUBSYSTEM!="block", GOTO="md_inc_end"
+ENV{ID_FS_TYPE}!="linux_raid_member|isw_raid_member", GOTO="md_inc_end"
+
+TEST=="/tmp/.mdraid_start-%k", GOTO="md_inc_end"
+
+IMPORT{program}="/sbin/mdadm --examine --export $tempnode"
+
+# UUID CHECK
+
+LABEL="do_md_inc"
+
+RUN+="/sbin/mdadm -I --no-degraded $env{DEVNAME}", RUN+="/bin/sh -c '>/tmp/.mdraid_start-%k; /bin/ln -s /sbin/mdraid_start /initqueue/mdraid_start.sh'"
+
+ATTR{partition}!="?*", RUN+="/sbin/partx -d $env{DEVNAME}"
+
+LABEL="md_inc_end"
diff --git a/modules.d/90mdraid/65-md-incremental.rules b/modules.d/90mdraid/65-md-incremental.rules
dissimilarity index 78%
index f679c4b..38e7654 100644
--- a/modules.d/90mdraid/65-md-incremental.rules
+++ b/modules.d/90mdraid/65-md-incremental.rules
@@ -1,14 +1,23 @@
-# This file causes block devices with Linux RAID (mdadm) signatures to
-# automatically cause mdadm to be run.
-# See udev(8) for syntax
-
-SUBSYSTEM=="block", ACTION=="add", ENV{ID_FS_TYPE}=="linux_raid_member", \
-        TEST!="/tmp/.mdraid_start-%k", \
-	IMPORT{program}="/sbin/mdadm --examine --export $tempnode", \
-	RUN+="/sbin/mdadm -I $env{DEVNAME}", \
-	RUN+="/bin/sh -c '>/tmp/.mdraid_start-%k; /bin/ln -s /sbin/mdraid_start /initqueue/mdraid_start.sh'"
-
-SUBSYSTEM=="block", ACTION=="add", ENV{ID_FS_TYPE}=="linux_raid_member", \
-        TEST!="/tmp/.mdraid_start-%k", \
-	ATTR{partition}!="?*", \
-	RUN+="/sbin/partx -d $env{DEVNAME}"
+# This file causes block devices with Linux RAID (mdadm) signatures to
+# automatically cause mdadm to be run.
+# See udev(8) for syntax
+
+ACTION!="add", GOTO="md_inc_end"
+SUBSYSTEM!="block", GOTO="md_inc_end"
+ENV{ID_FS_TYPE}!="linux_raid_member", GOTO="md_inc_end"
+
+TEST=="/tmp/.mdraid_start-%k", GOTO="md_inc_end"
+
+IMPORT{program}="/sbin/mdadm --examine --export $tempnode"
+
+# UUID CHECK
+
+LABEL="do_md_inc"
+
+RUN+="/sbin/mdadm -I --no-degraded $env{DEVNAME}"
+
+RUN+="/bin/sh -c '>/tmp/.mdraid_start-%k; /bin/ln -s /sbin/mdraid_start /initqueue/mdraid_start.sh'"
+
+ATTR{partition}!="?*", RUN+="/sbin/partx -d $env{DEVNAME}"
+
+LABEL="md_inc_end"
diff --git a/modules.d/90mdraid/install b/modules.d/90mdraid/install
index 0391957..9c29f77 100755
--- a/modules.d/90mdraid/install
+++ b/modules.d/90mdraid/install
@@ -12,14 +12,16 @@ instmods =drivers/md
 if [ -x /lib/udev/vol_id ]; then
     inst_rules "$moddir/61-mdadm.rules"
 else
-    if mdadm -Q -e imsm /dev/null &> /dev/null; then
-        inst_rules "$moddir/65-md-incremental-imsm.rules"
-    else
-        inst_rules "$moddir/65-md-incremental.rules"
-    fi
     inst_rules 64-md-raid.rules
 fi
 
+if mdadm -Q -e imsm /dev/null &> /dev/null; then
+    inst_rules "$moddir/65-md-incremental-imsm.rules"
+else
+    inst_rules "$moddir/65-md-incremental.rules"
+fi
+
+
 [ -f /etc/mdadm/mdadm.conf ] && inst /etc/mdadm/mdadm.conf /etc/mdadm.conf
 [ -f /etc/mdadm.conf ] && inst /etc/mdadm.conf
 if [ -x  /sbin/mdmon ] ; then
@@ -28,4 +30,4 @@ if [ -x  /sbin/mdmon ] ; then
 fi 
 
 inst "$moddir/mdraid_start.sh" /sbin/mdraid_start
-inst grep
+inst_hook cmdline 30 "$moddir/parse-md.sh"
diff --git a/modules.d/90mdraid/mdraid_start.sh b/modules.d/90mdraid/mdraid_start.sh
index 7293ded..b63709c 100755
--- a/modules.d/90mdraid/mdraid_start.sh
+++ b/modules.d/90mdraid/mdraid_start.sh
@@ -3,15 +3,16 @@
 if $UDEV_QUEUE_EMPTY >/dev/null 2>&1; then
     [ -h "$job" ] && rm -f "$job"
     # run mdadm if udev has settled
-    mdadm -IRs
+    info "Assembling MD RAID arrays"
+
     # and activate any containers
     for md in /dev/md?*; do
         case $md in
-            /dev/md*p*) ;;
-            *)
-                if mdadm --export --detail $md | grep -q container; then
-                    mdadm -IR $md
-                fi
+	    /dev/md*p*) ;;
+	    *)
+		info "Starting MD RAID array $md"
+                mdadm -R $md 2>&1 | vinfo
+                mdadm -IR $md 2>&1 | vinfo
         esac
     done
 fi
diff --git a/modules.d/90mdraid/parse-md.sh b/modules.d/90mdraid/parse-md.sh
new file mode 100644
index 0000000..af89084
--- /dev/null
+++ b/modules.d/90mdraid/parse-md.sh
@@ -0,0 +1,27 @@
+initrdargs="$initrdargs rd_MD_UUID rd_NO_MD" 
+
+if $(getarg rd_NO_MD); then
+    rm /etc/udev/rules.d/65-md-incremental*.rules
+else
+    MD_UUID=$(getargs rd_MD_UUID=)
+
+    # rewrite the md rules to only process the specified raid array
+    if [ -n "$MD_UUID" ]; then
+	for f in /etc/udev/rules.d/65-md-incremental*.rules; do
+	    [ -e "$f" ] || continue
+	    mv $f ${f}.bak 
+	    while read line; do 
+		if [ "${line/UUID CHECK//}" != "$line" ]; then
+		    for uuid in $MD_UUID; do
+			printf 'ENV{MD_UUID}=="%s", GOTO="do_md_inc"\n' $uuid
+		    done;
+ 		    printf 'GOTO="md_inc_end"\n';		
+		else
+		    echo $line; 
+		fi
+	    done < ${f}.bak > $f
+	    rm ${f}.bak 
+	done
+    fi
+fi
+
-- 
1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 11/14] extend TEST-12-RAID-DEG to check for UUID command line parameters
       [not found] ` <1247676646-3837-1-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
                     ` (9 preceding siblings ...)
  2009-07-15 16:50   ` [PATCH 10/14] add command line parameters to specify exact actions for root assembly Harald Hoyer
@ 2009-07-15 16:50   ` Harald Hoyer
  2009-07-15 16:50   ` [PATCH 12/14] Makefile: add debug module to the testimage target Harald Hoyer
                     ` (2 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Harald Hoyer @ 2009-07-15 16:50 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Harald Hoyer

---
 test/TEST-12-RAID-DEG/create-root.sh |    9 +++++++-
 test/TEST-12-RAID-DEG/test.sh        |   39 +++++++++++++++++++++++++++++++--
 2 files changed, 44 insertions(+), 4 deletions(-)

diff --git a/test/TEST-12-RAID-DEG/create-root.sh b/test/TEST-12-RAID-DEG/create-root.sh
index a5398d9..30c9111 100755
--- a/test/TEST-12-RAID-DEG/create-root.sh
+++ b/test/TEST-12-RAID-DEG/create-root.sh
@@ -31,6 +31,13 @@ umount /sysroot && \
 lvm lvchange -a n /dev/dracut/root && \
 cryptsetup luksClose /dev/mapper/dracut_crypt_test && \
 mdadm /dev/md0 --fail /dev/sda2 --remove /dev/sda2 && \
-echo "dracut-root-block-created" >/dev/sda1
+{
+/sbin/mdadm --detail --export /dev/md0 > /tmp/mduuid ;
+. /tmp/mduuid;
+} && \
+{
+echo "dracut-root-block-created" 
+echo MD_UUID=$MD_UUID 
+}> /dev/sda1
 dd if=/dev/zero of=/dev/sda2
 poweroff -f
diff --git a/test/TEST-12-RAID-DEG/test.sh b/test/TEST-12-RAID-DEG/test.sh
index e0a9cbf..2a834d9 100755
--- a/test/TEST-12-RAID-DEG/test.sh
+++ b/test/TEST-12-RAID-DEG/test.sh
@@ -6,12 +6,45 @@ KVERSION=${KVERSION-$(uname -r)}
 # Uncomment this to debug failures
 #DEBUGFAIL="rdinitdebug rdnetdebug"
 
-test_run() {
+client_run() {
+    echo "CLIENT TEST START: $@"
     $testdir/run-qemu -hda root.ext2 -m 256M -nographic \
 	-net none -kernel /boot/vmlinuz-$KVERSION \
-	-append "root=/dev/dracut/root rw quiet console=ttyS0,115200n81 rdshell $DEBUGFAIL" \
+	-append "$@ root=/dev/dracut/root rw quiet console=ttyS0,115200n81 rdshell $DEBUGFAIL " \
 	-initrd initramfs.testing
-    grep -m 1 -q dracut-root-block-success root.ext2 || return 1
+    if ! grep -m 1 -q dracut-root-block-success root.ext2; then
+	echo "CLIENT TEST END: $@ [FAIL]"
+	return 1;
+    fi
+
+    sed -i -e 's#dracut-root-block-success#dracut-root-block-xxxxxxx#' root.ext2
+    echo "CLIENT TEST END: $@ [OK]"
+    return 0
+}
+
+test_run() {
+    eval $(grep --binary-files=text -m 1 MD_UUID root.ext2)
+    echo "MD_UUID=$MD_UUID"
+
+    client_run || return 1
+
+    client_run rd_NO_LVM && return 1
+
+    client_run rd_LVM_VG=failme && return 1
+
+    client_run rd_LVM_VG=dracut || return 1
+
+    client_run rd_LVM_VG=dummy1 rd_LVM_VG=dracut rd_LVM_VG=dummy2 || return 1
+
+    client_run rd_MD_UUID=failme && return 1
+
+    client_run rd_NO_MD && return 1
+
+    client_run rd_MD_UUID=$MD_UUID || return 1
+
+    client_run rd_MD_UUID=dummy1 rd_MD_UUID=$MD_UUID rd_MD_UUID=dummy2 || return 1
+
+    return 0
 }
 
 test_setup() {
-- 
1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 12/14] Makefile: add debug module to the testimage target
       [not found] ` <1247676646-3837-1-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
                     ` (10 preceding siblings ...)
  2009-07-15 16:50   ` [PATCH 11/14] extend TEST-12-RAID-DEG to check for UUID command line parameters Harald Hoyer
@ 2009-07-15 16:50   ` Harald Hoyer
  2009-07-15 16:50   ` [PATCH 13/14] install all /lib/kbd to initramfs, if not host only Harald Hoyer
  2009-07-15 16:50   ` [PATCH 14/14] dracut-lib: if "quiet" is specified, do not print info() to console Harald Hoyer
  13 siblings, 0 replies; 18+ messages in thread
From: Harald Hoyer @ 2009-07-15 16:50 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Harald Hoyer

---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index a021617..9395eca 100644
--- a/Makefile
+++ b/Makefile
@@ -61,5 +61,5 @@ check: all
 	make -C test check
 
 testimage: all
-	./dracut -l -f test-$(shell uname -r).img $(shell uname -r)
+	./dracut -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
 	@echo wrote  test-$(shell uname -r).img 
-- 
1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 13/14] install all /lib/kbd to initramfs, if not host only
       [not found] ` <1247676646-3837-1-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
                     ` (11 preceding siblings ...)
  2009-07-15 16:50   ` [PATCH 12/14] Makefile: add debug module to the testimage target Harald Hoyer
@ 2009-07-15 16:50   ` Harald Hoyer
  2009-07-15 16:50   ` [PATCH 14/14] dracut-lib: if "quiet" is specified, do not print info() to console Harald Hoyer
  13 siblings, 0 replies; 18+ messages in thread
From: Harald Hoyer @ 2009-07-15 16:50 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Harald Hoyer

KEYBOARDTYPE=sun|pc
   will be written to /etc/sysconfig/keyboard in the initramfs

KEYTABLE=<keytable file>
   will be written to /etc/sysconfig/keyboard in the initramfs

SYSFONT= Console font
   will be written to /etc/sysconfig/i18n in the initramfs

SYSFONTACM= Console map.
   will be written to /etc/sysconfig/i18n in the initramfs

UNIMAP= Unicode font map.
   will be written to /etc/sysconfig/i18n in the initramfs

LANG=<locale>
   will be written to /etc/sysconfig/i18n in the initramfs
   LANG= set locale for all categories, can be any two letter ISO
   language code
---
 dracut.8                              |   21 +++++
 modules.d/10redhat-i18n/install       |  156 ++++++++++++++++++---------------
 modules.d/10redhat-i18n/parse-i18n.sh |   14 +++
 3 files changed, 120 insertions(+), 71 deletions(-)
 rewrite modules.d/10redhat-i18n/install (67%)
 create mode 100644 modules.d/10redhat-i18n/parse-i18n.sh

diff --git a/dracut.8 b/dracut.8
index e121bf5..bcf603f 100644
--- a/dracut.8
+++ b/dracut.8
@@ -78,6 +78,27 @@ root filesystem.
 specify e.g. \fI/dev/sda1\fR or
 \fI/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1\fR
 
+.SH I18N
+e.g. LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=de-latin1-nodeadkeys
+.TP
+.B KEYBOARDTYPE=sun|pc
+will be written to /etc/sysconfig/keyboard in the initramfs
+.TP
+.B KEYTABLE=<keytable filename>
+will be written to /etc/sysconfig/keyboard in the initramfs
+.TP
+.B SYSFONT= Console font
+will be written to /etc/sysconfig/i18n in the initramfs
+.TP
+.B SYSFONTACM= Unicode font map
+will be written to /etc/sysconfig/i18n in the initramfs
+.TP
+.B UNIMAP= Unicode font map
+will be written to /etc/sysconfig/i18n in the initramfs
+.TP
+.B LANG=<locale>
+will be written to /etc/sysconfig/i18n in the initramfs
+
 .SH LVM
 .TP
 .B rd_NO_LVM
diff --git a/modules.d/10redhat-i18n/install b/modules.d/10redhat-i18n/install
dissimilarity index 67%
index a6dbc07..cc7608b 100755
--- a/modules.d/10redhat-i18n/install
+++ b/modules.d/10redhat-i18n/install
@@ -1,71 +1,85 @@
-#!/bin/bash
-findkeymap () {
-    local MAP=$1
-    [[ ! -f $MAP ]] && \
-	MAP=$(find /lib/kbd/keymaps -type f -name $MAP -o -name $MAP.\* | head -n1)
-    [[ " $KEYMAPS " = *" $MAP "* ]] && return
-    KEYMAPS="$KEYMAPS $MAP"
-    case $MAP in
-        *.gz) cmd=zgrep;;
-        *.bz2) cmd=bzgrep;;
-        *) cmd=grep ;;
-    esac
-
-    for INCL in $($cmd "^include " $MAP | cut -d' ' -f2 | tr -d '"'); do
-        for FN in $(find /lib/kbd/keymaps -type f -name $INCL\*); do
-            findkeymap $FN
-        done
-    done
-}
-
-# FIXME: i18n stuff isn't really distro-independent :/
-if [[ -f /etc/sysconfig/keyboard || -f /etc/sysconfig/console/default.kmap ]]; then
-    if [ -f /etc/sysconfig/console/default.kmap ]; then
-        KEYMAP=/etc/sysconfig/console/default.kmap
-    else
-        . /etc/sysconfig/keyboard
-        [[ $KEYTABLE && -d /lib/kbd/keymaps ]] && KEYMAP="$KEYTABLE.map"
-    fi
-    if [[ $KEYMAP ]]; then
-        [ -f /etc/sysconfig/keyboard ] && inst /etc/sysconfig/keyboard
-        inst loadkeys
-        findkeymap $KEYMAP
-
-        for FN in $KEYMAPS; do
-            if [ -L $FN ]; then
-		TARGET=$(readlink -f $FN)
-		TG=$(echo $TARGET | sed -e 's/\.gz$//' -e 's/\.bz2$//')
-		LN=$(echo $FN | sed -e 's/\.gz$//' -e 's/\.bz2$//')
-                mkdir -p "$initdir/$(dirname $LN)"
-                ln -s "$TG" "$initdir/$LN"
-                FN=$TARGET
-            fi
-            inst $FN
-            case $FN in
-                *.gz) gzip -d "$initdir$FN" ;;
-                *.bz2) bzip2 -d "$initdir$FN" ;;
-            esac
-        done
-    fi
-fi
-
-if [ -f /etc/sysconfig/i18n ]; then
-    . /etc/sysconfig/i18n
-    inst /etc/sysconfig/i18n
-    [[ $SYSFONT ]] || SYSFONT=latarcyrheb-sun16
-    inst setfont
-
-    for FN in /lib/kbd/consolefonts/$SYSFONT.* ; do
-        inst "$FN"
-        case $FN in
-            *.gz) gzip -d "$initdir$FN" ;;
-            *.bz2) bzip2 -d "$initdir$FN" ;;
-        esac
-    done
-    [[ $SYSFONTACM ]] && inst /lib/kbd/consoletrans/$SYSFONTACM
-    [[ $UNIMAP ]] && inst /lib/kbd/unimaps/$UNIMAP
-fi
-
-dracut_install /lib/udev/console_*
-inst_rules 10-console.rules
-
+#!/bin/bash
+
+findkeymap () {
+    local MAP=$1
+    [[ ! -f $MAP ]] && \
+	MAP=$(find /lib/kbd/keymaps -type f -name $MAP -o -name $MAP.\* | head -n1)
+    [[ " $KEYMAPS " = *" $MAP "* ]] && return
+    KEYMAPS="$KEYMAPS $MAP"
+    case $MAP in
+        *.gz) cmd=zgrep;;
+        *.bz2) cmd=bzgrep;;
+        *) cmd=grep ;;
+    esac
+
+    for INCL in $($cmd "^include " $MAP | cut -d' ' -f2 | tr -d '"'); do
+        for FN in $(find /lib/kbd/keymaps -type f -name $INCL\*); do
+            findkeymap $FN
+        done
+    done
+}
+
+install_local()
+{
+# FIXME: i18n stuff isn't really distro-independent :/
+    if [[ -f /etc/sysconfig/keyboard || -f /etc/sysconfig/console/default.kmap ]]; then
+	if [ -f /etc/sysconfig/console/default.kmap ]; then
+            KEYMAP=/etc/sysconfig/console/default.kmap
+	else
+            . /etc/sysconfig/keyboard
+            [[ $KEYTABLE && -d /lib/kbd/keymaps ]] && KEYMAP="$KEYTABLE.map"
+	fi
+	if [[ $KEYMAP ]]; then
+            [ -f /etc/sysconfig/keyboard ] && inst /etc/sysconfig/keyboard
+            inst loadkeys
+            findkeymap $KEYMAP
+
+            for FN in $KEYMAPS; do
+		if [ -L $FN ]; then
+		    TARGET=$(readlink -f $FN)
+		    TG=$(echo $TARGET | sed -e 's/\.gz$//' -e 's/\.bz2$//')
+		    LN=$(echo $FN | sed -e 's/\.gz$//' -e 's/\.bz2$//')
+                    mkdir -p "$initdir/$(dirname $LN)"
+                    ln -s "$TG" "$initdir/$LN"
+                    FN=$TARGET
+		fi
+		inst $FN
+		case $FN in
+                    *.gz) gzip -d "$initdir$FN" ;;
+                    *.bz2) bzip2 -d "$initdir$FN" ;;
+		esac
+            done
+	fi
+    fi
+
+    if [ -f /etc/sysconfig/i18n ]; then
+	. /etc/sysconfig/i18n
+	inst /etc/sysconfig/i18n
+	[[ $SYSFONT ]] || SYSFONT=latarcyrheb-sun16
+	inst setfont
+
+	for FN in /lib/kbd/consolefonts/$SYSFONT.* ; do
+            inst "$FN"
+            case $FN in
+		*.gz) gzip -d "$initdir$FN" ;;
+		*.bz2) bzip2 -d "$initdir$FN" ;;
+            esac
+	done
+	[[ $SYSFONTACM ]] && inst /lib/kbd/consoletrans/$SYSFONTACM
+	[[ $UNIMAP ]] && inst /lib/kbd/unimaps/$UNIMAP
+    fi
+}
+
+if [[ $hostonly ]]; then 
+    install_local
+else
+    for i in $(find /lib/kbd -type f -print); do
+	dracut_install $i
+    done
+    dracut_install gzip bzip2
+fi
+
+dracut_install /lib/udev/console_* 
+dracut_install setfont loadkeys
+inst_rules 10-console.rules
+inst_hook cmdline 20 "$moddir/parse-i18n.sh"
diff --git a/modules.d/10redhat-i18n/parse-i18n.sh b/modules.d/10redhat-i18n/parse-i18n.sh
new file mode 100644
index 0000000..1bf88d6
--- /dev/null
+++ b/modules.d/10redhat-i18n/parse-i18n.sh
@@ -0,0 +1,14 @@
+inst_key_val()
+{
+    local value
+    value=$(getarg $1)
+    [ -n "$value" ] && printf '%s="%s"\n' $1 $value >> $2
+    initrdargs="$initrdargs $1" 
+}
+mkdir -p /etc/sysconfig
+inst_key_val KEYBOARDTYPE /etc/sysconfig/keyboard
+inst_key_val KEYTABLE /etc/sysconfig/keyboard
+inst_key_val SYSFONT /etc/sysconfig/i18n
+inst_key_val SYSFONTACM /etc/sysconfig/i18n
+inst_key_val UNIMAP /etc/sysconfig/i18n
+inst_key_val LANG /etc/sysconfig/i18n
-- 
1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 14/14] dracut-lib: if "quiet" is specified, do not print info() to console
       [not found] ` <1247676646-3837-1-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
                     ` (12 preceding siblings ...)
  2009-07-15 16:50   ` [PATCH 13/14] install all /lib/kbd to initramfs, if not host only Harald Hoyer
@ 2009-07-15 16:50   ` Harald Hoyer
  13 siblings, 0 replies; 18+ messages in thread
From: Harald Hoyer @ 2009-07-15 16:50 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Harald Hoyer

---
 modules.d/99base/dracut-lib.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index aa808a7..a57780a 100644
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -48,8 +48,10 @@ warn() {
 }
 
 info() {
+    [ "$DRACUT_QUIET" ] || DRACUT_QUIET="x$(getarg quiet)"
     echo "<6>dracut: $@" > /dev/kmsg
-    echo "dracut: $@" > /dev/console
+    [ "$DRACUT_QUIET" != "xquiet" ] && \
+	echo "dracut: $@" > /dev/console
 }
 
 vinfo() {
-- 
1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 07/14] remove partitions from raid devices before they are used for something else
       [not found]     ` <1247676646-3837-8-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2009-07-20 17:31       ` Jacek Danecki
       [not found]         ` <4A64A9DB.6060701-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 18+ messages in thread
From: Jacek Danecki @ 2009-07-20 17:31 UTC (permalink / raw)
  To: Harald Hoyer, initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

Harald Hoyer wrote:
> diff --git a/modules.d/90dmraid/61-dmraid-imsm.rules b/modules.d/90dmraid/61-dmraid-imsm.rules
> index 3b3eb7f..6bcf052 100644
> --- a/modules.d/90dmraid/61-dmraid-imsm.rules
> +++ b/modules.d/90dmraid/61-dmraid-imsm.rules
> @@ -12,4 +12,10 @@ ENV{ID_FS_TYPE}=="*_raid_member", \
>      TEST!="/tmp/.dmraid_scan-%k", \
>      RUN+="/bin/sh -c '>/tmp/.dmraid_scan-%k; /bin/ln -fs /sbin/dmraid_scan /initqueue/dmraid_scan.sh'"
>  
> +
> +ENV{ID_FS_TYPE}=="*_raid_member", \
> +    TEST!="/tmp/.dmraid_scan-%k", \
> +    ATTR{partition}!="?*", \
> +    RUN+="/sbin/partx -d $env{DEVNAME}"

/sbin/partx is missing in image created by dracut-0.5
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 03/14] Make Intel BIOS raid use mdraid instead of dmraid when mdadm 3.0 is available
       [not found]     ` <1247676646-3837-4-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2009-07-20 17:39       ` Jacek Danecki
  0 siblings, 0 replies; 18+ messages in thread
From: Jacek Danecki @ 2009-07-20 17:39 UTC (permalink / raw)
  To: Harald Hoyer; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

Harald Hoyer wrote:
> diff --git a/modules.d/90mdraid/mdraid_start.sh b/modules.d/90mdraid/mdraid_start.sh
> index 3475b7e..7293ded 100755
> --- a/modules.d/90mdraid/mdraid_start.sh
> +++ b/modules.d/90mdraid/mdraid_start.sh
> @@ -4,5 +4,14 @@ if $UDEV_QUEUE_EMPTY >/dev/null 2>&1; then
>      [ -h "$job" ] && rm -f "$job"
>      # run mdadm if udev has settled
>      mdadm -IRs
> +    # and activate any containers
> +    for md in /dev/md?*; do
> +        case $md in
> +            /dev/md*p*) ;;
> +            *)
> +                if mdadm --export --detail $md | grep -q container; then
> +                    mdadm -IR $md

These commands are not executed because /dev/md directory was not created.
In rdshell I've executed:
# rm /tmp/.mdraid_start-sd*
# udevadm trigger

KERNEL[1248110873.408893] add      /devices/virtual/block/md126 (block)
KERNEL[1248110873.408938] add      /devices/virtual/block/md127 (block)
KERNEL[1248110873.408972] change   /devices/virtual/block/md127 (block)

sh-4.0# cat /proc/mdstat 
Personalities : [raid1] 
md127 : inactive sdb[1](S) sda[0](S)
      4514 blocks super external:imsm
       
unused devices: <none>

sh-4.0# ls -l /dev/md*
brw-rw---- 1 0 disk 9, 126 Jul 20 16:56 /dev/md126
brw-rw---- 1 0 disk 9, 127 Jul 20 17:27 /dev/md127

If I run mdadm -IR manually:

sh-4.0# mdadm -IR /dev/md127
md: bind<sdb>
md: bind<sda>
raid1: raid set md126 active with 2 out of 2 mirrors
KERNEL[1248110956.850769] changemd126: detected capacity change from 0 to 10737418240
   /devices/virt md126:ual/block/md126  p1(block)
 p2
KERNEL[1248110956.863417] change   /devices/virtual/block/md126 (block)
KERNEL[1248110956.863656] add      /devices/virtual/blomd: md126 switched to read-write mode.
ck/md126/md126p1 (block)
KERNEL[1248110956.863841] add      /devices/virtual/block/md126/md126p2 (block)
mdadm: Started /dev/md/raid1_0 with 2 devices

sh-4.0# cat /proc/mdstat 
Personalities : [raid1] 
md127 : inactive sdb[1](S) sda[0](S)
      4514 blocks super external:imsm
       
md126 : active (auto-read-only) raid1 sda[1] sdb[0]
      10485760 blocks super external:/md127/0 [2/2] [UU]
      
unused devices: <none>
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 07/14] remove partitions from raid devices before they are used for something else
       [not found]         ` <4A64A9DB.6060701-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2009-07-21  9:32           ` Harald Hoyer
  0 siblings, 0 replies; 18+ messages in thread
From: Harald Hoyer @ 2009-07-21  9:32 UTC (permalink / raw)
  To: Jacek Danecki; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

[-- Attachment #1: Type: text/plain, Size: 749 bytes --]

On 07/20/2009 07:31 PM, Jacek Danecki wrote:
> Harald Hoyer wrote:
>> diff --git a/modules.d/90dmraid/61-dmraid-imsm.rules
>> b/modules.d/90dmraid/61-dmraid-imsm.rules
>> index 3b3eb7f..6bcf052 100644
>> --- a/modules.d/90dmraid/61-dmraid-imsm.rules
>> +++ b/modules.d/90dmraid/61-dmraid-imsm.rules
>> @@ -12,4 +12,10 @@ ENV{ID_FS_TYPE}=="*_raid_member", \
>> TEST!="/tmp/.dmraid_scan-%k", \
>> RUN+="/bin/sh -c '>/tmp/.dmraid_scan-%k; /bin/ln -fs /sbin/dmraid_scan
>> /initqueue/dmraid_scan.sh'"
>>
>> +
>> +ENV{ID_FS_TYPE}=="*_raid_member", \
>> + TEST!="/tmp/.dmraid_scan-%k", \
>> + ATTR{partition}!="?*", \
>> + RUN+="/sbin/partx -d $env{DEVNAME}"
>
> /sbin/partx is missing in image created by dracut-0.5

thx, fixing



[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 3636 bytes --]

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

end of thread, other threads:[~2009-07-21  9:32 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-15 16:50 [PATCH 00/14] For review Harald Hoyer
     [not found] ` <1247676646-3837-1-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-07-15 16:50   ` [PATCH 01/14] dracut-lib add getargs() Harald Hoyer
2009-07-15 16:50   ` [PATCH 02/14] 10redhat-i18n: Fix handling of kbd maps which are a symlink Harald Hoyer
2009-07-15 16:50   ` [PATCH 03/14] Make Intel BIOS raid use mdraid instead of dmraid when mdadm 3.0 is available Harald Hoyer
     [not found]     ` <1247676646-3837-4-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-07-20 17:39       ` Jacek Danecki
2009-07-15 16:50   ` [PATCH 04/14] dmraid.rules changed comment in header Harald Hoyer
2009-07-15 16:50   ` [PATCH 05/14] change the way init arguments are stripped from the command line Harald Hoyer
2009-07-15 16:50   ` [PATCH 06/14] limit the devices for which lvm vgscan will scan Harald Hoyer
2009-07-15 16:50   ` [PATCH 07/14] remove partitions from raid devices before they are used for something else Harald Hoyer
     [not found]     ` <1247676646-3837-8-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-07-20 17:31       ` Jacek Danecki
     [not found]         ` <4A64A9DB.6060701-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2009-07-21  9:32           ` Harald Hoyer
2009-07-15 16:50   ` [PATCH 08/14] add info() and vinfo() to dracut-lib Harald Hoyer
2009-07-15 16:50   ` [PATCH 09/14] Fix lvm on top of dmraid Harald Hoyer
2009-07-15 16:50   ` [PATCH 10/14] add command line parameters to specify exact actions for root assembly Harald Hoyer
2009-07-15 16:50   ` [PATCH 11/14] extend TEST-12-RAID-DEG to check for UUID command line parameters Harald Hoyer
2009-07-15 16:50   ` [PATCH 12/14] Makefile: add debug module to the testimage target Harald Hoyer
2009-07-15 16:50   ` [PATCH 13/14] install all /lib/kbd to initramfs, if not host only Harald Hoyer
2009-07-15 16:50   ` [PATCH 14/14] dracut-lib: if "quiet" is specified, do not print info() to console Harald Hoyer

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.