update to latest git

This commit is contained in:
Harald Hoyer 2012-01-17 11:19:23 +01:00
parent 0d01f7ccdb
commit 3957aa4012
30 changed files with 1390 additions and 1 deletions

View File

@ -0,0 +1,27 @@
From e74167bd6ae30cc2ea0ed2c4c4ac8011d5feadfa Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 5 Jan 2012 10:51:00 +0100
Subject: [PATCH] mkinitrd-dracut.sh: s/read_args/read_arg/g
https://bugzilla.redhat.com/show_bug.cgi?id=771106
---
mkinitrd-dracut.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/mkinitrd-dracut.sh b/mkinitrd-dracut.sh
index b635a53..02f1a7f 100644
--- a/mkinitrd-dracut.sh
+++ b/mkinitrd-dracut.sh
@@ -49,10 +49,10 @@ while (($# > 0)); do
exit 0;;
-v|--verbose) dracut_args="${dracut_args} -v";;
-f|--force) dracut_args="${dracut_args} -f";;
- --preload) read_args modname "$@" || shift
+ --preload) read_arg modname "$@" || shift
basicmodules="$basicmodules $modname";;
--image-version) img_vers=yes;;
- --rootfs) read_args rootfs "$@" || shift
+ --rootfs) read_arg rootfs "$@" || shift
dracut_args="${dracut_args} --filesystems $rootfs";;
--nocompress) dracut_args="$dracut_args --no-compress";;
--help) usage -n;;

View File

@ -0,0 +1,26 @@
From 14599cd760203a43be992c50fa1dc6a4c6e473ea Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Wed, 4 Jan 2012 09:21:05 -0800
Subject: [PATCH] Fix live update script (#769970)
pushd and popd are not available in the shell used by dracut.
---
modules.d/90dmsquash-live/apply-live-updates.sh | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/modules.d/90dmsquash-live/apply-live-updates.sh b/modules.d/90dmsquash-live/apply-live-updates.sh
index 8dce5d4..f840d1a 100755
--- a/modules.d/90dmsquash-live/apply-live-updates.sh
+++ b/modules.d/90dmsquash-live/apply-live-updates.sh
@@ -1,8 +1,9 @@
#!/bin/sh
if [ -b /dev/mapper/live-rw ]; then
- if pushd /updates &>/dev/null; then
+ if [ -d /updates ]; then
echo "Applying updates to live image..."
+ cd /updates
/bin/cp -a -t $NEWROOT .
- popd &>/dev/null
+ cd -
fi
fi

View File

@ -0,0 +1,22 @@
From 5e90d2665831a137e6726757404f80cda97d1d4f Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 5 Jan 2012 14:36:45 +0100
Subject: [PATCH] Makefile: set bindir to ${prefix}/bin rather than sbin
---
Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index b617a20..ccabd1e 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ libdir ?= ${prefix}/lib
datadir ?= ${prefix}/share
pkglibdir ?= ${libdir}/dracut
sysconfdir ?= ${prefix}/etc
-bindir ?= ${prefix}/sbin
+bindir ?= ${prefix}/bin
mandir ?= ${prefix}/share/man
manpages = dracut.8 dracut.cmdline.7 dracut.conf.5 dracut-catimages.8 dracut-gencmdline.8

View File

@ -0,0 +1,24 @@
From dcba56cafa8e3917fc1bfb9f295c3f23555663b9 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 5 Jan 2012 14:48:57 +0100
Subject: [PATCH] Makefile: dash does not like {} expansion
removed {} expansion for mandir mkdir for users, which have dash as
/bin/sh
---
Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index ccabd1e..e331c5f 100644
--- a/Makefile
+++ b/Makefile
@@ -30,7 +30,7 @@ install: doc
mkdir -p $(DESTDIR)$(bindir)
mkdir -p $(DESTDIR)$(sysconfdir)
mkdir -p $(DESTDIR)$(pkglibdir)/modules.d
- mkdir -p $(DESTDIR)$(mandir)/man{5,7,8}
+ mkdir -p $(DESTDIR)$(mandir)/man5 $(DESTDIR)$(mandir)/man7 $(DESTDIR)$(mandir)/man8
install -m 0755 dracut $(DESTDIR)$(bindir)/dracut
install -m 0755 dracut-gencmdline $(DESTDIR)$(bindir)/dracut-gencmdline
install -m 0755 dracut-catimages $(DESTDIR)$(bindir)/dracut-catimages

View File

@ -0,0 +1,22 @@
From 39f87ab2abc1de6a168ef8a7469755a92d8d218d Mon Sep 17 00:00:00 2001
From: Colin Guthrie <colin@mageia.org>
Date: Wed, 30 Nov 2011 22:16:01 +0000
Subject: [PATCH] mkinitrd: Mention the --nocompress option in help output
Originally from Mandriva patch: dracut-010-mkinitrd.patch
---
mkinitrd-dracut.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/mkinitrd-dracut.sh b/mkinitrd-dracut.sh
index 02f1a7f..ffea2d1 100644
--- a/mkinitrd-dracut.sh
+++ b/mkinitrd-dracut.sh
@@ -8,6 +8,7 @@ usage () {
$cmd "usage: ${0##*/} [--version] [--help] [-v] [-f] [--preload <module>]"
$cmd " [--image-version] [--with=<module>]"
+ $cmd " [--nocompress]"
$cmd " <initrd-image> <kernel-version>"
$cmd ""
$cmd " (ex: ${0##*/} /boot/initramfs-$kver.img $kver)"

View File

@ -0,0 +1,93 @@
From 95023eb325f899303deaaee7c53d83a41f942340 Mon Sep 17 00:00:00 2001
From: Colin Guthrie <colin@mageia.org>
Date: Wed, 30 Nov 2011 22:21:24 +0000
Subject: [PATCH] Fix Unicode keytable.
This patch was originally from Mandriva: dracut-013-fix_unicode_keytable.patch
---
modules.d/10i18n/README | 2 +
modules.d/10i18n/module-setup.sh | 49 +++++++++++++++++++++++--------------
2 files changed, 32 insertions(+), 19 deletions(-)
diff --git a/modules.d/10i18n/README b/modules.d/10i18n/README
index 0507a47..89339aa 100644
--- a/modules.d/10i18n/README
+++ b/modules.d/10i18n/README
@@ -47,6 +47,8 @@ The following variables are used by i18n install script and at initramfs
runtime:
KEYMAP - keyboard translation table loaded by loadkeys
+ KEYTABLE - base name for keyboard translation table; if UNICODE is
+ true, Unicode version will be loaded. Overrides KEYMAP.
EXT_KEYMAPS - list of extra keymaps to bo loaded (sep. by space)
UNICODE - boolean, indicating UTF-8 mode
FONT - console font
diff --git a/modules.d/10i18n/module-setup.sh b/modules.d/10i18n/module-setup.sh
index 6248607..8342fb4 100755
--- a/modules.d/10i18n/module-setup.sh
+++ b/modules.d/10i18n/module-setup.sh
@@ -110,8 +110,38 @@ install() {
[ -f $I18N_CONF ] && . $I18N_CONF
[ -f $VCONFIG_CONF ] && . $VCONFIG_CONF
+ shopt -q -s nocasematch
+ if [[ ${UNICODE} ]]
+ then
+ if [[ ${UNICODE} = YES || ${UNICODE} = 1 ]]
+ then
+ UNICODE=1
+ elif [[ ${UNICODE} = NO || ${UNICODE} = 0 ]]
+ then
+ UNICODE=0
+ else
+ UNICODE=''
+ fi
+ fi
+ if [[ ! ${UNICODE} && ${LANG} =~ .*\.UTF-?8 ]]
+ then
+ UNICODE=1
+ fi
+ shopt -q -u nocasematch
+
# Gentoo user may have KEYMAP set to something like "-u pl2",
KEYMAP=${KEYMAP#-* }
+
+ # KEYTABLE is a bit special - it defines base keymap name and UNICODE
+ # determines whether non-UNICODE or UNICODE version is used
+
+ if [[ ${KEYTABLE} ]]; then
+ if [[ ${UNICODE} == 1 ]]; then
+ [[ ${KEYTABLE} =~ .*\.uni.* ]] || KEYTABLE=${KEYTABLE%.map*}.uni
+ fi
+ KEYMAP=${KEYTABLE}
+ fi
+
# I'm not sure of the purpose of UNIKEYMAP and GRP_TOGGLE. They were in
# original redhat-i18n module. Anyway it won't hurt.
EXT_KEYMAPS+=\ ${UNIKEYMAP}\ ${GRP_TOGGLE}
@@ -150,25 +180,6 @@ install() {
inst_simple ${kbddir}/unimaps/${FONT_UNIMAP}.uni
fi
- shopt -q -s nocasematch
- if [[ ${UNICODE} ]]
- then
- if [[ ${UNICODE} = YES || ${UNICODE} = 1 ]]
- then
- UNICODE=1
- elif [[ ${UNICODE} = NO || ${UNICODE} = 0 ]]
- then
- UNICODE=0
- else
- UNICODE=''
- fi
- fi
- if [[ ! ${UNICODE} && ${LANG} =~ .*\.UTF-?8 ]]
- then
- UNICODE=1
- fi
- shopt -q -u nocasematch
-
mksubdirs ${initdir}${I18N_CONF}
mksubdirs ${initdir}${VCONFIG_CONF}
print_vars LC_ALL LANG >> ${initdir}${I18N_CONF}

View File

@ -0,0 +1,25 @@
From 7835e1465fb1f26d514e8312384b99bbf358673f Mon Sep 17 00:00:00 2001
From: Colin Guthrie <colin@mageia.org>
Date: Wed, 30 Nov 2011 22:23:54 +0000
Subject: [PATCH] Handle compressed kmods.
This was orignally from Mandriva patch: dracut-011-plymouth-compressed-kmod.patch
---
modules.d/50plymouth/module-setup.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules.d/50plymouth/module-setup.sh b/modules.d/50plymouth/module-setup.sh
index 338371f..4ea925e 100755
--- a/modules.d/50plymouth/module-setup.sh
+++ b/modules.d/50plymouth/module-setup.sh
@@ -13,8 +13,8 @@ depends() {
installkernel() {
local _modname
# Include KMS capable drm drivers
- for _modname in $(find "$srcmods/kernel/drivers/gpu/drm" "$srcmods/extra" -name '*.ko' 2>/dev/null); do
- grep -q drm_crtc_init $_modname && instmods $_modname
+ for _modname in $(find "$srcmods/kernel/drivers/gpu/drm" "$srcmods/extra" \( -name '*.ko' -o -name '*.ko.gz' \) 2>/dev/null); do
+ zgrep -q drm_crtc_init $_modname && instmods $_modname
done
}

View File

@ -0,0 +1,24 @@
From 482c573d9e87d15632ac16941d03684270854d30 Mon Sep 17 00:00:00 2001
From: Colin Guthrie <colin@mageia.org>
Date: Wed, 30 Nov 2011 21:48:26 +0000
Subject: [PATCH] Only install files from /etc/ld.so.conf.d/ directory
When calling inst_simple() it will ignore anything that
is not a file, so harden the check done before the calling.
---
dracut | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dracut b/dracut
index 8449fc1..56c8df3 100755
--- a/dracut
+++ b/dracut
@@ -712,7 +712,7 @@ done
if [[ $kernel_only != yes ]]; then
# make sure that library links are correct and up to date
for f in /etc/ld.so.conf /etc/ld.so.conf.d/*; do
- [[ -e $f ]] && inst_simple "$f"
+ [[ -f $f ]] && inst_simple "$f"
done
if ! ldconfig -r "$initdir"; then
if [[ $UID = 0 ]]; then

View File

@ -0,0 +1,36 @@
From 5fae9d9a207a80a8336c37399b48a2c0cec081f1 Mon Sep 17 00:00:00 2001
From: Anssi Hannula <anssi@mageia.org>
Date: Sat, 3 Dec 2011 11:25:45 +0000
Subject: [PATCH] plymouth: Include kms modules even if they are not currently
loaded.
This should fix initial initrd generation during install.
If the modules are not desired to be used, the nokmsboot kernel
command line should disable them.
---
modules.d/50plymouth/module-setup.sh | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/modules.d/50plymouth/module-setup.sh b/modules.d/50plymouth/module-setup.sh
index 4ea925e..df0e8d6 100755
--- a/modules.d/50plymouth/module-setup.sh
+++ b/modules.d/50plymouth/module-setup.sh
@@ -14,7 +14,17 @@ installkernel() {
local _modname
# Include KMS capable drm drivers
for _modname in $(find "$srcmods/kernel/drivers/gpu/drm" "$srcmods/extra" \( -name '*.ko' -o -name '*.ko.gz' \) 2>/dev/null); do
- zgrep -q drm_crtc_init $_modname && instmods $_modname
+ if zgrep -q drm_crtc_init $_modname; then
+ # if the hardware is present, include module even if it is not currently loaded,
+ # as we could e.g. be in the installer; nokmsboot boot parameter will disable
+ # loading of the driver if needed
+ if [[ $hostonly ]] && modinfo -F alias $_modname | sed -e 's,\?,\.,g' -e 's,\*,\.\*,g' \
+ | grep -qxf - /sys/bus/pci/devices/*/modalias; then
+ hostonly='' instmods $_modname
+ continue
+ fi
+ instmods $_modname
+ fi
done
}

View File

@ -0,0 +1,24 @@
From fa20c1852567f0cad2247fc315c450f51a1c03ee Mon Sep 17 00:00:00 2001
From: Colin Guthrie <colin@mageia.org>
Date: Fri, 16 Dec 2011 23:11:39 +0000
Subject: [PATCH] kernel-modules: Find (and ulitmately dereference) any
symlinks in modprobe.d dir.
Also only do the top level of files (ignore any subdirs and files within)
---
modules.d/90kernel-modules/module-setup.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh
index 8d2ab91..257b3bc 100755
--- a/modules.d/90kernel-modules/module-setup.sh
+++ b/modules.d/90kernel-modules/module-setup.sh
@@ -70,7 +70,7 @@ installkernel() {
install() {
local _f
[ -f /etc/modprobe.conf ] && dracut_install /etc/modprobe.conf
- for i in $(find /etc/modprobe.d/ -type f -name '*.conf'); do
+ for i in $(find -L /etc/modprobe.d/ -maxdepth 1 -type f -name '*.conf'); do
inst_simple "$i"
done
inst_hook cmdline 01 "$moddir/parse-kernel.sh"

View File

@ -0,0 +1,27 @@
From 5d55ceb75ca5a8d04f0a218aa14b6722af2e52ad Mon Sep 17 00:00:00 2001
From: Colin Guthrie <colin@mageia.org>
Date: Mon, 26 Dec 2011 23:03:34 +0000
Subject: [PATCH] btrfs: Ensure crc32c module is installed.
As outlined here:
https://bugs.mageia.org/show_bug.cgi?id=3214
and:
https://bugs.launchpad.net/ubuntu/+source/linux-linaro-omap/+bug/715835
the btrfs module needs a CRC implementation.
---
modules.d/90btrfs/module-setup.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/modules.d/90btrfs/module-setup.sh b/modules.d/90btrfs/module-setup.sh
index f89713f..d4abbaf 100755
--- a/modules.d/90btrfs/module-setup.sh
+++ b/modules.d/90btrfs/module-setup.sh
@@ -29,7 +29,7 @@ depends() {
}
installkernel() {
- instmods btrfs
+ instmods btrfs crc32c
}
install() {

View File

@ -0,0 +1,53 @@
From f65b874bda9f8b12d41c1f07826f584a8f5dcf6d Mon Sep 17 00:00:00 2001
From: Colin Guthrie <colin@mageia.org>
Date: Sat, 31 Dec 2011 13:30:58 +0000
Subject: [PATCH] resume: Fix failure when invalid device passed via 'resume='
This commit allows the waiting for a device to be cancelled.
When the resume partition does not exist, it becomes quite hard
to work out what to do (you have to either create the
/dev/resume symlink manually, or remove the 'finished' job
that is waiting for it). Additionally dracut incorrectly
displays a message about not being able to find the root
device, which is bogus and misleading.
This commit should just bail on the whole resume thing
if the device cannot be found and proceed with a normal boot.
---
modules.d/95resume/resume-genrules.sh | 3 +++
modules.d/99base/dracut-lib.sh | 8 ++++++++
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/modules.d/95resume/resume-genrules.sh b/modules.d/95resume/resume-genrules.sh
index 16df877..ee4eacb 100755
--- a/modules.d/95resume/resume-genrules.sh
+++ b/modules.d/95resume/resume-genrules.sh
@@ -35,6 +35,9 @@ if [ -n "$resume" ]; then
printf '[ -e "%s" ] && { ln -s "%s" /dev/resume; rm "$job"; }\n' \
"$resume" "$resume" >> $hookdir/initqueue/settled/resume.sh
+ printf 'warn "Cancelling resume operation. Device not found."; cancel_wait_for_dev /dev/resume; rm "$job" "%s/initqueue/settled/resume.sh";' \
+ "$hookdir" >> $hookdir/initqueue/timeout/resume.sh
+
wait_for_dev "/dev/resume"
elif ! getarg noresume; then
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index 9eae4d9..b4fb435 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -717,6 +717,14 @@ wait_for_dev()
} >> "$hookdir/emergency/80-${_name}.sh"
}
+cancel_wait_for_dev()
+{
+ local _name
+ _name="$(str_replace "$1" '/' '\\x2f')"
+ rm -f "$hookdir/initqueue/finished/devexists-${_name}.sh"
+ rm -f "$hookdir/emergency/80-${_name}.sh"
+}
+
killproc() {
local _exe="$(command -v $1)"
local _sig=$2

View File

@ -0,0 +1,37 @@
From 09ee7234b60354a446070b2d4f0df480e3684e6a Mon Sep 17 00:00:00 2001
From: Colin Guthrie <colin@mageia.org>
Date: Sun, 8 Jan 2012 21:32:05 +0000
Subject: [PATCH] dmsquash: Ensure the 'loop' kernel module is included and
loaded.
---
modules.d/90dmsquash-live/module-setup.sh | 2 +-
modules.d/90dmsquash-live/parse-dmsquash-live.sh | 2 ++
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/modules.d/90dmsquash-live/module-setup.sh b/modules.d/90dmsquash-live/module-setup.sh
index de1eed6..2a7988a 100755
--- a/modules.d/90dmsquash-live/module-setup.sh
+++ b/modules.d/90dmsquash-live/module-setup.sh
@@ -16,7 +16,7 @@ depends() {
}
installkernel() {
- instmods squashfs
+ instmods squashfs loop
}
install() {
diff --git a/modules.d/90dmsquash-live/parse-dmsquash-live.sh b/modules.d/90dmsquash-live/parse-dmsquash-live.sh
index a733144..920647e 100755
--- a/modules.d/90dmsquash-live/parse-dmsquash-live.sh
+++ b/modules.d/90dmsquash-live/parse-dmsquash-live.sh
@@ -17,6 +17,8 @@ fi
[ "${liveroot%%:*}" = "live" ] || return
+modprobe -q loop
+
case "$liveroot" in
live:LABEL=*|LABEL=*) \
root="${root#live:}"

View File

@ -0,0 +1,42 @@
From 54f1a77fb678c254eb460844442c2323f2ca9cfc Mon Sep 17 00:00:00 2001
From: Colin Guthrie <colin@mageia.org>
Date: Sat, 31 Dec 2011 13:35:59 +0000
Subject: [PATCH] init: Fix bogus message about invalid root device.
When the initqueue cannot be processed, it might be about an invalid
root device (in which case a separate message produced via
wait_for_dev() should be displayed anyway), but it could also
be for any other reason (e.g. /dev/resume not existing).
Therefore, it is best to use a more generic error message.
Also a minor tab->space conversion in the near vacinity of
the real change.
---
modules.d/99base/init | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules.d/99base/init b/modules.d/99base/init
index fc00e4f..1e54449 100755
--- a/modules.d/99base/init
+++ b/modules.d/99base/init
@@ -259,16 +259,16 @@ while :; do
fi
if [ $main_loop -gt $(($RDRETRY/2)) ]; then
- for job in $hookdir/initqueue/timeout/*.sh; do
+ for job in $hookdir/initqueue/timeout/*.sh; do
[ -e "$job" ] || break
job=$job . $job
main_loop=0
- done
+ done
fi
main_loop=$(($main_loop+1))
[ $main_loop -gt $RDRETRY ] \
- && { flock -s 9 ; emergency_shell "No root device \"$root\" found"; } 9>/.console_lock
+ && { flock -s 9 ; emergency_shell "Unable to process initqueue"; } 9>/.console_lock
done
unset job
unset queuetriggered

View File

@ -0,0 +1,57 @@
From 62073c30484f3fc4b657d6939bec9ac5a4ecf8c5 Mon Sep 17 00:00:00 2001
From: Colin Guthrie <colin@mageia.org>
Date: Sat, 17 Dec 2011 00:35:08 +0000
Subject: [PATCH] udev: Attempt to install any programs used by udev rules.
---
dracut-functions | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/dracut-functions b/dracut-functions
index d95df14..8944430 100755
--- a/dracut-functions
+++ b/dracut-functions
@@ -516,6 +516,27 @@ inst_symlink() {
fi
}
+# attempt to install any programs specified in a udev rule
+inst_rule_programs() {
+ local _prog _bin
+
+ if grep -qE 'PROGRAM==?"[^ "]+' "$1"; then
+ for _prog in $(grep -E 'PROGRAM==?"[^ "]+' "$1" | sed -r 's/.*PROGRAM==?"([^ "]+).*/\1/'); do
+ if [ -x /lib/udev/$_prog ]; then
+ _bin=/lib/udev/$_prog
+ else
+ _bin=$(find_binary "$_prog") || {
+ dinfo "Skipping program $_prog using in udev rule $(basename $1) as it cannot be found"
+ continue;
+ }
+ fi
+
+ #dinfo "Installing $_bin due to it's use in the udev rule $(basename $1)"
+ dracut_install "$_bin"
+ done
+ fi
+}
+
# udev rules always get installed in the same place, so
# create a function to install them to make life simpler.
inst_rules() {
@@ -529,6 +550,7 @@ inst_rules() {
if [[ -f $r/$_rule ]]; then
_found="$r/$_rule"
inst_simple "$_found"
+ inst_rule_programs "$_found"
fi
done
fi
@@ -536,6 +558,7 @@ inst_rules() {
if [[ -f ${r}$_rule ]]; then
_found="${r}$_rule"
inst_simple "$_found" "$_target/${_found##*/}"
+ inst_rule_programs "$_found"
fi
done
[[ $_found ]] || dinfo "Skipping udev rule: $_rule"

View File

@ -0,0 +1,29 @@
From 345f9fa77e8a6e86bb08f66e46fe0396024660ea Mon Sep 17 00:00:00 2001
From: Duane Griffin <duaneg@dghda.com>
Date: Fri, 13 Jan 2012 10:23:45 +0100
Subject: [PATCH] 98usrmount/mount-usr.sh: Don't pass mount options to fsck
---
modules.d/98usrmount/mount-usr.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules.d/98usrmount/mount-usr.sh b/modules.d/98usrmount/mount-usr.sh
index a61f935..fc205d5 100755
--- a/modules.d/98usrmount/mount-usr.sh
+++ b/modules.d/98usrmount/mount-usr.sh
@@ -19,7 +19,7 @@ mount_usr()
if [ "x$_usr_found" != "x" ]; then
# we have to mount /usr
- fsck_single "$_dev" "$_fs" "$_opts"
+ fsck_single "$_dev" "$_fs"
_ret=$?
echo $_ret >/run/initramfs/usr-fsck
if [ $_ret -ne 255 ]; then
@@ -29,4 +29,4 @@ mount_usr()
fi
}
-mount_usr
\ No newline at end of file
+mount_usr

View File

@ -0,0 +1,31 @@
From cf5229190dfb711f6380afe50917559477711d83 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 13 Jan 2012 11:20:05 +0100
Subject: [PATCH] TEST-10-RAID: fixed TESTDIR handling
---
test/TEST-10-RAID/test.sh | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/test/TEST-10-RAID/test.sh b/test/TEST-10-RAID/test.sh
index 90758d8..5ac0bc5 100755
--- a/test/TEST-10-RAID/test.sh
+++ b/test/TEST-10-RAID/test.sh
@@ -5,8 +5,8 @@ KVERSION=${KVERSION-$(uname -r)}
# Uncomment this to debug failures
#DEBUGFAIL="rd.shell"
-DISKIMAGE=$TESTDIR/TEST-10-RAID-root.img
test_run() {
+ DISKIMAGE=$TESTDIR/TEST-10-RAID-root.img
$testdir/run-qemu \
-hda $DISKIMAGE \
-m 256M -nographic \
@@ -17,6 +17,7 @@ test_run() {
}
test_setup() {
+ DISKIMAGE=$TESTDIR/TEST-10-RAID-root.img
# Create the blank file to use as a root filesystem
rm -f $DISKIMAGE
dd if=/dev/null of=$DISKIMAGE bs=1M seek=40

View File

@ -0,0 +1,115 @@
From cd7ff122a4cea4ba6d03d366293cc44e9550a54f Mon Sep 17 00:00:00 2001
From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Tue, 20 Dec 2011 14:09:56 +0800
Subject: [PATCH] Allow to add mount points even not in hostonly mode
Don't force --mount only working in hostonly mode, let users decide.
With this patch, people can still combine -H --mount '...' if they
want to use it in hostonly mode.
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
dracut | 77 +++++++++++++++++++++++++++++++--------------------------------
1 files changed, 38 insertions(+), 39 deletions(-)
diff --git a/dracut b/dracut
index 56c8df3..04dc8ec 100755
--- a/dracut
+++ b/dracut
@@ -525,40 +525,25 @@ trap 'exit 1;' SIGINT
# Need to be able to have non-root users read stuff (rpcbind etc)
chmod 755 "$initdir"
+for line in "${fstab_lines[@]}"; do
+ set -- $line
+ #dev mp fs fsopts
+ dev="$(get_maj_min $1)"
+ push host_devs "${dev:-$1}"
+ push host_fs_types "$dev|$3"
+done
+
+for f in $add_fstab; do
+ [ -e $f ] || continue
+ while read dev rest; do
+ push host_devs $dev
+ done < $f
+done
+
if [[ $hostonly ]]; then
# in hostonly mode, determine all devices, which have to be accessed
# and examine them for filesystem types
- unset host_fs_types
-
- _get_fs_type() (
- [[ $1 ]] || return
- if [[ -b /dev/block/$1 ]] && get_fs_env /dev/block/$1; then
- echo "$1|$ID_FS_TYPE"
- return 1
- fi
- if fstype=$(find_dev_fstype $1); then
- echo "$1|$fstype"
- return 1
- fi
- return 1
- )
-
- for line in "${fstab_lines[@]}"; do
- set -- $line
- #dev mp fs fsopts
- dev="$(get_maj_min $1)"
- push host_devs "${dev:-$1}"
- push host_fs_types "$dev|$3"
- done
-
- for f in $add_fstab; do
- [ -e $f ] || continue
- while read dev rest; do
- push host_devs $dev
- done < $f
- done
-
push host_mp \
"/" \
"/etc" \
@@ -573,17 +558,31 @@ if [[ $hostonly ]]; then
mountpoint "$mp" >/dev/null 2>&1 || continue
push host_devs $(find_block_device "$mp")
done
- for dev in "${host_devs[@]}"; do
- unset fs_type
- for fstype in $(_get_fs_type $dev) \
- $(check_block_and_slaves _get_fs_type $dev); do
- if ! strstr " ${host_fs_types[*]} " " $fstype ";then
- push host_fs_types "$fstype"
- fi
- done
- done
fi
+_get_fs_type() (
+ [[ $1 ]] || return
+ if [[ -b /dev/block/$1 ]] && get_fs_env /dev/block/$1; then
+ echo "$1|$ID_FS_TYPE"
+ return 1
+ fi
+ if fstype=$(find_dev_fstype $1); then
+ echo "$1|$fstype"
+ return 1
+ fi
+ return 1
+)
+
+for dev in "${host_devs[@]}"; do
+ unset fs_type
+ for fstype in $(_get_fs_type $dev) \
+ $(check_block_and_slaves _get_fs_type $dev); do
+ if ! strstr " ${host_fs_types[*]} " " $fstype ";then
+ push host_fs_types "$fstype"
+ fi
+ done
+done
+
export initdir dracutbasedir dracutmodules drivers \
fw_dir drivers_dir debug no_kernel kernel_only \
add_drivers mdadmconf lvmconf filesystems \

View File

@ -0,0 +1,299 @@
From 1b7fd0fa3eded954ed5baad7aee49507a607275b Mon Sep 17 00:00:00 2001
From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Tue, 20 Dec 2011 14:09:57 +0800
Subject: [PATCH] Check module dependencies of mount points
Like -H, we need to poll every module to check if it is needed
to mount a specific device in '--mount'.
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
dracut | 5 ++-
dracut-functions | 68 +++++++++++++++++++++++++++++-
modules.d/00bootchart/module-setup.sh | 1 +
modules.d/10i18n/module-setup.sh | 1 +
modules.d/10rpmversion/module-setup.sh | 1 +
modules.d/50plymouth/module-setup.sh | 1 +
modules.d/90btrfs/module-setup.sh | 2 +-
modules.d/90crypt/module-setup.sh | 2 +-
modules.d/90dmraid/module-setup.sh | 2 +-
modules.d/90lvm/module-setup.sh | 2 +-
modules.d/90mdraid/module-setup.sh | 2 +-
modules.d/95fcoe/module-setup.sh | 2 +-
modules.d/95nfs/module-setup.sh | 2 +-
modules.d/97biosdevname/module-setup.sh | 1 +
modules.d/98usrmount/module-setup.sh | 1 +
15 files changed, 82 insertions(+), 11 deletions(-)
diff --git a/dracut b/dracut
index 04dc8ec..c3584c0 100755
--- a/dracut
+++ b/dracut
@@ -633,9 +633,12 @@ else
done
fi
+mods_to_load=""
# check all our modules to see if they should be sourced.
# This builds a list of modules that we will install next.
-check_module_dir
+for_each_module_dir check_module
+for_each_module_dir check_mount
+
modules_loaded=" "
# source our modules.
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
diff --git a/dracut-functions b/dracut-functions
index 8944430..2f9e713 100755
--- a/dracut-functions
+++ b/dracut-functions
@@ -783,6 +783,67 @@ module_installkernel() {
fi
}
+module_check_mount() {
+ local _moddir=$(echo ${dracutbasedir}/modules.d/??${1})
+ local _ret
+ mount_needs=1
+ [[ -d $_moddir ]] || return 1
+ if [[ ! -f $_moddir/module-setup.sh ]]; then
+ # if we do not have a check script, we are unconditionally included
+ [[ -x $_moddir/check ]] || return 0
+ mount_needs=1 $_moddir/check 0
+ _ret=$?
+ else
+ unset check depends install installkernel
+ . $_moddir/module-setup.sh
+ is_func check || return 1
+ check 0
+ _ret=$?
+ unset check depends install installkernel
+ fi
+ unset mount_needs
+ return $_ret
+}
+
+check_mount() {
+ local _mod=$1
+ local _moddir=$(echo ${dracutbasedir}/modules.d/??${1})
+ local _ret
+ local _moddep
+ # If we are already scheduled to be loaded, no need to check again.
+ strstr " $mods_to_load " " $_mod " && return 0
+ strstr " $mods_checked_as_dep " " $_mod " && return 1
+
+ # This should never happen, but...
+ [[ -d $_moddir ]] || return 1
+
+ [[ $2 ]] || mods_checked_as_dep+=" $_mod "
+
+ strstr " $omit_dracutmodules " " $_mod " && return 1
+
+ if [ "${#host_fs_types[*]}" -gt 0 ]; then
+ module_check_mount $_mod || return 1
+ else
+ # skip this module
+ return 1
+ fi
+
+ for _moddep in $(module_depends $_mod); do
+ # handle deps as if they were manually added
+ strstr " $add_dracutmodules " " $_moddep " || \
+ add_dracutmodules+=" $_moddep "
+ strstr " $force_add_dracutmodules " " $_moddep " || \
+ force_add_dracutmodules+=" $_moddep "
+ # if a module we depend on fail, fail also
+ check_module $_moddep || return 1
+ done
+
+ strstr " $mods_to_load " " $_mod " || \
+ mods_to_load+=" $_mod "
+
+ return 0
+}
+
check_module() {
local _mod=$1
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1})
@@ -834,14 +895,15 @@ check_module() {
return 0
}
-check_module_dir() {
+for_each_module_dir() {
local _modcheck
local _mod
local _moddir
- mods_to_load=""
+ local _func
+ _func=$1
for _moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
_mod=${_moddir##*/}; _mod=${_mod#[0-9][0-9]}
- check_module $_mod 1
+ $_func $_mod 1
done
# Report any missing dracut modules, the user has specified
diff --git a/modules.d/00bootchart/module-setup.sh b/modules.d/00bootchart/module-setup.sh
index bf71b14..17dd137 100755
--- a/modules.d/00bootchart/module-setup.sh
+++ b/modules.d/00bootchart/module-setup.sh
@@ -3,6 +3,7 @@
# ex: ts=8 sw=4 sts=4 et filetype=sh
check() {
+ [[ "$mount_needs" ]] && return 1
[ -x /sbin/bootchartd ] || return 1
return 255
}
diff --git a/modules.d/10i18n/module-setup.sh b/modules.d/10i18n/module-setup.sh
index 8342fb4..37c7c09 100755
--- a/modules.d/10i18n/module-setup.sh
+++ b/modules.d/10i18n/module-setup.sh
@@ -3,6 +3,7 @@
# ex: ts=8 sw=4 sts=4 et filetype=sh
check() {
+ [[ "$mount_needs" ]] && return 1
return 0
}
diff --git a/modules.d/10rpmversion/module-setup.sh b/modules.d/10rpmversion/module-setup.sh
index 676775f..4c021ad 100755
--- a/modules.d/10rpmversion/module-setup.sh
+++ b/modules.d/10rpmversion/module-setup.sh
@@ -3,6 +3,7 @@
# ex: ts=8 sw=4 sts=4 et filetype=sh
check() {
+ [[ "$mount_needs" ]] && return 1
[ -f /etc/redhat-release ]
}
diff --git a/modules.d/50plymouth/module-setup.sh b/modules.d/50plymouth/module-setup.sh
index df0e8d6..eedc842 100755
--- a/modules.d/50plymouth/module-setup.sh
+++ b/modules.d/50plymouth/module-setup.sh
@@ -3,6 +3,7 @@
# ex: ts=8 sw=4 sts=4 et filetype=sh
check() {
+ [[ "$mount_needs" ]] && return 1
[[ -x /sbin/plymouthd && -x /bin/plymouth && -x /usr/sbin/plymouth-set-default-theme ]]
}
diff --git a/modules.d/90btrfs/module-setup.sh b/modules.d/90btrfs/module-setup.sh
index d4abbaf..a141dda 100755
--- a/modules.d/90btrfs/module-setup.sh
+++ b/modules.d/90btrfs/module-setup.sh
@@ -11,7 +11,7 @@ check() {
. $dracutfunctions
[[ $debug ]] && set -x
- [[ $hostonly ]] && {
+ [[ $hostonly ]] || [[ $mount_needs ]] && {
local _found
for fs in $host_fs_types; do
[[ "$fs" = "|btrfs" ]] && _found="1"
diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh
index 42c6b48..a92c187 100755
--- a/modules.d/90crypt/module-setup.sh
+++ b/modules.d/90crypt/module-setup.sh
@@ -23,7 +23,7 @@ check() {
echo " rd.luks.uuid=${ID_FS_UUID} " >> "${initdir}/etc/cmdline.d/90crypt.conf"
}
- [[ $hostonly ]] && {
+ [[ $hostonly ]] || [[ $mount_needs ]] && {
[[ -d "${initdir}/etc/cmdline.d" ]] || mkdir -p "${initdir}/etc/cmdline.d"
for_each_host_dev_fs check_crypt
[ -f "${initdir}/etc/cmdline.d/90crypt.conf" ] || return 1
diff --git a/modules.d/90dmraid/module-setup.sh b/modules.d/90dmraid/module-setup.sh
index 9de6c63..19f2ce6 100755
--- a/modules.d/90dmraid/module-setup.sh
+++ b/modules.d/90dmraid/module-setup.sh
@@ -38,7 +38,7 @@ check() {
echo " rd.dm.uuid=${DM_NAME} " >> "${initdir}/etc/cmdline.d/90dmraid.conf"
}
- [[ $hostonly ]] && {
+ [[ $hostonly ]] || [[ $mount_needs ]] && {
[[ -d "${initdir}/etc/cmdline.d" ]] || mkdir -p "${initdir}/etc/cmdline.d"
for_each_host_dev_fs check_dmraid
[ -f "${initdir}/etc/cmdline.d/90dmraid.conf" ] || return 1
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
index 87751cb..c910f13 100755
--- a/modules.d/90lvm/module-setup.sh
+++ b/modules.d/90lvm/module-setup.sh
@@ -23,7 +23,7 @@ check() {
echo " rd.lvm.lv=${DM_LV_NAME} " >> "${initdir}/etc/cmdline.d/90lvm.conf"
}
- [[ $hostonly ]] && {
+ [[ $hostonly ]] || [[ $mount_needs ]] && {
[[ -d "${initdir}/etc/cmdline.d" ]] || mkdir -p "${initdir}/etc/cmdline.d"
for_each_host_dev_fs check_lvm
[ -f "${initdir}/etc/cmdline.d/90lvm.conf" ] || return 1
diff --git a/modules.d/90mdraid/module-setup.sh b/modules.d/90mdraid/module-setup.sh
index 05e0127..8c3e2bb 100755
--- a/modules.d/90mdraid/module-setup.sh
+++ b/modules.d/90mdraid/module-setup.sh
@@ -38,7 +38,7 @@ check() {
echo " rd.md.uuid=${MD_UUID} " >> "${initdir}/etc/cmdline.d/90mdraid.conf"
}
- [[ $hostonly ]] && {
+ [[ $hostonly ]] || [[ $mount_needs ]] && {
[[ -d "${initdir}/etc/cmdline.d" ]] || mkdir -p "${initdir}/etc/cmdline.d"
for_each_host_dev_fs check_mdraid
[[ -f "${initdir}/etc/cmdline.d/90mdraid.conf" ]] || return 1
diff --git a/modules.d/95fcoe/module-setup.sh b/modules.d/95fcoe/module-setup.sh
index b4cee97..e66798b 100755
--- a/modules.d/95fcoe/module-setup.sh
+++ b/modules.d/95fcoe/module-setup.sh
@@ -6,7 +6,7 @@ check() {
# FIXME
# If hostonly was requested, fail the check until we have some way of
# knowing we are booting from FCoE
- [[ $hostonly ]] && return 1
+ [[ $hostonly ]] || [[ $mount_needs ]] && return 1
return 0
}
diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
index bb3b793..641d917 100755
--- a/modules.d/95nfs/module-setup.sh
+++ b/modules.d/95nfs/module-setup.sh
@@ -7,7 +7,7 @@ check() {
type -P rpcbind >/dev/null || type -P portmap >/dev/null || return 1
type -P rpc.statd mount.nfs mount.nfs4 umount >/dev/null || return 1
- [[ $hostonly ]] && {
+ [[ $hostonly ]] || [[ $mount_needs ]] && {
for fs in ${host_fs_types[@]}; do
strstr "$fs" "|nfs" && return 0
strstr "$fs" "|nfs3" && return 0
diff --git a/modules.d/97biosdevname/module-setup.sh b/modules.d/97biosdevname/module-setup.sh
index 834831f..4d492a9 100755
--- a/modules.d/97biosdevname/module-setup.sh
+++ b/modules.d/97biosdevname/module-setup.sh
@@ -3,6 +3,7 @@
# ex: ts=8 sw=4 sts=4 et filetype=sh
check() {
+ [[ "$mount_needs" ]] && return 1
type -P biosdevname >/dev/null || return 1
return 0
}
diff --git a/modules.d/98usrmount/module-setup.sh b/modules.d/98usrmount/module-setup.sh
index 8f7be10..5844383 100755
--- a/modules.d/98usrmount/module-setup.sh
+++ b/modules.d/98usrmount/module-setup.sh
@@ -3,6 +3,7 @@
# ex: ts=8 sw=4 sts=4 et filetype=sh
check() {
+ [[ $mount_needs ]] && return 1
return 0
}

View File

@ -0,0 +1,25 @@
From 426b68b20ada687327d464c3822c8e84e43e5672 Mon Sep 17 00:00:00 2001
From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Tue, 20 Dec 2011 14:09:58 +0800
Subject: [PATCH] Fix get_maj_min() to follow symlink
Otherwise get_maj_min /dev/mapper/vg_cr0-lv_home will return 0:0.
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
dracut-functions | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dracut-functions b/dracut-functions
index 2f9e713..a77a002 100755
--- a/dracut-functions
+++ b/dracut-functions
@@ -180,7 +180,7 @@ get_fs_uuid() (
get_maj_min() {
local _dev
- _dev=$(stat -c '$((0x%T)):$((0x%t))' "$1" 2>/dev/null)
+ _dev=$(stat -L -c '$((0x%T)):$((0x%t))' "$1" 2>/dev/null)
_dev=$(eval "echo $_dev")
echo $_dev
}

View File

@ -0,0 +1,80 @@
From d0096de764e73f372f9ca93063f0270fc6b02c20 Mon Sep 17 00:00:00 2001
From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Tue, 20 Dec 2011 14:09:59 +0800
Subject: [PATCH] Pass device name instead of major:minor in
for_each_host_dev_fs()
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
dracut | 11 +++++------
dracut-functions | 11 ++++++-----
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/dracut b/dracut
index c3584c0..8c24e7b 100755
--- a/dracut
+++ b/dracut
@@ -528,9 +528,8 @@ chmod 755 "$initdir"
for line in "${fstab_lines[@]}"; do
set -- $line
#dev mp fs fsopts
- dev="$(get_maj_min $1)"
- push host_devs "${dev:-$1}"
- push host_fs_types "$dev|$3"
+ push host_devs "$1"
+ push host_fs_types "$1|$3"
done
for f in $add_fstab; do
@@ -556,13 +555,13 @@ if [[ $hostonly ]]; then
for mp in "${host_mp[@]}"; do
mountpoint "$mp" >/dev/null 2>&1 || continue
- push host_devs $(find_block_device "$mp")
+ push host_devs $(readlink -f "/dev/block/$(find_block_device "$mp")")
done
fi
_get_fs_type() (
[[ $1 ]] || return
- if [[ -b /dev/block/$1 ]] && get_fs_env /dev/block/$1; then
+ if [[ -b $1 ]] && get_fs_env $1; then
echo "$1|$ID_FS_TYPE"
return 1
fi
@@ -576,7 +575,7 @@ _get_fs_type() (
for dev in "${host_devs[@]}"; do
unset fs_type
for fstype in $(_get_fs_type $dev) \
- $(check_block_and_slaves _get_fs_type $dev); do
+ $(check_block_and_slaves _get_fs_type $(get_maj_min $dev)); do
if ! strstr " ${host_fs_types[*]} " " $fstype ";then
push host_fs_types "$fstype"
fi
diff --git a/dracut-functions b/dracut-functions
index a77a002..a9b15cc 100755
--- a/dracut-functions
+++ b/dracut-functions
@@ -247,16 +247,17 @@ find_root_block_device() { find_block_device /; }
for_each_host_dev_fs()
{
local _func="$1"
+ local _dev
+ local _fs
for f in ${host_fs_types[@]}; do
OLDIFS="$IFS"
IFS="|"
set -- $f
IFS="$OLDIFS"
- dev=$1
- [[ -b /dev/block/$dev ]] && dev="/dev/block/$dev"
- [[ -b $dev ]] || continue
- fs="$2"
- $_func $dev $fs
+ _dev="$1"
+ [[ -b "$_dev" ]] || continue
+ _fs="$2"
+ $_func $_dev $_fs
done
}

View File

@ -0,0 +1,27 @@
From eead77320496939196428eb33b528533379f2bf0 Mon Sep 17 00:00:00 2001
From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Tue, 20 Dec 2011 14:10:00 +0800
Subject: [PATCH] nfs: fix regex patterns in check()
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
modules.d/95nfs/module-setup.sh | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
index 641d917..6778f28 100755
--- a/modules.d/95nfs/module-setup.sh
+++ b/modules.d/95nfs/module-setup.sh
@@ -9,9 +9,9 @@ check() {
[[ $hostonly ]] || [[ $mount_needs ]] && {
for fs in ${host_fs_types[@]}; do
- strstr "$fs" "|nfs" && return 0
- strstr "$fs" "|nfs3" && return 0
- strstr "$fs" "|nfs4" && return 0
+ strstr "$fs" "\|nfs" && return 0
+ strstr "$fs" "\|nfs3" && return 0
+ strstr "$fs" "\|nfs4" && return 0
done
return 255
}

View File

@ -0,0 +1,38 @@
From a72cae66dcceba812eedeb6c4e15961bd02af8a3 Mon Sep 17 00:00:00 2001
From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Tue, 20 Dec 2011 14:10:01 +0800
Subject: [PATCH] lvm: pass the correct rd.lvm.lv parameter
rd.lvm.lv accepts ${DM_VG_NAME}/${DM_LV_NAME}, not ${DM_LV_NAME}.
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
modules.d/90lvm/module-setup.sh | 15 +++++----------
1 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
index c910f13..01bfa8a 100755
--- a/modules.d/90lvm/module-setup.sh
+++ b/modules.d/90lvm/module-setup.sh
@@ -11,16 +11,11 @@ check() {
[[ $debug ]] && set -x
check_lvm() {
- local dev=$1
- DM_LV_NAME=$(udevadm info --query=property --name=$dev \
- | while read line; do
- [[ ${line#DM_LV_NAME} = $line ]] && continue
- eval "$line"
- echo $DM_LV_NAME
- break
- done)
- [[ ${DM_LV_NAME} ]] || continue
- echo " rd.lvm.lv=${DM_LV_NAME} " >> "${initdir}/etc/cmdline.d/90lvm.conf"
+ unset DM_VG_NAME
+ unset DM_LV_NAME
+ eval $(udevadm info --query=property --name=$1|egrep '(DM_VG_NAME|DM_LV_NAME)=')
+ [[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || return
+ echo " rd.lvm.lv=${DM_VG_NAME}/${DM_LV_NAME} " >> "${initdir}/etc/cmdline.d/90lvm.conf"
}
[[ $hostonly ]] || [[ $mount_needs ]] && {

View File

@ -0,0 +1,28 @@
From ce32e32f2a8288de15968c22f57fff306fa81753 Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Tue, 20 Dec 2011 14:22:33 -0800
Subject: [PATCH] Create a symlink for the live image's base loop device
It is useful to know that loop device that the live image's / is mounted
from. Make a /run/initramfs/live-baseloop symlink that points to it.
Edited-By: harald@redhat.com: changed /dev/live-baseloop
to /run/initramfs/live-baseloop
---
modules.d/90dmsquash-live/dmsquash-live-root | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/modules.d/90dmsquash-live/dmsquash-live-root b/modules.d/90dmsquash-live/dmsquash-live-root
index b704139..cb104e4 100755
--- a/modules.d/90dmsquash-live/dmsquash-live-root
+++ b/modules.d/90dmsquash-live/dmsquash-live-root
@@ -200,6 +200,9 @@ if [ -n "$ROOTFLAGS" ]; then
ROOTFLAGS="-o $ROOTFLAGS"
fi
+if [ -b "$BASE_LOOPDEV" ]; then
+ ln -s $BASE_LOOPDEV /dev/live-baseloop
+fi
ln -s /dev/mapper/live-rw /dev/root
printf '/bin/mount %s /dev/mapper/live-rw %s\n' "$ROOTFLAGS" "$NEWROOT" > $hookdir/mount/01-$$-live.sh

View File

@ -0,0 +1,22 @@
From 1cc57edaf56f309d6023f6fa5a86821f6dfbf919 Mon Sep 17 00:00:00 2001
From: Will Woods <wwoods@redhat.com>
Date: Wed, 11 Jan 2012 12:48:27 -0500
Subject: [PATCH] interpret 'off' as false in getargbool
Signed-off-by: Will Woods <wwoods@redhat.com>
---
modules.d/99base/dracut-lib.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index b4fb435..4897a3d 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -124,6 +124,7 @@ getargbool() {
if [ -n "$_b" ]; then
[ $_b = "0" ] && return 1
[ $_b = "no" ] && return 1
+ [ $_b = "off" ] && return 1
fi
return 0
}

View File

@ -0,0 +1,41 @@
From a75c3afe685e563f919a1a87e0a12c996cfae735 Mon Sep 17 00:00:00 2001
From: Will Woods <wwoods@redhat.com>
Date: Wed, 11 Jan 2012 12:48:28 -0500
Subject: [PATCH] minor cleanups in parsing for dmsquash-live and livenet
- use wait_for_dev in livenet
- clarify log message and fix missing newline in dmsquash-live
Signed-off-by: Will Woods <wwoods@redhat.com>
---
modules.d/90dmsquash-live/parse-dmsquash-live.sh | 4 ++--
modules.d/90livenet/parse-livenet.sh | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules.d/90dmsquash-live/parse-dmsquash-live.sh b/modules.d/90dmsquash-live/parse-dmsquash-live.sh
index 920647e..5ccc0d0 100755
--- a/modules.d/90dmsquash-live/parse-dmsquash-live.sh
+++ b/modules.d/90dmsquash-live/parse-dmsquash-live.sh
@@ -43,9 +43,9 @@ case "$liveroot" in
live:/*.[Ii][Mm][Gg]|/*.[Ii][Mm][Gg])
[ -f "${root#live:}" ] && rootok=1 ;;
esac
-info "liveroot was $liveroot, is now $root"
+info "root was $liveroot, is now $root"
# make sure that init doesn't complain
[ -z "$root" ] && root="live"
-wait_for_dev /dev/mapper/live-rw
\ No newline at end of file
+wait_for_dev /dev/mapper/live-rw
diff --git a/modules.d/90livenet/parse-livenet.sh b/modules.d/90livenet/parse-livenet.sh
index 323fd4a..2e6bc4b 100755
--- a/modules.d/90livenet/parse-livenet.sh
+++ b/modules.d/90livenet/parse-livenet.sh
@@ -16,4 +16,4 @@ case "$liveurl" in
rootok=1 ;;
esac
-echo '[ -e /dev/root ]' > $hookdir/initqueue/finished/livenet.sh
+wait_for_dev /dev/root

View File

@ -0,0 +1,31 @@
From a996d703e901c307dd9faabd7731d959f47370a4 Mon Sep 17 00:00:00 2001
From: Dave Young <dyoung@redhat.com>
Date: Thu, 12 Jan 2012 16:00:31 +0800
Subject: [PATCH] fstab-sys: mount it in initramfs instead of newroot if mount
point is not found
fstab-sys now also handles device passed by dracut argument "--mount"
The "--mount" mount point is possible not exist in $NEWROOT. Thus mount it
in initramfs if mount point is not exist in real rootfs
---
modules.d/95fstab-sys/mount-sys.sh | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/modules.d/95fstab-sys/mount-sys.sh b/modules.d/95fstab-sys/mount-sys.sh
index a8fbd50..4de7285 100755
--- a/modules.d/95fstab-sys/mount-sys.sh
+++ b/modules.d/95fstab-sys/mount-sys.sh
@@ -20,7 +20,12 @@ fstab_mount() {
fi
_fs=$(det_fs "$_dev" "$_fs")
info "Mounting $_dev"
- mount -v -t $_fs -o $_opts $_dev $NEWROOT/$_mp 2>&1 | vinfo
+ if [[ -d $NEWROOT/$_mp ]]; then
+ mount -v -t $_fs -o $_opts $_dev $NEWROOT/$_mp 2>&1 | vinfo
+ else
+ mkdir -p "$_mp"
+ mount -v -t $_fs -o $_opts $_dev $_mp 2>&1 | vinfo
+ fi
done < $1
return 0
}

23
0036-typo-fix.patch Normal file
View File

@ -0,0 +1,23 @@
From 0de93fa1dae15839fc8738268942622ffb4a6451 Mon Sep 17 00:00:00 2001
From: Hermann Gausterer <git-dracut-2012@mrq1.org>
Date: Mon, 16 Jan 2012 17:19:12 +0100
Subject: [PATCH] typo fix
Signed-off-by: Hermann Gausterer <git-dracut-2012@mrq1.org>
---
modules.d/95iscsi/parse-iscsiroot.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh
index bc7cc5e..40720e8 100755
--- a/modules.d/95iscsi/parse-iscsiroot.sh
+++ b/modules.d/95iscsi/parse-iscsiroot.sh
@@ -40,7 +40,7 @@ if [ -n "$iscsiroot" ] ; then
[ -z "$netroot" ] && netroot=$root
# @deprecated
- echo "Warning: Argument isciroot is deprecated and might be removed in a future"
+ echo "Warning: Argument iscsiroot is deprecated and might be removed in a future"
echo "release. See 'man dracut.kernel' for more information."
# Accept iscsiroot argument?

View File

@ -0,0 +1,29 @@
From e263867f6bbad00697f06a9380e7b7355882aff3 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@fedoraproject.org>
Date: Wed, 11 Jan 2012 10:28:12 +0000
Subject: [PATCH] mktemp was long obsoleted by coreutils
commit 2e55bb35640c5c2b3b5604e06232cc679559defa
Author: Peter Robinson <pbrobinson@gmail.com>
Date: Wed Jan 11 10:28:05 2012 +0000
mktemp was long obsoleted by coreutils
dracut.spec | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
---
dracut.spec | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/dracut.spec b/dracut.spec
index 1c50f37..3986894 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -68,7 +68,6 @@ Requires: filesystem >= 2.1.0
Requires: findutils
Requires: grep
Requires: gzip
-Requires: mktemp >= 1.5-5
Requires: module-init-tools >= 3.7-9
Requires: sed
Requires: udev

View File

@ -10,7 +10,7 @@
Name: dracut
Version: 014
Release: 10.git20111215%{?dist}
Release: 38.git20120117%{?dist}
Summary: Initramfs generator using udev
%if 0%{?fedora} || 0%{?rhel} > 6
@ -32,6 +32,35 @@ Patch5: 0005-dracut.spec-remove-unnecessary-dependencies.patch
Patch6: 0006-TEST-12-RAID-DEG-mkdir-run.patch
Patch7: 0007-99base-dracut-lib.sh-added-inst_mount_hook-add_mount.patch
Patch8: 0008-dracut-add-add-fstab-and-mount-option.patch
Patch9: 0009-mkinitrd-dracut.sh-s-read_args-read_arg-g.patch
Patch10: 0010-Fix-live-update-script-769970.patch
Patch11: 0011-Makefile-set-bindir-to-prefix-bin-rather-than-sbin.patch
Patch12: 0012-Makefile-dash-does-not-like-expansion.patch
Patch13: 0013-mkinitrd-Mention-the-nocompress-option-in-help-outpu.patch
Patch14: 0014-Fix-Unicode-keytable.patch
Patch15: 0015-Handle-compressed-kmods.patch
Patch16: 0016-Only-install-files-from-etc-ld.so.conf.d-directory.patch
Patch17: 0017-plymouth-Include-kms-modules-even-if-they-are-not-cu.patch
Patch18: 0018-kernel-modules-Find-and-ulitmately-dereference-any-s.patch
Patch19: 0019-btrfs-Ensure-crc32c-module-is-installed.patch
Patch20: 0020-resume-Fix-failure-when-invalid-device-passed-via-re.patch
Patch21: 0021-dmsquash-Ensure-the-loop-kernel-module-is-included-a.patch
Patch22: 0022-init-Fix-bogus-message-about-invalid-root-device.patch
Patch23: 0023-udev-Attempt-to-install-any-programs-used-by-udev-ru.patch
Patch24: 0024-98usrmount-mount-usr.sh-Don-t-pass-mount-options-to-.patch
Patch25: 0025-TEST-10-RAID-fixed-TESTDIR-handling.patch
Patch26: 0026-Allow-to-add-mount-points-even-not-in-hostonly-mode.patch
Patch27: 0027-Check-module-dependencies-of-mount-points.patch
Patch28: 0028-Fix-get_maj_min-to-follow-symlink.patch
Patch29: 0029-Pass-device-name-instead-of-major-minor-in-for_each_.patch
Patch30: 0030-nfs-fix-regex-patterns-in-check.patch
Patch31: 0031-lvm-pass-the-correct-rd.lvm.lv-parameter.patch
Patch32: 0032-Create-a-symlink-for-the-live-image-s-base-loop-devi.patch
Patch33: 0033-interpret-off-as-false-in-getargbool.patch
Patch34: 0034-minor-cleanups-in-parsing-for-dmsquash-live-and-live.patch
Patch35: 0035-fstab-sys-mount-it-in-initramfs-instead-of-newroot-i.patch
Patch36: 0036-typo-fix.patch
Patch37: 0037-mktemp-was-long-obsoleted-by-coreutils.patch
BuildArch: noarch
@ -308,6 +337,9 @@ rm -rf $RPM_BUILD_ROOT
%dir /var/lib/dracut/overlay
%changelog
* Tue Jan 17 2012 Harald Hoyer <harald@redhat.com> 014-38.git20120117
- update to latest git
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 014-10.git20111215
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild