From 0260fa5e6c06629f738a2dc9fd78045164afd64a Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Feb 18 2011 08:49:51 +0000 Subject: - fixed i18n - turned off selinux by default --- diff --git a/0004-dracut-Don-t-suppress-the-modprobe-error-output.patch b/0004-dracut-Don-t-suppress-the-modprobe-error-output.patch new file mode 100644 index 0000000..0ad0016 --- /dev/null +++ b/0004-dracut-Don-t-suppress-the-modprobe-error-output.patch @@ -0,0 +1,45 @@ +From f63c30d89bf4831723cd54b8e39be8c20f278591 Mon Sep 17 00:00:00 2001 +From: maximilian attems +Date: Wed, 16 Feb 2011 14:56:07 +0100 +Subject: [PATCH] dracut: Don't suppress the modprobe error output. + +It happens that either due to newer modprobe or missing depmod +module-init-tools cries. +Suppressing the error ensures for a funny debug search for the user. +Resulting initramfs is generally unbootable due to missing module deps. + +Better use the quiet option of modprobe itself. +It makes it less chatty, but doesn't suppress "fatal" errors. + +Signed-off-by: maximilian attems +--- + dracut-functions | 2 +- + dracut-gencmdline | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/dracut-functions b/dracut-functions +index 9ac0bba..eef8f1e 100755 +--- a/dracut-functions ++++ b/dracut-functions +@@ -670,7 +670,7 @@ install_kmod_with_fw() { + for_each_kmod_dep() { + local func=$1 kmod=$2 cmd modpapth options + shift 2 +- modprobe "$@" --ignore-install --show-depends $kmod 2>/dev/null | \ ++ modprobe "$@" --ignore-install --quiet --show-depends $kmod | \ + while read cmd modpath options; do + [[ $cmd = insmod ]] || continue + $func $modpath +diff --git a/dracut-gencmdline b/dracut-gencmdline +index 76c91ac..90e4906 100755 +--- a/dracut-gencmdline ++++ b/dracut-gencmdline +@@ -72,7 +72,7 @@ moduledep() { + fi + vecho -n "Looking for deps of module $1" + deps="" +- deps=$(modprobe $MPARGS --set-version $kernel --show-depends $1 2>/dev/null| awk '/^insmod / { print gensub(".*/","","g",$2) }' | while read foo ; do [ "${foo%%.ko}" != "$1" ] && echo -n "${foo%%.ko} " ; done) ++ deps=$(modprobe $MPARGS --set-version $kernel --quiet --show-depends $1 | awk '/^insmod / { print gensub(".*/","","g",$2) }' | while read foo ; do [ "${foo%%.ko}" != "$1" ] && echo -n "${foo%%.ko} " ; done) + [ -n "$deps" ] && vecho ": $deps" || vecho + } + diff --git a/0005-dracut-functions-handle-shared-objects-in-find_binar.patch b/0005-dracut-functions-handle-shared-objects-in-find_binar.patch new file mode 100644 index 0000000..f333108 --- /dev/null +++ b/0005-dracut-functions-handle-shared-objects-in-find_binar.patch @@ -0,0 +1,27 @@ +From 81c6e7fb69a0b7ef5169d13f8b4a4025db923ead Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 17 Feb 2011 10:48:35 +0100 +Subject: [PATCH] dracut-functions: handle shared objects in find_binary w/o the exec flag + +--- + dracut-functions | 7 ++++++- + 1 files changed, 6 insertions(+), 1 deletions(-) + +diff --git a/dracut-functions b/dracut-functions +index eef8f1e..ebcb7d8 100755 +--- a/dracut-functions ++++ b/dracut-functions +@@ -320,7 +320,12 @@ inst_library() { + # search in the usual places to find the binary. + find_binary() { + local binpath="/bin /sbin /usr/bin /usr/sbin" p +- [[ -z ${1##/*} && -x $1 ]] && { echo $1; return 0; } ++ if [[ -z ${1##/*} ]]; then ++ if [[ -x $1 ]] || ldd $1 &>/dev/null; then ++ echo $1 ++ return 0 ++ fi ++ fi + for p in $binpath; do + [[ -x $p/$1 ]] && { echo "$p/$1"; return 0; } + done diff --git a/0006-dracut-functions-fixed-installing-libraries-which-li.patch b/0006-dracut-functions-fixed-installing-libraries-which-li.patch new file mode 100644 index 0000000..5d9f9d0 --- /dev/null +++ b/0006-dracut-functions-fixed-installing-libraries-which-li.patch @@ -0,0 +1,34 @@ +From 172d85b9c949b321771d63dbd5f06ecf19cf94f0 Mon Sep 17 00:00:00 2001 +From: Jon Ander Hernandez +Date: Thu, 17 Feb 2011 10:35:27 +0100 +Subject: [PATCH] dracut-functions: fixed installing libraries which links to another directory + +$ ldd `which bash` | grep ld +/lib64/ld-linux-x86-64.so.2 (0x00007fa1cc3ff000) + +$ readlink -f /lib64/ld-linux-x86-64.so.2 +/lib/ld-2.12.1.so + +So inst_library /lib64/ld-linux-x86-64.so.2 was doing : + +(cd "/tmp/initramfs.4uaeD9/lib64" && ln -s "/lib/ld-2.12.1.so" + "ld-linux-x86-64.so.2") + +But, /tmp/initramfs.4uaeD9/lib64 -> /lib... :-S +--- + dracut-functions | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/dracut-functions b/dracut-functions +index ebcb7d8..1cb43e7 100755 +--- a/dracut-functions ++++ b/dracut-functions +@@ -302,6 +302,8 @@ inst_library() { + lib=${src##*/} + inst_simple "$reallib" "$reallib" + inst_dir "${dest%/*}" ++ [[ -L ${initdir}${dest%/*} ]] && \ ++ dest=$(readlink -f ${initdir}${dest%/*})/ + (cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib") + else + inst_simple "$src" "$dest" diff --git a/0007-i18n-fixed-config-file-parsing-in-hostonly-mode.patch b/0007-i18n-fixed-config-file-parsing-in-hostonly-mode.patch new file mode 100644 index 0000000..0833cd2 --- /dev/null +++ b/0007-i18n-fixed-config-file-parsing-in-hostonly-mode.patch @@ -0,0 +1,27 @@ +From ebaed7d51f61d331d128037e0b37130c58e957e3 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 18 Feb 2011 09:33:06 +0100 +Subject: [PATCH] i18n: fixed config file parsing in hostonly mode + +I accidently removed some parenthesis. +--- + modules.d/10i18n/module-setup.sh | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/modules.d/10i18n/module-setup.sh b/modules.d/10i18n/module-setup.sh +index a524d2d..57a0f9a 100755 +--- a/modules.d/10i18n/module-setup.sh ++++ b/modules.d/10i18n/module-setup.sh +@@ -68,10 +68,10 @@ install() { + + for item in $@ + do +- item=${item/:/ } ++ item=(${item/:/ }) + for map in ${item[1]//,/ } + do +- map=${map//-/ } ++ map=(${map//-/ }) + value=$(grep "^${map[0]}=" "${item[0]}") + value=${value#*=} + echo "${map[1]:-${map[0]}}=${value}" diff --git a/0008-i18n-default-to-vconsole.font.unicode-1.patch b/0008-i18n-default-to-vconsole.font.unicode-1.patch new file mode 100644 index 0000000..9ead768 --- /dev/null +++ b/0008-i18n-default-to-vconsole.font.unicode-1.patch @@ -0,0 +1,46 @@ +From c0a82e271e2730159f042ee7d7fc4aca2e08d28a Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 18 Feb 2011 09:37:11 +0100 +Subject: [PATCH] i18n: default to vconsole.font.unicode=1 + +--- + modules.d/10i18n/parse-i18n.sh | 16 ++++++++++------ + 1 files changed, 10 insertions(+), 6 deletions(-) + +diff --git a/modules.d/10i18n/parse-i18n.sh b/modules.d/10i18n/parse-i18n.sh +index 860b0ae..61280c0 100755 +--- a/modules.d/10i18n/parse-i18n.sh ++++ b/modules.d/10i18n/parse-i18n.sh +@@ -5,9 +5,13 @@ + inst_key_val() { + local _value + local _file ++ local _default ++ _default=$1 ++ shift + _file=$1 + shift + _value=$(getarg $@) ++ [ -z "${_value}" ] && _value=$_default + if [ -n "${_value}" ]; then + printf '%s="%s"\n' $1 ${_value} >> $_file + fi +@@ -15,12 +19,12 @@ 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 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 /etc/vconsole.conf 1 UNICODE vconsole.font.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 diff --git a/0009-selinux-turn-off-selinux-by-default.patch b/0009-selinux-turn-off-selinux-by-default.patch new file mode 100644 index 0000000..f5aebee --- /dev/null +++ b/0009-selinux-turn-off-selinux-by-default.patch @@ -0,0 +1,41 @@ +From 0ce274f02b7391dfa5ab34f26ec3fbc6deff3269 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 18 Feb 2011 09:44:47 +0100 +Subject: [PATCH] selinux: turn off selinux by default + +In Fedora selinux is now handled by systemd. If you want to enable +selinux by default, just add it to your /etc/dracut.conf.d/01-dist.conf +with: +add_dracutmodules+=" selinux " +--- + dracut.conf.d/suse.conf.example | 3 --- + modules.d/98selinux/module-setup.sh | 6 +----- + 2 files changed, 1 insertions(+), 8 deletions(-) + +diff --git a/dracut.conf.d/suse.conf.example b/dracut.conf.d/suse.conf.example +index 9afda04..f25ab01 100644 +--- a/dracut.conf.d/suse.conf.example ++++ b/dracut.conf.d/suse.conf.example +@@ -1,5 +1,2 @@ + i18n_vars="/etc/sysconfig/language:RC_LANG-LANG,RC_LC_ALL-LC_ALL /etc/sysconfig/console:CONSOLE_UNICODEMAP-FONT_UNIMAP,CONSOLE_FONT-FONT,CONSOLE_SCREENMAP-FONT_MAP /etc/sysconfig/keyboard:KEYTABLE-KEYMAP" + +-omit_dracutmodules+=" selinux " +- +- +diff --git a/modules.d/98selinux/module-setup.sh b/modules.d/98selinux/module-setup.sh +index 483e42f..316b552 100755 +--- a/modules.d/98selinux/module-setup.sh ++++ b/modules.d/98selinux/module-setup.sh +@@ -3,11 +3,7 @@ + # ex: ts=8 sw=4 sts=4 et filetype=sh + + check() { +- [[ $hostonly ]] && { +- [ -x "/usr/sbin/load_policy" -o -x "/sbin/load_policy" ] || return 1 +- return 0 +- } +- return 0 ++ return 255 + } + + depends() { diff --git a/dracut.spec b/dracut.spec index d649275..7a32876 100644 --- a/dracut.spec +++ b/dracut.spec @@ -8,7 +8,7 @@ Name: dracut Version: 008 -Release: 2 +Release: 3 Summary: Initramfs generator using udev %if 0%{?fedora} @@ -85,6 +85,13 @@ Requires: util-linux >= 2.16 Patch1: 0001-dracut-functions-write-to-HOME-dracut.log-instead-of.patch Patch2: 0002-dracut.8.xml-corrected-typo.patch Patch3: 0003-plymouth-touch-dev-.systemd-plymouth.patch +Patch4: 0004-dracut-Don-t-suppress-the-modprobe-error-output.patch +Patch5: 0005-dracut-functions-handle-shared-objects-in-find_binar.patch +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 + %description Dracut contains tools to create a bootable initramfs for 2.6 Linux kernels. @@ -151,6 +158,12 @@ This package contains tools to assemble the local initrd and host configuration. %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 %build make WITH_SWITCH_ROOT=0%{?with_switch_root} @@ -275,6 +288,10 @@ rm -rf $RPM_BUILD_ROOT %dir /var/lib/dracut/overlay %changelog +* Fri Feb 18 2011 Harald Hoyer 008-3 +- fixed i18n +- turned off selinux by default + * Wed Feb 09 2011 Harald Hoyer 008-2 - do not write dracut.log to /tmp under any circumstances - touch /dev/.systemd/plymouth after plymouth started