For review
cover For review
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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1247676646-3837-1-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
PATCH 1/14 dracut-lib add getargs()
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(-)
modules.d/99base/dracut-lib.sh +14 -0
@@ -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
Signature · 6 lines
1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 2/14 10redhat-i18n: Fix handling of kbd maps which are a symlink
In reply to a message not in the archiveFrom: Hans de Goede <[email protected]>
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(-)
modules.d/10redhat-i18n/install +8 -0
@@ -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" ;;
Signature · 6 lines
1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 3/14 Make Intel BIOS raid use mdraid instead of dmraid when mdadm 3.0 is available
In reply to a message not in the archiveFrom: Hans de Goede <[email protected]>
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
modules.d/90dmraid/61-dmraid-imsm.rules new file +15 -0
@@ -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"
modules.d/90dmraid/install +5 -1
@@ -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
modules.d/90mdraid/65-md-incremental-imsm.rules new file +10 -0
@@ -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'"
modules.d/90mdraid/install +6 -2
@@ -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
modules.d/90mdraid/mdraid_start.sh +10 -1
@@ -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 -
Signature · 6 lines
1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1247676646-3837-4-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Re: [PATCH 03/14] Make Intel BIOS raid use mdraid instead of dmraid when mdadm 3.0 is available
Quoted 5 lines · Harald Hoyer
modules.d/90mdraid/mdraid_start.sh +0
-0
modules.d/90mdraid/mdraid_start.sh if $UDEV_QUEUE_EMPTY >/dev/null 2>&1; then · line 13
Quoted 10 lines
modules.d/90mdraid/mdraid_start.sh +7
-0@@ -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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 4/14 dmraid.rules changed comment in header
In reply to a message not in the archive--- modules.d/90dmraid/61-dmraid-imsm.rules | 4 ++-- modules.d/90dmraid/61-dmraid.rules | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
modules.d/90dmraid/61-dmraid-imsm.rules +2 -2
@@ -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"
modules.d/90dmraid/61-dmraid.rules +2 -2
@@ -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"
Signature · 6 lines
1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 5/14 change the way init arguments are stripped from the command line
In reply to a message not in the archive$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(-)
modules.d/99base/init +5 -9
@@ -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
Signature · 6 lines
1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 6/14 limit the devices for which lvm vgscan will scan
In reply to a message not in the archiveBuild 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(-)
modules.d/90lvm/lvm_scan.sh +19 -0
@@ -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
Signature · 6 lines
1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 7/14 remove partitions from raid devices before they are used for something else
In reply to a message not in the archive--- 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(-)
modules.d/90dmraid/61-dmraid-imsm.rules +6 -0
@@ -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"
modules.d/90dmraid/61-dmraid.rules +5 -0
@@ -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"
modules.d/90dmraid/dmraid.sh +1 -1
@@ -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
modules.d/90mdraid/61-mdadm.rules +5 -0
@@ -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"
modules.d/90mdraid/65-md-incremental-imsm.rules +6 -0
@@ -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}"
modules.d/90mdraid/65-md-incremental.rules +5 -0
@@ -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}"
Signature · 6 lines
1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1247676646-3837-8-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Re: [PATCH 07/14] remove partitions from raid devices before they are used for something else
modules.d/90dmraid/61-dmraid-imsm.rules ENV{ID_FS_TYPE}=="*_raid_member", \ · line 19
Quoted 13 lines · Harald Hoyer
modules.d/90dmraid/61-dmraid-imsm.rules +5
-0@@ -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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH 07/14] remove partitions from raid devices before they are used for something else
Quoted 11 lines · Jacek Danecki
Quoted 10 lines · Harald Hoyer
modules.d/90dmraid/61-dmraid-imsm.rules +0
-0@@ -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'"
Quoted 7 lines
modules.d/90dmraid/61-dmraid-imsm.rules ENV{ID_FS_TYPE}=="*_raid_member", \ · line 19
Quoted 5 lines
modules.d/90dmraid/61-dmraid-imsm.rules +5
-0+ +ENV{ID_FS_TYPE}=="*_raid_member", \ + TEST!="/tmp/.dmraid_scan-%k", \ + ATTR{partition}!="?*", \ + RUN+="/sbin/partx -d $env{DEVNAME}"
/sbin/partxis missing in image created by dracut-0.5
thx, fixing
PATCH 8/14 add info() and vinfo() to dracut-lib
In reply to a message not in the archive- 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(-)
modules.d/99base/dracut-lib.sh +23 -3
@@ -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() {
Signature · 6 lines
1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 9/14 Fix lvm on top of dmraid
In reply to a message not in the archiveFrom: Hans de Goede <[email protected]>
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(-)
modules.d/90lvm/64-lvm-vol_id.rules +2 -1
@@ -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", \
modules.d/90lvm/64-lvm.rules +2 -1
@@ -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", \
Signature · 6 lines
1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 10/14 add command line parameters to specify exact actions for root assembly
In reply to a message not in the archiveLVM
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
dracut.8 +32 -0
@@ -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
modules.d/50plymouth/cryptroot-ask.sh +24 -4
@@ -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
modules.d/90crypt/cryptroot-ask.sh +20 -5
@@ -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
modules.d/90crypt/install +1 -0
@@ -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"
modules.d/90crypt/parse-crypt.sh new file +6 -0
@@ -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 +
modules.d/90dmraid/dmraid.sh +13 -1
@@ -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
modules.d/90dmraid/parse-dm.sh new file +5 -0
@@ -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
modules.d/90lvm/install +1 -0
@@ -7,3 +7,4 @@ else fi inst "$moddir/lvm_scan.sh" /sbin/lvm_scan +inst_hook cmdline 30 "$moddir/parse-lvm.sh"
modules.d/90lvm/lvm_scan.sh +7 -3
@@ -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
modules.d/90lvm/parse-lvm.sh new file +6 -0
@@ -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 +
modules.d/90mdraid/61-mdadm.rules +1 -20
@@ -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"
modules.d/90mdraid/65-md-incremental-imsm.rules +21 -16
@@ -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"
modules.d/90mdraid/65-md-incremental.rules +23 -14
@@ -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"
modules.d/90mdraid/install +8 -6
@@ -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"
modules.d/90mdraid/mdraid_start.sh +7 -6
@@ -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
modules.d/90mdraid/parse-md.sh new file +27 -0
@@ -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 +
Signature · 6 lines
1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 11/14 extend TEST-12-RAID-DEG to check for UUID command line parameters
In reply to a message not in the archive--- test/TEST-12-RAID-DEG/create-root.sh | 9 +++++++- test/TEST-12-RAID-DEG/test.sh | 39 +++++++++++++++++++++++++++++++-- 2 files changed, 44 insertions(+), 4 deletions(-)
test/TEST-12-RAID-DEG/create-root.sh +8 -1
@@ -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
test/TEST-12-RAID-DEG/test.sh +36 -3
@@ -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() {
Signature · 6 lines
1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 12/14 Makefile: add debug module to the testimage target
In reply to a message not in the archive--- Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Makefile +1 -1
@@ -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
Signature · 6 lines
1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 13/14 install all /lib/kbd to initramfs, if not host only
In reply to a message not in the archiveKEYBOARDTYPE=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
dracut.8 +21 -0
@@ -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
modules.d/10redhat-i18n/install +85 -71
156 lines not on this page · raw message
modules.d/10redhat-i18n/parse-i18n.sh new file +14 -0
@@ -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
Signature · 6 lines
1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 14/14 dracut-lib: if "quiet" is specified, do not print info() to console
In reply to a message not in the archive--- modules.d/99base/dracut-lib.sh | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
modules.d/99base/dracut-lib.sh +3 -1
@@ -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() {
Signature · 6 lines
1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html