From a4fab5421bd3cb4b68e14babcec8354ec400ab57 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Jan 29 2010 15:45:39 +0000 Subject: - fixed firmware.sh bug (#559975 #559597) --- diff --git a/dracut-004-emergency.patch b/dracut-004-emergency.patch new file mode 100644 index 0000000..4f1d67f --- /dev/null +++ b/dracut-004-emergency.patch @@ -0,0 +1,19 @@ +commit 5db587d7c118afc47b50b4872100b508c84646fa +Author: Harald Hoyer +Date: Wed Jan 20 16:04:55 2010 +0100 + + init: fixed emergency_shell argument parsing + +diff --git a/modules.d/99base/init b/modules.d/99base/init +index 8dc00a9..ab033a7 100755 +--- a/modules.d/99base/init ++++ b/modules.d/99base/init +@@ -35,7 +35,7 @@ wait_for_loginit() + + emergency_shell() + { +- if [ $1 = "-n" ]; then ++ if [ "$1" = "-n" ]; then + _rdshell_name=$2 + shift 2 + else diff --git a/dracut-004-firmware.patch b/dracut-004-firmware.patch new file mode 100644 index 0000000..b838f83 --- /dev/null +++ b/dracut-004-firmware.patch @@ -0,0 +1,19 @@ +diff -up dracut-004/modules.d/95udev-rules/install.fw dracut-004/modules.d/95udev-rules/install +--- dracut-004/modules.d/95udev-rules/install.fw 2010-01-29 16:40:11.000000000 +0100 ++++ dracut-004/modules.d/95udev-rules/install 2010-01-29 16:40:25.000000000 +0100 +@@ -15,7 +15,6 @@ inst_rules "$moddir/01-ignore.rules" + + # for firmware loading + inst_rules 50-firmware.rules +-dracut_install /lib/udev/firmware.sh + dracut_install cat uname + + if [ ! -x /lib/udev/vol_id ]; then +@@ -31,6 +30,7 @@ ata_id \ + cdrom_id \ + create_floppy_devices \ + edd_id \ ++firmware \ + firmware.sh \ + fw_unit_symlinks.sh \ + hid2hci \ diff --git a/dracut-004-forcepermissive.patch b/dracut-004-forcepermissive.patch new file mode 100644 index 0000000..1ece5bb --- /dev/null +++ b/dracut-004-forcepermissive.patch @@ -0,0 +1,12 @@ +diff -up dracut-004/modules.d/99base/selinux-loadpolicy.sh.load dracut-004/modules.d/99base/selinux-loadpolicy.sh +--- dracut-004/modules.d/99base/selinux-loadpolicy.sh.load 2010-01-15 14:07:54.000000000 +0100 ++++ dracut-004/modules.d/99base/selinux-loadpolicy.sh 2010-01-26 11:23:56.000000000 +0100 +@@ -37,6 +37,8 @@ rd_load_policy() + } 2>&1 | vinfo + + if [ $ret -eq 0 -o $ret -eq 2 ]; then ++ # If machine requires a relabel, force to permissive mode ++ [ -e "$NEWROOT"/.autorelabel ] && ( echo 0 > "$NEWROOT"/selinux/enforce ) + return 0 + fi + diff --git a/dracut-004-multipath-check.patch b/dracut-004-multipath-check.patch new file mode 100644 index 0000000..974a26d --- /dev/null +++ b/dracut-004-multipath-check.patch @@ -0,0 +1,48 @@ +From: Peter Jones +Subject: [PATCH] Add a check file for multipath. +Date: Fri, 22 Jan 2010 10:56:40 -0500 + +If multipath isn't installed, don't use it. If we're in hostonly mode, +only install the multipath module if it's used for / . Otherwise, if +the user was dumb enough to install it, they get it during bootup. +--- + modules.d/90multipath/check | 27 +++++++++++++++++++++++++++ + 1 files changed, 27 insertions(+), 0 deletions(-) + create mode 100755 modules.d/90multipath/check + +diff --git a/modules.d/90multipath/check b/modules.d/90multipath/check +new file mode 100755 +index 0000000..d0cad4c +--- /dev/null ++++ b/modules.d/90multipath/check +@@ -0,0 +1,27 @@ ++#!/bin/bash ++ ++# if there's no multipath binary, no go. ++which multipath >/dev/null 2>&1 || exit 1 ++ ++[[ $1 = -d ]] && exit 0 ++ ++. $dracutfunctions ++[[ $debug ]] && set -x ++ ++is_mpath() { ++ [ -e /sys/dev/block/$1/dm/uuid ] || return 1 ++ [[ $(cat /sys/dev/block/$1/dm/uuid) =~ ^mpath- ]] && return 0 ++ return 1 ++} ++ ++# If we're in hostonly mode, do mpath if we appear to be using it for / ++if [[ $1 = -h ]]; then ++ rootdev=$(find_root_block_device) ++ if [[ $rootdev ]]; then ++ check_block_and_slaves is_mpath "$rootdev" && exit 0 ++ fi ++ exit 1 ++fi ++ ++# the user installed it, they get it... ++exit 0 +-- +1.6.5.2 + diff --git a/dracut.spec b/dracut.spec index 682c57a..c419ada 100644 --- a/dracut.spec +++ b/dracut.spec @@ -20,7 +20,7 @@ Name: dracut Version: 004 -Release: 1%{?rdist} +Release: 5%{?rdist} Summary: Initramfs generator using udev Group: System Environment/Base License: GPLv2+ @@ -28,6 +28,10 @@ URL: http://apps.sourceforge.net/trac/dracut/wiki # Source can be generated by # http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=snapshot;h=%{?dashgittag};sf=tgz Source0: dracut-%{version}%{?dashgittag}.tar.bz2 +Patch1: dracut-004-emergency.patch +Patch2: dracut-004-forcepermissive.patch +Patch3: dracut-004-multipath-check.patch +Patch4: dracut-004-firmware.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %if 0%{?fedora} > 12 || 0%{?rhel} >= 6 @@ -131,6 +135,7 @@ kernel modules and firmware files needed by dracut modules. %package tools Summary: Dracut tools to build the local initramfs +Requires: %{name} = %{version}-%{release} Requires: coreutils cryptsetup-luks device-mapper Requires: diffutils dmraid findutils gawk grep lvm2 Requires: module-init-tools sed @@ -141,6 +146,12 @@ This package contains tools to assemble the local initrd and host configuration. %prep %setup -q -n %{name}-%{version}%{?dashgittag} +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +chmod 0755 modules.d/90multipath/check +chmod 0755 modules.d/60xen/check %build make WITH_SWITCH_ROOT=0%{?with_switch_root} @@ -244,6 +255,20 @@ rm -rf $RPM_BUILD_ROOT %dir /var/lib/dracut/overlay %changelog +* Fri Jan 29 2010 Harald Hoyer 004-5 +- fixed firmware.sh bug (#559975 #559597) + +* Tue Jan 26 2010 Harald Hoyer 004-4 +- add multipath check + +* Tue Jan 26 2010 Harald Hoyer 004-3 +- fix selinux handling if .autorelabel is present +- Resolves: rhbz#557744 + +* Wed Jan 20 2010 Harald Hoyer 004-2 +- fix emergency_shell argument parsing +- Related: rhbz#543948 + * Fri Jan 15 2010 Harald Hoyer 004-1 - version 004 - Resolves: rhbz#529339 rhbz#533494 rhbz#548550