From 59f9af330534caa79f8021e22e20d6cff3e2203c Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 21 Feb 2011 17:44:59 +0100 Subject: [PATCH] - fixed i18n unicode setting - set cdrom in kernel polling --- ...-use-sysinit-if-lvm-version-v2.02.65.patch | 92 +++++++++++++++++++ ...ot-dash-syntax-check-module-setup.sh.patch | 22 +++++ 0012-init-set-cdrom-polling-in-kernel.patch | 54 +++++++++++ ...2e271e2730159f042ee7d7fc4aca2e08d28a.patch | 45 +++++++++ ...onsole.font.unicode-vconsole.unicode.patch | 45 +++++++++ dracut.spec | 17 +++- 6 files changed, 273 insertions(+), 2 deletions(-) create mode 100644 0010-lvm-use-sysinit-if-lvm-version-v2.02.65.patch create mode 100644 0011-Makefile-do-not-dash-syntax-check-module-setup.sh.patch create mode 100644 0012-init-set-cdrom-polling-in-kernel.patch create mode 100644 0013-fix-c0a82e271e2730159f042ee7d7fc4aca2e08d28a.patch create mode 100644 0014-vconsole.font.unicode-vconsole.unicode.patch diff --git a/0010-lvm-use-sysinit-if-lvm-version-v2.02.65.patch b/0010-lvm-use-sysinit-if-lvm-version-v2.02.65.patch new file mode 100644 index 0000000..716b239 --- /dev/null +++ b/0010-lvm-use-sysinit-if-lvm-version-v2.02.65.patch @@ -0,0 +1,92 @@ +From b282107fa947817f1fc0bce6ae88b0a83c275847 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 18 Feb 2011 10:58:39 +0100 +Subject: [PATCH] lvm: use --sysinit, if lvm version >= v2.02.65 + +--- + modules.d/90lvm/lvm_scan.sh | 50 +++++++++++++++++++++++++++++------------- + 1 files changed, 34 insertions(+), 16 deletions(-) + +diff --git a/modules.d/90lvm/lvm_scan.sh b/modules.d/90lvm/lvm_scan.sh +index e705d39..7d56fce 100755 +--- a/modules.d/90lvm/lvm_scan.sh ++++ b/modules.d/90lvm/lvm_scan.sh +@@ -45,30 +45,40 @@ if [ ! -e /etc/lvm/lvm.conf ]; then + fi + + check_lvm_ver() { ++ maj=$1; shift; ++ min=$1; shift; ++ ver=$1; shift; + # --poll is supported since 2.2.57 +- [ $1 -lt 2 ] && return 1 +- [ $1 -gt 2 ] && return 0 +- # major is 2 +- [ $2 -lt 2 ] && return 1 +- [ $2 -gt 2 ] && return 0 +- # minor is 2, check for +- # greater or equal 57 +- [ $3 -ge 57 ] && return 0 ++ [ $1 -lt $maj ] && return 1 ++ [ $1 -gt $maj ] && return 0 ++ [ $2 -lt $min ] && return 1 ++ [ $2 -gt $min ] && return 0 ++ [ $3 -ge $ver ] && return 0 + return 1 + } + ++lvm version 2>/dev/null | ( \ ++ IFS=. read maj min sub; ++ maj=${maj##*:}; ++ sub=${sub%% *}; sub=${sub%%\(*}; ++ ) 2>/dev/null ++ + nopoll=$( + # hopefully this output format will never change, e.g.: + # LVM version: 2.02.53(1) (2009-09-25) +- lvm version 2>/dev/null | ( \ +- IFS=. read maj min sub; +- maj=${maj##*:}; +- sub=${sub%% *}; sub=${sub%%\(*}; +- check_lvm_ver $maj $min $sub && \ ++ check_lvm_ver 2 2 57 $maj $min $sub && \ + echo " --poll n "; +- ) 2>/dev/null + ) + ++sysinit=$( ++ # hopefully this output format will never change, e.g.: ++ # LVM version: 2.02.53(1) (2009-09-25) ++ check_lvm_ver 2 2 65 $maj $min $sub && \ ++ echo " --sysinit "; ++) ++ ++export LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES=1 ++ + if [ -n "$SNAPSHOT" ] ; then + # HACK - this should probably be done elsewhere or turned into a function + # Enable read-write LVM locking +@@ -94,13 +104,21 @@ fi + if [ -n "$LVS" ] ; then + info "Scanning devices $lvmdevs for LVM logical volumes $LVS" + lvm lvscan --ignorelockingfailure 2>&1 | vinfo +- lvm lvchange -ay --ignorelockingfailure $nopoll --ignoremonitoring $LVS 2>&1 | vinfo ++ if [ -z "$sysinit" ]; then ++ lvm lvchange -ay --ignorelockingfailure $nopoll --ignoremonitoring $LVS 2>&1 | vinfo ++ else ++ lvm lvchange -ay $sysinit $LVS 2>&1 | vinfo ++ fi + fi + + if [ -z "$LVS" -o -n "$VGS" ]; then + info "Scanning devices $lvmdevs for LVM volume groups $VGS" + lvm vgscan --ignorelockingfailure 2>&1 | vinfo +- lvm vgchange -ay --ignorelockingfailure $nopoll --ignoremonitoring $VGS 2>&1 | vinfo ++ if [ -z "$sysinit" ]; then ++ lvm vgchange -ay --ignorelockingfailure $nopoll --ignoremonitoring $VGS 2>&1 | vinfo ++ else ++ lvm vgchange -ay $sysinit $VGS 2>&1 | vinfo ++ fi + fi + + if [ "$lvmwritten" ]; then diff --git a/0011-Makefile-do-not-dash-syntax-check-module-setup.sh.patch b/0011-Makefile-do-not-dash-syntax-check-module-setup.sh.patch new file mode 100644 index 0000000..5a79127 --- /dev/null +++ b/0011-Makefile-do-not-dash-syntax-check-module-setup.sh.patch @@ -0,0 +1,22 @@ +From 440a4cc2475ff9ed1fc7b52b965dded8a36c9a2d Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 18 Feb 2011 13:11:53 +0100 +Subject: [PATCH] Makefile: do not dash syntax check module-setup.sh + +module-setup.sh is bash syntax, so dash complains about bash contructs +--- + Makefile | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/Makefile b/Makefile +index 9dbe981..ab69c16 100644 +--- a/Makefile ++++ b/Makefile +@@ -95,6 +95,7 @@ gitrpm: dracut-$(VERSION)-$(GITVERSION).tar.bz2 + + check: all + @ret=0;for i in modules.d/99base/init modules.d/*/*.sh; do \ ++ [ "$${i##*/}" = "module-setup.sh" ] && continue; \ + dash -n "$$i" ; ret=$$(($$ret+$$?)); \ + done;exit $$ret + $(MAKE) -C test check diff --git a/0012-init-set-cdrom-polling-in-kernel.patch b/0012-init-set-cdrom-polling-in-kernel.patch new file mode 100644 index 0000000..cc17284 --- /dev/null +++ b/0012-init-set-cdrom-polling-in-kernel.patch @@ -0,0 +1,54 @@ +From 9edf1b206b69a9f6d6d038d333d8b855145ed4d6 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 18 Feb 2011 13:27:31 +0100 +Subject: [PATCH] init: set cdrom polling in kernel + +and reset to -1 after we are done. +--- + modules.d/99base/init | 22 +++++++++++++++++----- + 1 files changed, 17 insertions(+), 5 deletions(-) + +diff --git a/modules.d/99base/init b/modules.d/99base/init +index 0a05e91..b49c87a 100755 +--- a/modules.d/99base/init ++++ b/modules.d/99base/init +@@ -203,15 +203,19 @@ while :; do + # dirty hack for some cdrom drives, + # which report no medium for quiet + # some time. +- if [ ! -e /sys/module/block/parameters/events_dfl_poll_msecs ]; then +- for cdrom in /sys/block/sr*; do +- [ -e "$cdrom" ] || continue ++ for cdrom in /sys/block/sr*; do ++ [ -e "$cdrom" ] || continue ++ if [ -e "$cdrom"/events_poll_msecs ]; then ++ msecs=$(while read a; do echo $a;done < "$cdrom"/events_poll_msecs) ++ [ "$msecs" = "-1" ] && \ ++ echo 1000 > "$cdrom"/events_poll_msecs ++ else + # skip, if cdrom medium was already found + strstr "$(udevadm info --query=env --path=${cdrom##/sys})" \ + ID_CDROM_MEDIA && continue + echo change > "$cdrom/uevent" +- done +- fi ++ fi ++ done + + i=$(($i+1)) + [ $i -gt $RDRETRY ] \ +@@ -220,6 +224,14 @@ done + unset job + unset queuetriggered + ++# reset cdrom polling ++for cdrom in /sys/block/sr*; do ++ [ -e "$cdrom" ] || continue ++ if [ -e "$cdrom"/events_poll_msecs ]; then ++ echo -1 > "$cdrom"/events_poll_msecs ++ fi ++done ++ + # pre-mount happens before we try to mount the root filesystem, + # and happens once. + getarg 'rd.break=pre-mount' 'rdbreak=pre-mount' && emergency_shell -n pre-mount "Break pre-mount" diff --git a/0013-fix-c0a82e271e2730159f042ee7d7fc4aca2e08d28a.patch b/0013-fix-c0a82e271e2730159f042ee7d7fc4aca2e08d28a.patch new file mode 100644 index 0000000..3df9344 --- /dev/null +++ b/0013-fix-c0a82e271e2730159f042ee7d7fc4aca2e08d28a.patch @@ -0,0 +1,45 @@ +From 06e07df001e196a47041bcea65b23f3039e005fa Mon Sep 17 00:00:00 2001 +From: Andrey Borzenkov +Date: Sat, 19 Feb 2011 09:57:55 +0300 +Subject: [PATCH] fix c0a82e271e2730159f042ee7d7fc4aca2e08d28a + +Let inst_key_val usage agree with above patch :) + +Also UNICODE is rather global console property, not font specific +(and if anything, is rather keyboard specific). Let it be just +vconsole.unicode + +Signed-off-by: Andrey Borzenkov +Cc: initramfs@vger.kernel.org +--- + modules.d/10i18n/parse-i18n.sh | 16 ++++++++-------- + 1 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/modules.d/10i18n/parse-i18n.sh b/modules.d/10i18n/parse-i18n.sh +index 61280c0..73dff6e 100755 +--- a/modules.d/10i18n/parse-i18n.sh ++++ b/modules.d/10i18n/parse-i18n.sh +@@ -19,15 +19,15 @@ inst_key_val() { + unset _value + } + +-inst_key_val /etc/vconsole.conf '' KEYMAP vconsole.keymap KEYTABLE +-inst_key_val /etc/vconsole.conf '' FONT vconsole.font SYSFONT +-inst_key_val /etc/vconsole.conf '' FONT_MAP vconsole.font.map CONTRANS +-inst_key_val /etc/vconsole.conf '' FONT_UNIMAP vconsole.font.unimap UNIMAP +-inst_key_val /etc/vconsole.conf 1 UNICODE vconsole.font.unicode +-inst_key_val /etc/vconsole.conf '' EXT_KEYMAP vconsole.keymap.ext ++inst_key_val '' /etc/vconsole.conf KEYMAP vconsole.keymap KEYTABLE ++inst_key_val '' /etc/vconsole.conf FONT vconsole.font SYSFONT ++inst_key_val '' /etc/vconsole.conf FONT_MAP vconsole.font.map CONTRANS ++inst_key_val '' /etc/vconsole.conf FONT_UNIMAP vconsole.font.unimap UNIMAP ++inst_key_val 1 /etc/vconsole.conf UNICODE vconsole.unicode ++inst_key_val '' /etc/vconsole.conf EXT_KEYMAP vconsole.keymap.ext + +-inst_key_val /etc/locale.conf LANG locale.LANG +-inst_key_val /etc/locale.conf LC_ALL locale.LC_ALL ++inst_key_val '' /etc/locale.conf LANG locale.LANG ++inst_key_val '' /etc/locale.conf LC_ALL locale.LC_ALL + + if [ -f /etc/locale.conf ]; then + . /etc/locale.conf diff --git a/0014-vconsole.font.unicode-vconsole.unicode.patch b/0014-vconsole.font.unicode-vconsole.unicode.patch new file mode 100644 index 0000000..6816924 --- /dev/null +++ b/0014-vconsole.font.unicode-vconsole.unicode.patch @@ -0,0 +1,45 @@ +From 94cce410aaa7f4363c0fa48869c81f769ecd1289 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 21 Feb 2011 09:23:27 +0100 +Subject: [PATCH] vconsole.font.unicode -> vconsole.unicode + +--- + dracut.kernel.7.xml | 4 ++-- + modules.d/10i18n/parse-i18n.sh | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/dracut.kernel.7.xml b/dracut.kernel.7.xml +index 21cfecd..aad27e2 100644 +--- a/dracut.kernel.7.xml ++++ b/dracut.kernel.7.xml +@@ -193,7 +193,7 @@ This parameter can be specified multiple times. + + + +- vconsole.font.unicode=<1|0> ++ vconsole.unicode=<1|0> + + + boolean, indicating UTF-8 mode; will be written as UNICODE to /etc/vconsole.conf in the initramfs +@@ -1168,7 +1168,7 @@ rd.znet=ctc,0.0.0600,0.0.0601,0.0.0602,protocol=bar + UNICODE + + +- vconsole.font.unicode ++ vconsole.unicode + + + +diff --git a/modules.d/10i18n/parse-i18n.sh b/modules.d/10i18n/parse-i18n.sh +index 73dff6e..9f47326 100755 +--- a/modules.d/10i18n/parse-i18n.sh ++++ b/modules.d/10i18n/parse-i18n.sh +@@ -23,7 +23,7 @@ inst_key_val '' /etc/vconsole.conf KEYMAP vconsole.keymap KEYTABLE + inst_key_val '' /etc/vconsole.conf FONT vconsole.font SYSFONT + inst_key_val '' /etc/vconsole.conf FONT_MAP vconsole.font.map CONTRANS + inst_key_val '' /etc/vconsole.conf FONT_UNIMAP vconsole.font.unimap UNIMAP +-inst_key_val 1 /etc/vconsole.conf UNICODE vconsole.unicode ++inst_key_val 1 /etc/vconsole.conf UNICODE vconsole.unicode vconsole.font.unicode + inst_key_val '' /etc/vconsole.conf EXT_KEYMAP vconsole.keymap.ext + + inst_key_val '' /etc/locale.conf LANG locale.LANG diff --git a/dracut.spec b/dracut.spec index fcdf4d9..d4bc968 100644 --- a/dracut.spec +++ b/dracut.spec @@ -8,7 +8,7 @@ Name: dracut Version: 008 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Initramfs generator using udev %if 0%{?fedora} @@ -91,7 +91,11 @@ Patch6: 0006-dracut-functions-fixed-installing-libraries-which-li.patch Patch7: 0007-i18n-fixed-config-file-parsing-in-hostonly-mode.patch Patch8: 0008-i18n-default-to-vconsole.font.unicode-1.patch Patch9: 0009-selinux-turn-off-selinux-by-default.patch - +Patch10: 0010-lvm-use-sysinit-if-lvm-version-v2.02.65.patch +Patch11: 0011-Makefile-do-not-dash-syntax-check-module-setup.sh.patch +Patch12: 0012-init-set-cdrom-polling-in-kernel.patch +Patch13: 0013-fix-c0a82e271e2730159f042ee7d7fc4aca2e08d28a.patch +Patch14: 0014-vconsole.font.unicode-vconsole.unicode.patch %description Dracut contains tools to create a bootable initramfs for 2.6 Linux kernels. @@ -164,6 +168,11 @@ This package contains tools to assemble the local initrd and host configuration. %patch7 -p1 %patch8 -p1 %patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 %build make WITH_SWITCH_ROOT=0%{?with_switch_root} @@ -288,6 +297,10 @@ rm -rf $RPM_BUILD_ROOT %dir /var/lib/dracut/overlay %changelog +* Mon Feb 21 2011 Harald Hoyer 008-5 +- fixed i18n unicode setting +- set cdrom in kernel polling + * Fri Feb 18 2011 Harald Hoyer 008-4 - readded dist tag