[dracut/f16] fixed livenet module wget bug Resolves: rhbz#747632 fixed relative symlink bugs speedup image creati

Harald Hoyer harald at fedoraproject.org
Fri Oct 21 10:24:02 UTC 2011


commit 62b3359bcaf0a9fd06adea347e5e1cfec1f5fe61
Author: Harald Hoyer <harald at redhat.com>
Date:   Fri Oct 21 12:23:50 2011 +0200

    fixed livenet module wget bug
    Resolves: rhbz#747632
    fixed relative symlink bugs
    speedup image creation
    protect against files in current directory

 ...tions-s-emergency-shutdown-shutdown-emerg.patch |   22 ++
 0009-dracut-functions-speed-up-inst_dir.patch      |   41 ++++
 ...tions-new-function-inst_any-d-dest-f1-f2-.patch |   49 ++++
 ...ctions-fix-inst_dir-for-non-absolute-dirs.patch |   22 ++
 ...ild-initramfs-unclear-_mpargs-in-instmods.patch |   43 ++++
 ...nst_simple-inst_dir-make-fast-case-faster.patch |   50 ++++
 ...el_modules-is-a-specialized-filter_kernel.patch |   52 +++++
 ...nstall_kmod_with_fw-make-fast-case-faster.patch |   30 +++
 ...et-filenames-from-stdin-if-no-args-use-it.patch |  239 ++++++++++++++++++++
 0032-instmods-sanity-for-_mpargs.patch             |   38 +++
 ...ctor-out-egrep-of-FATAL-Module-.-not-foun.patch |   67 ++++++
 0035-dracut-cp-with-sparse.patch                   |   36 +++
 ...H-Parameter-expansion-occurs-before-comma.patch |   38 +++
 0070-convert_abs_rel-fixups.patch                  |   54 +++++
 ...unctions-conv-normalize-minor-corrections.patch |   63 +++++
 0090-90livenet-check-for-wget.patch                |   21 ++
 0091-dracut-logger-re-set-debugging.patch          |   75 ++++++
 ...nctions-inst_dir-handle-relative-symlinks.patch |   30 +++
 ...et-module-setup.sh-silence-check-for-wget.patch |   22 ++
 0095-90livenet-do-not-install-by-default.patch     |   22 ++
 ...tions-do-not-install-files-from-current-d.patch |  129 +++++++++++
 dracut.spec                                        |   53 ++++-
 22 files changed, 1194 insertions(+), 2 deletions(-)
---
diff --git a/0006-dracut-functions-s-emergency-shutdown-shutdown-emerg.patch b/0006-dracut-functions-s-emergency-shutdown-shutdown-emerg.patch
new file mode 100644
index 0000000..9031e67
--- /dev/null
+++ b/0006-dracut-functions-s-emergency-shutdown-shutdown-emerg.patch
@@ -0,0 +1,22 @@
+From d670e21998f8b13c6b266e29bcc80db55d19f8c8 Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald at redhat.com>
+Date: Wed, 17 Aug 2011 17:40:59 +0200
+Subject: [PATCH] dracut-functions: s/emergency-shutdown/shutdown-emergency/g
+
+---
+ dracut-functions |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/dracut-functions b/dracut-functions
+index 936d3c3..241d89a 100755
+--- a/dracut-functions
++++ b/dracut-functions
+@@ -518,7 +518,7 @@ inst() {
+ 
+ [[ $hookdirs ]] || {
+     hookdirs="cmdline pre-udev pre-trigger netroot initqueue pre-mount"
+-    hookdirs+=" pre-pivot mount emergency emergency-shutdown shutdown"
++    hookdirs+=" pre-pivot mount emergency shutdown-emergency shutdown"
+     export hookdirs
+ }
+ 
diff --git a/0009-dracut-functions-speed-up-inst_dir.patch b/0009-dracut-functions-speed-up-inst_dir.patch
new file mode 100644
index 0000000..4105200
--- /dev/null
+++ b/0009-dracut-functions-speed-up-inst_dir.patch
@@ -0,0 +1,41 @@
+From a76dc2780143a4b04eb33a6699ec2ca7a7898b65 Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald at redhat.com>
+Date: Fri, 19 Aug 2011 10:24:49 +0200
+Subject: [PATCH] dracut-functions: speed up inst_dir()
+
+---
+ dracut-functions |   18 +++++++++---------
+ 1 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/dracut-functions b/dracut-functions
+index 241d89a..d7f2e5f 100755
+--- a/dracut-functions
++++ b/dracut-functions
+@@ -274,18 +274,18 @@ inst_dir() {
+     local _oldifs="$IFS"
+     local _part
+     local _dir="$1"
+-    IFS="/"
+-    set -- $_dir
+-    IFS=$_oldifs
+-    _dir="$@"
++
++    # fast out
+     [[ -e ${initdir}$_dir ]] && return 0
+ 
+-    # iterate over parent directories
+-    for _part in $_dir; do
+-        [[ $_part ]] || continue
+-        _file="$_file/$_part"
+-        [[ -e ${initdir}$_file ]] && continue
++    _part=${_dir%/*}
++    while ! [[ -e "${initdir}${_part}" ]]; do
++        _dir="$_part $_dir"
++        _part=${_part%/*}
++    done
+ 
++    # iterate over parent directories
++    for _file in $_dir; do
+         if [[ -L $_file ]]; then
+             # create link as the original
+             local target=$(readlink -f "$_file")
diff --git a/0012-dracut-functions-new-function-inst_any-d-dest-f1-f2-.patch b/0012-dracut-functions-new-function-inst_any-d-dest-f1-f2-.patch
new file mode 100644
index 0000000..a9558a5
--- /dev/null
+++ b/0012-dracut-functions-new-function-inst_any-d-dest-f1-f2-.patch
@@ -0,0 +1,49 @@
+From 3378a54f15016c86e4c8c2ecafcaa45f0119fc00 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe at aidecoe.name>
+Date: Sun, 21 Aug 2011 12:47:13 +0200
+Subject: [PATCH] dracut-functions: new function: inst_any [-d dest] f1 [f2
+ [f3 ...]]
+
+---
+ dracut-functions |   28 ++++++++++++++++++++++++++++
+ 1 files changed, 28 insertions(+), 0 deletions(-)
+
+diff --git a/dracut-functions b/dracut-functions
+index d7f2e5f..43a6843 100755
+--- a/dracut-functions
++++ b/dracut-functions
+@@ -537,6 +537,34 @@ inst_hook() {
+     inst_simple "$3" "/lib/dracut/hooks/${1}/${2}${3##*/}"
+ }
+ 
++# install any of listed files
++#
++# If first argument is '-d' and second some destination path, first accessible
++# source is installed into this path, otherwise it will installed in the same
++# path as source.  If none of listed files was installed, function return 1.
++# On first successful installation it returns with 0 status.
++#
++# Example:
++#
++# inst_any -d /bin/foo /bin/bar /bin/baz
++#
++# Lets assume that /bin/baz exists, so it will be installed as /bin/foo in
++# initramfs.
++inst_any() {
++    local to f
++
++    [[ $1 = '-d' ]] && to="$2" && shift 2
++
++    for f in "$@"; do
++        if [[ -e $f ]]; then
++            [[ $to ]] && inst "$f" "$to" && return 0
++            inst "$f" && return 0
++        fi
++    done
++
++    return 1
++}
++
+ dracut_install() {
+     local _optional=no
+     if [[ $1 = '-o' ]]; then
diff --git a/0017-dracut-functions-fix-inst_dir-for-non-absolute-dirs.patch b/0017-dracut-functions-fix-inst_dir-for-non-absolute-dirs.patch
new file mode 100644
index 0000000..5c8fabc
--- /dev/null
+++ b/0017-dracut-functions-fix-inst_dir-for-non-absolute-dirs.patch
@@ -0,0 +1,22 @@
+From 8cf621ffd98984f44e2861969d9ed58be7233d4e Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald at redhat.com>
+Date: Tue, 23 Aug 2011 12:50:03 +0200
+Subject: [PATCH] dracut-functions: fix inst_dir() for non-absolute dirs
+
+---
+ dracut-functions |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/dracut-functions b/dracut-functions
+index 43a6843..a3340e4 100755
+--- a/dracut-functions
++++ b/dracut-functions
+@@ -279,7 +279,7 @@ inst_dir() {
+     [[ -e ${initdir}$_dir ]] && return 0
+ 
+     _part=${_dir%/*}
+-    while ! [[ -e "${initdir}${_part}" ]]; do
++    while [[ "$_part" != "${_part%/*}" ]] && ! [[ -e "${initdir}${_part}" ]]; do
+         _dir="$_part $_dir"
+         _part=${_part%/*}
+     done
diff --git a/0022-build-initramfs-unclear-_mpargs-in-instmods.patch b/0022-build-initramfs-unclear-_mpargs-in-instmods.patch
new file mode 100644
index 0000000..b8fe96b
--- /dev/null
+++ b/0022-build-initramfs-unclear-_mpargs-in-instmods.patch
@@ -0,0 +1,43 @@
+From f4ca564ba67d5821b756727689664604e76d1cdf Mon Sep 17 00:00:00 2001
+From: John Reiser <jreiser at bitwagon.com>
+Date: Mon, 29 Aug 2011 14:42:15 -0700
+Subject: [PATCH] build initramfs: unclear _mpargs in instmods()
+
+The local variable _mpargs in function instmods() in file dracut-functions
+looks peculiar.  The documentation is non-existent, but still ...
+
+First, $_mpargs is not passed to modprobe via for_each_kmod_dep.
+This is strange because my guess is that "_mpargs" means
+"extra arguments for modprobe".
+
+Second, the leading "--" will be lopped when a leading pathname
+is stripped via
+	_mod=${_mod##*/}
+It seems to me that a leading "--" should inhibit modification.
+
+Here's the corresponding patch to current HEAD (from dracut-013.)
+---
+ dracut-functions |    3 +--
+ 1 files changed, 1 insertions(+), 2 deletions(-)
+
+diff --git a/dracut-functions b/dracut-functions
+index a3340e4..c28766e 100755
+--- a/dracut-functions
++++ b/dracut-functions
+@@ -919,7 +919,6 @@ instmods() {
+                 fi
+                 ;;
+             --*)
+-                _mod=${_mod##*/}
+                 _mpargs+=" $_mod";;
+             i2o_scsi) shift; continue;; # Do not load this diagnostic-only module
+             *)  _mod=${_mod##*/}
+@@ -942,7 +941,7 @@ instmods() {
+                 # ok, load the module, all its dependencies, and any firmware
+                 # it may require
+                 for_each_kmod_dep install_kmod_with_fw $_mod \
+-                    --set-version $kernel ${_moddirname}
++                    --set-version $kernel ${_moddirname} $_mpargs
+                 ((_ret+=$?))
+                 ;;
+         esac
diff --git a/0028-inst_simple-inst_dir-make-fast-case-faster.patch b/0028-inst_simple-inst_dir-make-fast-case-faster.patch
new file mode 100644
index 0000000..c111f84
--- /dev/null
+++ b/0028-inst_simple-inst_dir-make-fast-case-faster.patch
@@ -0,0 +1,50 @@
+From 3f590c7840bb0897154f66a277be6bfaa63677bd Mon Sep 17 00:00:00 2001
+From: John Reiser <jreiser at BitWagon.com>
+Date: Fri, 26 Aug 2011 13:01:33 -0700
+Subject: [PATCH] inst_simple, inst_dir: make fast case faster
+
+This small stuff saves 1.7% per dropped statement during "dracut --profile".
+Fixing the comment about /lib -> lib64 is REQUIRED!
+---
+ dracut-functions |   16 +++++-----------
+ 1 files changed, 5 insertions(+), 11 deletions(-)
+
+diff --git a/dracut-functions b/dracut-functions
+index 3edd4c7..f41fc7d 100755
+--- a/dracut-functions
++++ b/dracut-functions
+@@ -266,19 +266,13 @@ check_vol_slaves() {
+ }
+ 
+ # Install a directory, keeping symlinks as on the original system.
+-# Example: if /lib64 points to /lib on the host, "inst_dir /lib/file"
++# Example: if /lib points to /lib64 on the host, "inst_dir /lib/file"
+ # will create ${initdir}/lib64, ${initdir}/lib64/file,
+ # and a symlink ${initdir}/lib -> lib64.
+ inst_dir() {
+-    local _file=""
+-    local _oldifs="$IFS"
+-    local _part
+-    local _dir="$1"
++    [[ -e ${initdir}"$1" ]] && return 0  # already there
+ 
+-    # fast out
+-    [[ -e ${initdir}$_dir ]] && return 0
+-
+-    _part=${_dir%/*}
++    local _dir="$1" _part=${_dir%/*} _file
+     while [[ "$_part" != "${_part%/*}" ]] && ! [[ -e "${initdir}${_part}" ]]; do
+         _dir="$_part $_dir"
+         _part=${_part%/*}
+@@ -310,9 +304,9 @@ inst_dir() {
+ # Location of the image dir is assumed to be $initdir
+ # We never overwrite the target if it exists.
+ inst_simple() {
+-    local _src target
+     [[ -f $1 ]] || return 1
+-    _src=$1 target="${2:-$1}"
++
++    local _src=$1 target="${2:-$1}"
+     if ! [[ -d ${initdir}$target ]]; then
+         [[ -e ${initdir}$target ]] && return 0
+         [[ -h ${initdir}$target ]] && return 0
diff --git a/0029-filter_kernel_modules-is-a-specialized-filter_kernel.patch b/0029-filter_kernel_modules-is-a-specialized-filter_kernel.patch
new file mode 100644
index 0000000..2816110
--- /dev/null
+++ b/0029-filter_kernel_modules-is-a-specialized-filter_kernel.patch
@@ -0,0 +1,52 @@
+From ceebd9ac769dcb869529d57fdb155cf7199251f8 Mon Sep 17 00:00:00 2001
+From: John Reiser <jreiser at BitWagon.com>
+Date: Sat, 27 Aug 2011 14:43:49 -0700
+Subject: [PATCH] filter_kernel_modules is a specialized
+ filter_kernel_modules_by_path
+
+---
+ dracut-functions |   31 +++----------------------------
+ 1 files changed, 3 insertions(+), 28 deletions(-)
+
+diff --git a/dracut-functions b/dracut-functions
+index f41fc7d..a72aa53 100755
+--- a/dracut-functions
++++ b/dracut-functions
+@@ -863,34 +863,9 @@ filter_kernel_modules_by_path () (
+     done
+ )
+ 
+-# filter kernel modules to install certain modules that meet specific
+-# requirements.
+-# $1 = function to call with module name to filter.
+-#      This function will be passed the full path to the module to test.
+-# The behaviour of this function can vary depending on whether $hostonly is set.
+-# If it is, we will only look at modules that are already in memory.
+-# If it is not, we will look at all kernel modules
+-# This function returns the full filenames of modules that match $1
+-filter_kernel_modules () (
+-    local _modname _filtercmd
+-    if ! [[ $hostonly ]]; then
+-        _filtercmd='find "$srcmods/kernel/drivers" "$srcmods/extra"'
+-        _filtercmd+=' "$srcmods/weak-updates" -name "*.ko" -o -name "*.ko.gz"'
+-        _filtercmd+=' 2>/dev/null'
+-    else
+-        _filtercmd='cut -d " " -f 1 </proc/modules|xargs modinfo -F filename '
+-        _filtercmd+='-k $kernel 2>/dev/null'
+-    fi
+-    for _modname in $(eval $_filtercmd); do
+-        case $_modname in
+-            *.ko) "$1" "$_modname" && echo "$_modname";;
+-            *.ko.gz) gzip -dc "$_modname" > $initdir/$$.ko
+-                $1 $initdir/$$.ko && echo "$_modname"
+-                rm -f $initdir/$$.ko
+-                ;;
+-        esac
+-    done
+-)
++filter_kernel_modules () {
++    filter_kernel_modules_by_path  drivers  "$1"
++}
+ 
+ # install kernel modules along with all their dependencies.
+ instmods() {
diff --git a/0030-install_kmod_with_fw-make-fast-case-faster.patch b/0030-install_kmod_with_fw-make-fast-case-faster.patch
new file mode 100644
index 0000000..892bf70
--- /dev/null
+++ b/0030-install_kmod_with_fw-make-fast-case-faster.patch
@@ -0,0 +1,30 @@
+From e6024e0030bcf35b0f0c97cdc6f259711536459b Mon Sep 17 00:00:00 2001
+From: John Reiser <jreiser at BitWagon.com>
+Date: Sun, 28 Aug 2011 13:24:58 -0700
+Subject: [PATCH] install_kmod_with_fw: make fast case faster
+
+---
+ dracut-functions |    5 +++--
+ 1 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/dracut-functions b/dracut-functions
+index a72aa53..4d3317c 100755
+--- a/dracut-functions
++++ b/dracut-functions
+@@ -782,13 +782,14 @@ check_module_dir() {
+ # Install a single kernel module along with any firmware it may require.
+ # $1 = full path to kernel module to install
+ install_kmod_with_fw() {
+-    local _modname=${1##*/} _fwdir _found _fw
+-    _modname=${_modname%.ko*}
+     # no need to go further if the module is already installed
+     [[ -e "${initdir}/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" ]] \
+         && return 0
+     inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" \
+         || return $?
++
++    local _modname=${1##*/} _fwdir _found _fw
++    _modname=${_modname%.ko*}
+     for _fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do
+         _found=''
+         for _fwdir in $fw_dir; do
diff --git a/0031-instmods-get-filenames-from-stdin-if-no-args-use-it.patch b/0031-instmods-get-filenames-from-stdin-if-no-args-use-it.patch
new file mode 100644
index 0000000..c3781e6
--- /dev/null
+++ b/0031-instmods-get-filenames-from-stdin-if-no-args-use-it.patch
@@ -0,0 +1,239 @@
+From 881eda695ed552474b9d1e5befe084d7bfab3d50 Mon Sep 17 00:00:00 2001
+From: John Reiser <jreiser at BitWagon.com>
+Date: Mon, 29 Aug 2011 13:40:21 -0700
+Subject: [PATCH] instmods: get filenames from stdin if no args; use it
+
+Use bash  "[[ string =~ pattern ]]"  instead of "egrep -q".
+Replace control-dominated serial fondling
+	for var in $(proc1); do proc2 var; done
+with data-dominated parallel pipeline
+	proc1  |  while read var; do proc2 var; done
+Together this is a large savings.
+
+[harald at redhat.com: fixed network kernel module filter]
+---
+ dracut-functions                           |   57 ++++++++++++++++++++--------
+ modules.d/40network/module-setup.sh        |   19 +++++++--
+ modules.d/90kernel-modules/module-setup.sh |   11 +++++-
+ modules.d/90multipath/module-setup.sh      |   15 +++++--
+ modules.d/95iscsi/module-setup.sh          |   12 ++++-
+ 5 files changed, 84 insertions(+), 30 deletions(-)
+
+diff --git a/dracut-functions b/dracut-functions
+index 4d3317c..556d309 100755
+--- a/dracut-functions
++++ b/dracut-functions
+@@ -863,49 +863,63 @@ filter_kernel_modules_by_path () (
+         esac
+     done
+ )
++find_kernel_modules_by_path () (
++    if ! [[ $hostonly ]]; then
++        find "$srcmods/kernel/$1" "$srcmods/extra" "$srcmods/weak-updates" \
++          -name "*.ko" -o -name "*.ko.gz" 2>/dev/null
++    else
++        cut -d " " -f 1 </proc/modules \
++        | xargs modinfo -F filename -k $kernel 2>/dev/null
++    fi
++)
+ 
+ filter_kernel_modules () {
+     filter_kernel_modules_by_path  drivers  "$1"
+ }
+ 
++find_kernel_modules () {
++    find_kernel_modules_by_path  drivers
++}
++
+ # install kernel modules along with all their dependencies.
+ instmods() {
+     [[ $no_kernel = yes ]] && return
+-    local _mod _mpargs _moddirname
+-    local _ret=0
+-    while (($# > 0)); do
+-        _mod=${1%.ko*}
++
++    function inst1mod() {
++        local _mod="$1"
+         case $_mod in
+             =*)
+                 # This introduces 2 incompatible meanings for =* arguments
+                 # to instmods.  We need to decide which one to keep.
+                 if [[ $_mod = =ata && -f $srcmods/modules.block ]]; then
+-                    instmods $_mpargs \
+-                        $(egrep 'ata|ahci' "${srcmods}/modules.block")
++                    ( echo -n "$_mpargs"; egrep 'ata|ahci' "${srcmods}/modules.block" ) \
++                    | instmods
+                 elif [ -f $srcmods/modules.${_mod#=} ]; then
+-                    instmods $_mpargs $(cat ${srcmods}/modules.${_mod#=} )
++                    ( echo -n "$_mpargs"; cat "${srcmods}/modules.${_mod#=}" ) \
++                    | instmods
+                 else
+-                    instmods $_mpargs $(find "$srcmods" -path "*/${_mod#=}/*")
++                    ( echo -n "$_mpargs"; find "$srcmods" -path "*/${_mod#=}/*" ) \
++                    | instmods
+                 fi
+                 ;;
+-            --*)
+-                _mpargs+=" $_mod";;
+-            i2o_scsi) shift; continue;; # Do not load this diagnostic-only module
++            --*) _mpargs+="${_mod##*/}"$'\n' ;;  # one _mod per line; lops '--'
++            i2o_scsi) return ;; # Do not load this diagnostic-only module
+             *)  _mod=${_mod##*/}
++
+                 # if we are already installed, skip this module and go on
+                 # to the next one.
+-                [[ -f $initdir/$1 ]] && { shift; continue; }
++                [[ -f $initdir/$1 ]] && return
++
+                 # If we are building a host-specific initramfs and this
+                 # module is not already loaded, move on to the next one.
+                 [[ $hostonly ]] && ! grep -qe "\<${_mod//-/_}\>" /proc/modules \
+-                    && ! echo $add_drivers | grep -qe "\<${_mod}\>" && {
+-                        shift; continue
+-                    }
++                    && ! echo $add_drivers | grep -qe "\<${_mod}\>" \
++                    && return
+ 
+                 # We use '-d' option in modprobe only if modules prefix path
+                 # differs from default '/'.  This allows us to use Dracut with
+                 # old version of modprobe which doesn't have '-d' option.
+-                _moddirname=${srcmods%%/lib/modules/*}
++                local _moddirname=${srcmods%%/lib/modules/*}
+                 [[ -n ${_moddirname} ]] && _moddirname="-d ${_moddirname}/"
+ 
+                 # ok, load the module, all its dependencies, and any firmware
+@@ -915,6 +929,17 @@ instmods() {
+                 ((_ret+=$?))
+                 ;;
+         esac
++    }
++
++    local _mpargs _ret=0
++    if (($# == 0)); then  # filenames from stdin
++        local _mod
++        while read _mod; do
++            inst1mod "${_mod%.ko*}"
++        done
++    fi
++    while (($# > 0)); do  # filenames as args
++        inst1mod ${1%.ko*}
+         shift
+     done
+     return $_ret
+diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh
+index 39366b6..cb81269 100755
+--- a/modules.d/40network/module-setup.sh
++++ b/modules.d/40network/module-setup.sh
+@@ -24,15 +24,24 @@ depends() {
+ installkernel() {
+     # Include wired net drivers, excluding wireless
+ 
+-    net_module_test() {
++    net_module_filter() {
+         local _net_drivers='eth_type_trans|register_virtio_device'
+         local _unwanted_drivers='/(wireless|isdn|uwb)/'
+-        egrep -q $_net_drivers "$1" && \
+-            egrep -qv 'iw_handler_get_spy' "$1" && \
+-            [[ ! $1 =~ $_unwanted_drivers ]]
++        local _fname
++        while read _fname; do
++            local _fcont
++            case "$_fname" in
++                *.ko)    _fcont="$(<        $_fname)" ;;
++                *.ko.gz) _fcont="$(gzip -dc $_fname)" ;;
++            esac
++            [[   $_fcont =~ $_net_drivers
++            && ! $_fcont =~ iw_handler_get_spy \
++            && ! $_fname =~ $_unwanted_drivers ]] \
++            && echo "$_fname"
++        done
+     }
+ 
+-    instmods $(filter_kernel_modules_by_path drivers/net net_module_test)
++    find_kernel_modules_by_path drivers/net | net_module_filter | instmods
+ 
+     instmods ecb arc4
+     # bridge modules
+diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh
+index 245ec0b..9fc4248 100755
+--- a/modules.d/90kernel-modules/module-setup.sh
++++ b/modules.d/90kernel-modules/module-setup.sh
+@@ -9,6 +9,15 @@ installkernel() {
+ 
+             egrep -q "$blockfuncs" "$1"
+         }
++        block_module_filter() {
++            local _blockfuncs='ahci_init_controller|ata_scsi_ioctl|scsi_add_host|blk_init_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device'
++            local _f
++            while read _f; do case "$_f" in
++                *.ko)    [[ $(<         $_f) =~ $_blockfuncs ]] && echo "$_f" ;;
++                *.ko.gz) [[ $(gzip -dc <$_f) =~ $_blockfuncs ]] && echo "$_f" ;;
++                esac
++            done
++        }
+         hostonly='' instmods sr_mod sd_mod scsi_dh scsi_dh_rdac scsi_dh_emc
+         hostonly='' instmods pcmcia firewire-ohci
+         hostonly='' instmods usb_storage sdhci sdhci-pci
+@@ -18,7 +27,7 @@ installkernel() {
+         # install unix socket support
+         hostonly='' instmods unix
+         instmods "=drivers/pcmcia" =ide "=drivers/usb/storage"
+-        instmods $(filter_kernel_modules block_module_test)
++        find_kernel_modules  |  block_module_filter  |  instmods
+         # if not on hostonly mode, install all known filesystems,
+         # if the required list is not set via the filesystems variable
+         if ! [[ $hostonly ]]; then
+diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
+index e9a47fc..f68b58d 100755
+--- a/modules.d/90multipath/module-setup.sh
++++ b/modules.d/90multipath/module-setup.sh
+@@ -33,13 +33,18 @@ depends() {
+ }
+ 
+ installkernel() {
+-    mp_mod_test() {
+-        local mpfuncs='scsi_register_device_handler|dm_dirty_log_type_register|dm_register_path_selector|dm_register_target'
+-        egrep -q "$mpfuncs" "$1"
++    mp_mod_filter() {
++        local _mpfuncs='scsi_register_device_handler|dm_dirty_log_type_register|dm_register_path_selector|dm_register_target'
++        local _f
++        while read _f; do case "$_f" in
++            *.ko)    [[ $(<         $_f) =~ $_mpfuncs ]] && echo "$_f" ;;
++            *.ko.gz) [[ $(gzip -dc <$_f) =~ $_mpfuncs ]] && echo "$_f" ;;
++            esac
++        done
+     }
+ 
+-    instmods $(filter_kernel_modules_by_path drivers/scsi mp_mod_test)
+-    instmods $(filter_kernel_modules_by_path drivers/md mp_mod_test)
++    ( find_kernel_modules_by_path drivers/scsi;
++      find_kernel_modules_by_path drivers/md )  |  mp_mod_filter  |  instmods
+ }
+ 
+ install() {
+diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
+index 3db40ea..b7771ab 100755
+--- a/modules.d/95iscsi/module-setup.sh
++++ b/modules.d/95iscsi/module-setup.sh
+@@ -42,11 +42,17 @@ depends() {
+ 
+ installkernel() {
+     instmods iscsi_tcp iscsi_ibft crc32c
+-    iscsi_module_test() {
++    iscsi_module_filter() {
+         local _iscsifuncs='iscsi_register_transport'
+-        fgrep -q "$_iscsifuncs" "$1"
++        local _f
++        while read _f; do case "$_f" in
++            *.ko)    [[ $(<         $_f) =~ $_iscsifuncs ]] && echo "$_f" ;;
++            *.ko.gz) [[ $(gzip -dc <$_f) =~ $_iscsifuncs ]] && echo "$_f" ;;
++            esac
++        done
+     }
+-    instmods $(filter_kernel_modules_by_path drivers/scsi iscsi_module_test)
++    find_kernel_modules_by_path drivers/scsi \
++    | iscsi_module_filter  |  instmods
+ }
+ 
+ install() {
diff --git a/0032-instmods-sanity-for-_mpargs.patch b/0032-instmods-sanity-for-_mpargs.patch
new file mode 100644
index 0000000..cda1227
--- /dev/null
+++ b/0032-instmods-sanity-for-_mpargs.patch
@@ -0,0 +1,38 @@
+From 0024702fe7551e0de8180a5b514b31f57b4fc213 Mon Sep 17 00:00:00 2001
+From: John Reiser <jreiser at BitWagon.com>
+Date: Mon, 29 Aug 2011 14:46:25 -0700
+Subject: [PATCH] instmods: sanity for _mpargs
+
+---
+ dracut-functions |   11 +++++++----
+ 1 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/dracut-functions b/dracut-functions
+index 556d309..6c16cae 100755
+--- a/dracut-functions
++++ b/dracut-functions
+@@ -892,17 +892,20 @@ instmods() {
+                 # This introduces 2 incompatible meanings for =* arguments
+                 # to instmods.  We need to decide which one to keep.
+                 if [[ $_mod = =ata && -f $srcmods/modules.block ]]; then
+-                    ( echo -n "$_mpargs"; egrep 'ata|ahci' "${srcmods}/modules.block" ) \
++                    ( [[ "$_mpargs" ]] && echo $_mpargs
++                      egrep 'ata|ahci' "${srcmods}/modules.block" ) \
+                     | instmods
+                 elif [ -f $srcmods/modules.${_mod#=} ]; then
+-                    ( echo -n "$_mpargs"; cat "${srcmods}/modules.${_mod#=}" ) \
++                    ( [[ "$_mpargs" ]] && echo $_mpargs
++                      cat "${srcmods}/modules.${_mod#=}" ) \
+                     | instmods
+                 else
+-                    ( echo -n "$_mpargs"; find "$srcmods" -path "*/${_mod#=}/*" ) \
++                    ( [[ "$_mpargs" ]] && echo $_mpargs
++                      find "$srcmods" -path "*/${_mod#=}/*" ) \
+                     | instmods
+                 fi
+                 ;;
+-            --*) _mpargs+="${_mod##*/}"$'\n' ;;  # one _mod per line; lops '--'
++            --*) _mpargs+=" $_mod" ;;
+             i2o_scsi) return ;; # Do not load this diagnostic-only module
+             *)  _mod=${_mod##*/}
+ 
diff --git a/0033-instmods-factor-out-egrep-of-FATAL-Module-.-not-foun.patch b/0033-instmods-factor-out-egrep-of-FATAL-Module-.-not-foun.patch
new file mode 100644
index 0000000..647c8e4
--- /dev/null
+++ b/0033-instmods-factor-out-egrep-of-FATAL-Module-.-not-foun.patch
@@ -0,0 +1,67 @@
+From f9708da22345aa11bfa0d5514eefef11f542526b Mon Sep 17 00:00:00 2001
+From: John Reiser <jreiser at BitWagon.com>
+Date: Mon, 29 Aug 2011 16:03:35 -0700
+Subject: [PATCH] instmods: factor out egrep of "FATAL: Module .* not found"
+
+---
+ dracut-functions |   34 +++++++++++++++++++---------------
+ 1 files changed, 19 insertions(+), 15 deletions(-)
+
+diff --git a/dracut-functions b/dracut-functions
+index 6c16cae..507f0c3 100755
+--- a/dracut-functions
++++ b/dracut-functions
+@@ -820,7 +820,7 @@ install_kmod_with_fw() {
+ for_each_kmod_dep() {
+     local _func=$1 _kmod=$2 _cmd _modpath _options _found=0
+     shift 2
+-    modprobe "$@" --ignore-install --show-depends $_kmod 2>"$initdir/modprobe.err" | (
++    modprobe "$@" --ignore-install --show-depends $_kmod 2>&$modprobe_stderr | (
+         while read _cmd _modpath _options; do
+             [[ $_cmd = insmod ]] || continue
+             $_func ${_modpath} || exit $?
+@@ -829,9 +829,6 @@ for_each_kmod_dep() {
+         [[ $_found -eq 0 ]] && exit 1
+         exit 0
+     )
+-    egrep -v 'FATAL: Module .* not found.' "$initdir/modprobe.err" | derror
+-    rm -f "$initdir/modprobe.err"
+-    return $?
+ }
+ 
+ # filter kernel modules to install certain modules that meet specific
+@@ -934,16 +931,23 @@ instmods() {
+         esac
+     }
+ 
+-    local _mpargs _ret=0
+-    if (($# == 0)); then  # filenames from stdin
+-        local _mod
+-        while read _mod; do
+-            inst1mod "${_mod%.ko*}"
++    function instmods_1() {
++        local _ret=0 _mod _mpargs
++        if (($# == 0)); then  # filenames from stdin
++            while read _mod; do
++                inst1mod "${_mod%.ko*}"
++            done
++        fi
++        while (($# > 0)); do  # filenames as arguments
++            inst1mod ${1%.ko*}
++            shift
+         done
+-    fi
+-    while (($# > 0)); do  # filenames as args
+-        inst1mod ${1%.ko*}
+-        shift
+-    done
+-    return $_ret
++        return $_ret
++    }
++
++    # Capture all stderr from modprobe onto a new fd $modprobe_stderr,
++    # and pipe it into egrep.  See REDIRECTION in bash manpage.
++    ( instmods_1 "$@" ) {modprobe_stderr}>&1 \
++    | egrep -v 'FATAL: Module .* not found.' | derror
++    return $?
+ }
diff --git a/0035-dracut-cp-with-sparse.patch b/0035-dracut-cp-with-sparse.patch
new file mode 100644
index 0000000..022a6df
--- /dev/null
+++ b/0035-dracut-cp-with-sparse.patch
@@ -0,0 +1,36 @@
+From 59f288ce631a7793755d16ee26fef0355098d33a Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald at redhat.com>
+Date: Fri, 2 Sep 2011 09:01:47 +0200
+Subject: [PATCH] dracut: cp with sparse
+
+---
+ dracut           |    2 +-
+ dracut-functions |    2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/dracut b/dracut
+index fd36805..0e930c7 100755
+--- a/dracut
++++ b/dracut
+@@ -650,7 +650,7 @@ if strstr "$modules_loaded" " fips " && command -v prelink >/dev/null; then
+     done
+ fi
+ 
+-if ! ( cd "$initdir"; find . |cpio -R 0:0 -H newc -o --quiet | \
++if ! ( cd "$initdir"; find . |cpio -R 0:0 -H newc -o --quiet| \
+     $compress > "$outfile"; ); then
+     dfatal "dracut: creation of $outfile failed"
+     exit 1
+diff --git a/dracut-functions b/dracut-functions
+index 507f0c3..b11e37c 100755
+--- a/dracut-functions
++++ b/dracut-functions
+@@ -317,7 +317,7 @@ inst_simple() {
+         inst "${_src%/*}/.${_src##*/}.hmac" "${target%/*}/.${target##*/}.hmac"
+     fi
+     ddebug "Installing $_src"
+-    cp -pfL "$_src" "${initdir}$target" 
++    cp --sparse=always -pfL "$_src" "${initdir}$target" 
+ }
+ 
+ # find symlinks linked to given library file
diff --git a/0062-dracut-PATCH-Parameter-expansion-occurs-before-comma.patch b/0062-dracut-PATCH-Parameter-expansion-occurs-before-comma.patch
new file mode 100644
index 0000000..ac62617
--- /dev/null
+++ b/0062-dracut-PATCH-Parameter-expansion-occurs-before-comma.patch
@@ -0,0 +1,38 @@
+From 9e103df45e4ca2c2392cedf3c9ecb84713962838 Mon Sep 17 00:00:00 2001
+From: John Reiser <jreiser at bitwagon.com>
+Date: Fri, 23 Sep 2011 08:02:23 -0700
+Subject: [PATCH] dracut [PATCH] Parameter expansion occurs before command
+ evaluation.
+
+Bash shell expands all ${parameter} before evaluating a command.
+For multiple declarations and assignments within the same 'local' command,
+then new variables or new values that appear towards the left
+do not affect parameter expansion towards the right.
+
+--
+John Reiser, jreiser at BitWagon.com
+
+>From 507ad6f66fc66f868a9e5fdd3806e012c4022baa Mon Sep 17 00:00:00 2001
+From: John Reiser <jreiser at BitWagon.com>
+Date: Fri, 23 Sep 2011 07:37:43 -0700
+Subject: [PATCH] Parameter expansion occurs before command evaluation.
+
+${parameter} on the right is expanded before evaluating "local var=value"
+on the left.
+---
+ dracut-functions |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/dracut-functions b/dracut-functions
+index 5508809..c4f7f61 100755
+--- a/dracut-functions
++++ b/dracut-functions
+@@ -272,7 +272,7 @@ check_vol_slaves() {
+ inst_dir() {
+     [[ -e ${initdir}"$1" ]] && return 0  # already there
+ 
+-    local _dir="$1" _part=${_dir%/*} _file
++    local _dir="$1" _part="${1%/*}" _file
+     while [[ "$_part" != "${_part%/*}" ]] && ! [[ -e "${initdir}${_part}" ]]; do
+         _dir="$_part $_dir"
+         _part=${_part%/*}
diff --git a/0070-convert_abs_rel-fixups.patch b/0070-convert_abs_rel-fixups.patch
new file mode 100644
index 0000000..592d9fe
--- /dev/null
+++ b/0070-convert_abs_rel-fixups.patch
@@ -0,0 +1,54 @@
+From c1609dd497bb8f8f083a258ff2f7702385eb940b Mon Sep 17 00:00:00 2001
+From: Michal Soltys <soltys at ziu.info>
+Date: Fri, 7 Oct 2011 22:23:49 +0200
+Subject: [PATCH] convert_abs_rel() fixups
+
+- IFS was not preserved, and modified value could leak to outside functions
+
+- the '.' relative path should be returned for arguments such as /x/y/z
+  /x/y - but not for $1 == $2 ones
+
+- $1 == $2 is self-looping link, so it returns final component of its
+  name
+
+Signed-off-by: Michal Soltys <soltys at ziu.info>
+---
+ dracut-functions |   18 +++++++++++-------
+ 1 files changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/dracut-functions b/dracut-functions
+index c4f7f61..12dfa70 100755
+--- a/dracut-functions
++++ b/dracut-functions
+@@ -91,20 +91,24 @@ normalize_path() {
+ }
+ 
+ convert_abs_rel() {
+-    local __current __absolute __abssize __cursize __i __level __newpath
++    local __current __absolute __abssize __cursize __newpath="" __oldifs
++    local -i __i __level=0
+ #    PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ';
+ 
+-    if [[ "$1" == "$2" ]]
+-    then
+-        echo "."
+-        return
+-    fi
++    # corner case #1 - self looping link
++    [[ "$1" == "$2" ]] && { echo "${1##*/}"; return; }
++
++    # corner case #2 - own dir link
++    [[ "${1%/*}" == "$2" ]] && { echo "."; return; }
++
+     __current=$(normalize_path "$1")
+     __absolute=$(normalize_path "$2")
+-    IFS="/"
+ 
++    __oldifs="$IFS"
++    IFS="/"
+     __current=($__current)
+     __absolute=($__absolute)
++    IFS="$__oldifs"
+ 
+     __abssize=${#__absolute[@]}
+     __cursize=${#__current[@]}
diff --git a/0074-dracut-functions-conv-normalize-minor-corrections.patch b/0074-dracut-functions-conv-normalize-minor-corrections.patch
new file mode 100644
index 0000000..0575b00
--- /dev/null
+++ b/0074-dracut-functions-conv-normalize-minor-corrections.patch
@@ -0,0 +1,63 @@
+From c44e3cb4e5ace39247c0a6619668add2d1dc92e8 Mon Sep 17 00:00:00 2001
+From: Michal Soltys <soltys at ziu.info>
+Date: Sat, 8 Oct 2011 00:20:50 +0200
+Subject: [PATCH] dracut-functions: conv/normalize minor corrections
+
+mostly with reference to earlier commit:
+
+- bash doesn't need unsetting locals
+- make normalize_path() a bit faster, also make sure we remove all
+  trailing slashes
+- normalize paths before tests
+
+Signed-off-by: Michal Soltys <soltys at ziu.info>
+---
+ dracut-functions |   22 ++++++++++------------
+ 1 files changed, 10 insertions(+), 12 deletions(-)
+
+diff --git a/dracut-functions b/dracut-functions
+index 12dfa70..ce593c9 100755
+--- a/dracut-functions
++++ b/dracut-functions
+@@ -83,31 +83,29 @@ print_vars() {
+ }
+ 
+ normalize_path() {
+-    p=$1
+-    while [[ ${p#*//*} != $p ]]; do
+-        p=${p/\/\///}
+-    done
+-    echo $p
++    shopt -q -s extglob
++    set -- "${1//+(\/)//}"
++    shopt -q -u extglob
++    echo "${1%/}"
+ }
+ 
+ convert_abs_rel() {
+-    local __current __absolute __abssize __cursize __newpath="" __oldifs
+-    local -i __i __level=0
++    local __current __absolute __abssize __cursize __newpath __oldifs
++    local -i __i __level
+ #    PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ';
+ 
++    set -- "$(normalize_path "$1")" "$(normalize_path "$2")"
++
+     # corner case #1 - self looping link
+     [[ "$1" == "$2" ]] && { echo "${1##*/}"; return; }
+ 
+     # corner case #2 - own dir link
+     [[ "${1%/*}" == "$2" ]] && { echo "."; return; }
+ 
+-    __current=$(normalize_path "$1")
+-    __absolute=$(normalize_path "$2")
+-
+     __oldifs="$IFS"
+     IFS="/"
+-    __current=($__current)
+-    __absolute=($__absolute)
++    __current=($1)
++    __absolute=($2)
+     IFS="$__oldifs"
+ 
+     __abssize=${#__absolute[@]}
diff --git a/0090-90livenet-check-for-wget.patch b/0090-90livenet-check-for-wget.patch
new file mode 100644
index 0000000..9fb6cbf
--- /dev/null
+++ b/0090-90livenet-check-for-wget.patch
@@ -0,0 +1,21 @@
+From d73bbd57ee901b8470d9e42f5e004e240e00af62 Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald at redhat.com>
+Date: Thu, 20 Oct 2011 12:33:33 +0200
+Subject: [PATCH] 90livenet: check() for wget
+
+---
+ modules.d/90livenet/module-setup.sh |    1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/modules.d/90livenet/module-setup.sh b/modules.d/90livenet/module-setup.sh
+index b166859..3ee7521 100755
+--- a/modules.d/90livenet/module-setup.sh
++++ b/modules.d/90livenet/module-setup.sh
+@@ -4,6 +4,7 @@
+ check() {
+     # a live, host-only image doesn't really make a lot of sense
+     [[ $hostonly ]] && return 1
++    command -v wget || return 1
+     return 0
+ }
+ 
diff --git a/0091-dracut-logger-re-set-debugging.patch b/0091-dracut-logger-re-set-debugging.patch
new file mode 100644
index 0000000..d2f504c
--- /dev/null
+++ b/0091-dracut-logger-re-set-debugging.patch
@@ -0,0 +1,75 @@
+From 44cef0d5637f5f6982612d22c92f6d299ec316f9 Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald at redhat.com>
+Date: Thu, 20 Oct 2011 13:04:10 +0200
+Subject: [PATCH] dracut-logger: re-set debugging
+
+---
+ dracut-logger |    8 +++++++-
+ 1 files changed, 7 insertions(+), 1 deletions(-)
+
+diff --git a/dracut-logger b/dracut-logger
+index ce28208..f1b3a7e 100755
+--- a/dracut-logger
++++ b/dracut-logger
+@@ -313,7 +313,6 @@ dlog() {
+             _do_dlog "$1" "$line"
+         done
+     fi
+-    [ -n "$debug" ] && set -x || :
+ }
+ 
+ ## @brief Logs message at TRACE level (6)
+@@ -323,6 +322,7 @@ dlog() {
+ dtrace() {
+     set +x
+     dlog 6 "$@"
++    [ -n "$debug" ] && set -x || :
+ }
+ 
+ ## @brief Logs message at DEBUG level (5)
+@@ -332,6 +332,7 @@ dtrace() {
+ ddebug() {
+     set +x
+     dlog 5 "$@"
++    [ -n "$debug" ] && set -x || :
+ }
+ 
+ ## @brief Logs message at INFO level (4)
+@@ -341,6 +342,7 @@ ddebug() {
+ dinfo() {
+     set +x
+     dlog 4 "$@"
++    [ -n "$debug" ] && set -x || :
+ }
+ 
+ ## @brief Logs message at WARN level (3)
+@@ -350,6 +352,7 @@ dinfo() {
+ dwarn() {
+     set +x
+     dlog 3 "$@"
++    [ -n "$debug" ] && set -x || :
+ }
+ 
+ ## @brief It's an alias to dwarn() function.
+@@ -359,6 +362,7 @@ dwarn() {
+ dwarning() {
+     set +x
+     dwarn "$@"
++    [ -n "$debug" ] && set -x || :
+ }
+ 
+ ## @brief Logs message at ERROR level (2)
+@@ -368,6 +372,7 @@ dwarning() {
+ derror() {
+     set +x
+     dlog 2 "$@"
++    [ -n "$debug" ] && set -x || :
+ }
+ 
+ ## @brief Logs message at FATAL level (1)
+@@ -377,4 +382,5 @@ derror() {
+ dfatal() {
+     set +x
+     dlog 1 "$@"
++    [ -n "$debug" ] && set -x || :
+ }
diff --git a/0092-dracut-functions-inst_dir-handle-relative-symlinks.patch b/0092-dracut-functions-inst_dir-handle-relative-symlinks.patch
new file mode 100644
index 0000000..4134752
--- /dev/null
+++ b/0092-dracut-functions-inst_dir-handle-relative-symlinks.patch
@@ -0,0 +1,30 @@
+From b01885338bb0b3daa087f71cfbf895e999e90b9f Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald at redhat.com>
+Date: Thu, 20 Oct 2011 13:04:30 +0200
+Subject: [PATCH] dracut-functions: inst_dir() handle relative symlinks
+
+---
+ dracut-functions |    8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/dracut-functions b/dracut-functions
+index 1ef5269..70a467b 100755
+--- a/dracut-functions
++++ b/dracut-functions
+@@ -290,12 +290,12 @@ inst_dir() {
+             inst_dir "$target"
+             inst_symlink "$_file"
+         else
+-            [[ -h ${initdir}$_file ]] && _file=$(readlink "${initdir}$_file")
++            [[ -h ${initdir}/$_file ]] && _file=$(readlink "${initdir}/$_file")
+             # create directory
+-            mkdir -m 0755 -p "${initdir}$_file" || return 1
++            [[ -e "${initdir}/$_file" ]] || mkdir -m 0755 -p "${initdir}/$_file" || return 1
+             if [[ -d "$_file" ]]; then
+-                chmod --reference="$_file" "${initdir}$_file"
+-                chmod u+w "${initdir}$_file"
++                chmod --reference="$_file" "${initdir}/$_file"
++                chmod u+w "${initdir}/$_file"
+             fi
+         fi
+     done
diff --git a/0093-90livenet-module-setup.sh-silence-check-for-wget.patch b/0093-90livenet-module-setup.sh-silence-check-for-wget.patch
new file mode 100644
index 0000000..7dc88f1
--- /dev/null
+++ b/0093-90livenet-module-setup.sh-silence-check-for-wget.patch
@@ -0,0 +1,22 @@
+From 4f6eb791b481bd9cab0729010690ee9376742e2c Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald at redhat.com>
+Date: Fri, 21 Oct 2011 09:35:38 +0200
+Subject: [PATCH] 90livenet/module-setup.sh: silence check for wget
+
+---
+ modules.d/90livenet/module-setup.sh |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/modules.d/90livenet/module-setup.sh b/modules.d/90livenet/module-setup.sh
+index 3ee7521..a6ee3e0 100755
+--- a/modules.d/90livenet/module-setup.sh
++++ b/modules.d/90livenet/module-setup.sh
+@@ -4,7 +4,7 @@
+ check() {
+     # a live, host-only image doesn't really make a lot of sense
+     [[ $hostonly ]] && return 1
+-    command -v wget || return 1
++    command -v wget >/dev/null || return 1
+     return 0
+ }
+ 
diff --git a/0095-90livenet-do-not-install-by-default.patch b/0095-90livenet-do-not-install-by-default.patch
new file mode 100644
index 0000000..43b39ca
--- /dev/null
+++ b/0095-90livenet-do-not-install-by-default.patch
@@ -0,0 +1,22 @@
+From 624c70d763e9a201b5450fea10ac5e32939cf2a2 Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald at redhat.com>
+Date: Fri, 21 Oct 2011 10:15:09 +0200
+Subject: [PATCH] 90livenet: do not install by default
+
+---
+ modules.d/90livenet/module-setup.sh |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/modules.d/90livenet/module-setup.sh b/modules.d/90livenet/module-setup.sh
+index a6ee3e0..5cfbb75 100755
+--- a/modules.d/90livenet/module-setup.sh
++++ b/modules.d/90livenet/module-setup.sh
+@@ -5,7 +5,7 @@ check() {
+     # a live, host-only image doesn't really make a lot of sense
+     [[ $hostonly ]] && return 1
+     command -v wget >/dev/null || return 1
+-    return 0
++    return 255
+ }
+ 
+ depends() {
diff --git a/0096-dracut-functions-do-not-install-files-from-current-d.patch b/0096-dracut-functions-do-not-install-files-from-current-d.patch
new file mode 100644
index 0000000..fc54552
--- /dev/null
+++ b/0096-dracut-functions-do-not-install-files-from-current-d.patch
@@ -0,0 +1,129 @@
+From 4637c5c24252d636fc57af1a9aaaf629140a77c7 Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald at redhat.com>
+Date: Fri, 21 Oct 2011 10:09:55 +0200
+Subject: [PATCH] dracut-functions: do not install files from current
+ directory
+
+Protect against relative pathnames without a slash for all inst_*()
+functions.
+---
+ dracut-functions |   38 +++++++++++++++++++++-----------------
+ 1 files changed, 21 insertions(+), 17 deletions(-)
+
+diff --git a/dracut-functions b/dracut-functions
+index 70a467b..a56e460 100755
+--- a/dracut-functions
++++ b/dracut-functions
+@@ -272,10 +272,10 @@ check_vol_slaves() {
+ # will create ${initdir}/lib64, ${initdir}/lib64/file,
+ # and a symlink ${initdir}/lib -> lib64.
+ inst_dir() {
+-    [[ -e ${initdir}"$1" ]] && return 0  # already there
++    [[ -e ${initdir}/"$1" ]] && return 0  # already there
+ 
+     local _dir="$1" _part="${1%/*}" _file
+-    while [[ "$_part" != "${_part%/*}" ]] && ! [[ -e "${initdir}${_part}" ]]; do
++    while [[ "$_part" != "${_part%/*}" ]] && ! [[ -e "${initdir}/${_part}" ]]; do
+         _dir="$_part $_dir"
+         _part=${_part%/*}
+     done
+@@ -306,12 +306,13 @@ inst_dir() {
+ # Location of the image dir is assumed to be $initdir
+ # We never overwrite the target if it exists.
+ inst_simple() {
+-    [[ -f $1 ]] || return 1
++    [[ -f "$1" ]] || return 1
++    strstr "$1" "/" || return 1
+ 
+     local _src=$1 target="${2:-$1}"
+-    if ! [[ -d ${initdir}$target ]]; then
+-        [[ -e ${initdir}$target ]] && return 0
+-        [[ -h ${initdir}$target ]] && return 0
++    if ! [[ -d ${initdir}/$target ]]; then
++        [[ -e ${initdir}/$target ]] && return 0
++        [[ -h ${initdir}/$target ]] && return 0
+         inst_dir "${target%/*}"
+     fi
+     # install checksum files also
+@@ -319,7 +320,7 @@ inst_simple() {
+         inst "${_src%/*}/.${_src##*/}.hmac" "${target%/*}/.${target##*/}.hmac"
+     fi
+     ddebug "Installing $_src"
+-    cp --sparse=always -pfL "$_src" "${initdir}$target" 
++    cp --sparse=always -pfL "$_src" "${initdir}/$target" 
+ }
+ 
+ # find symlinks linked to given library file
+@@ -351,8 +352,9 @@ rev_lib_symlinks() {
+ # It handles making symlinks according to how the original library
+ # is referenced.
+ inst_library() {
+-    local _src=$1 _dest=${2:-$1} _lib _reallib _symlink
+-    [[ -e $initdir$_dest ]] && return 0
++    local _src="$1" _dest=${2:-$1} _lib _reallib _symlink
++    strstr "$1" "/" || return 1
++    [[ -e $initdir/$_dest ]] && return 0
+     if [[ -L $_src ]]; then
+         # install checksum files also
+         if [[ -e "${_src%/*}/.${_src##*/}.hmac" ]]; then
+@@ -361,14 +363,14 @@ inst_library() {
+         _reallib=$(readlink -f "$_src")
+         inst_simple "$_reallib" "$_reallib"
+         inst_dir "${_dest%/*}"
+-        ln -sfn $(convert_abs_rel "${_dest}" "${_reallib}") "${initdir}${_dest}"
++        ln -sfn $(convert_abs_rel "${_dest}" "${_reallib}") "${initdir}/${_dest}"
+     else
+         inst_simple "$_src" "$_dest"
+     fi
+ 
+     # Create additional symlinks.  See rev_symlinks description.
+     for _symlink in $(rev_lib_symlinks $_src) $(rev_lib_symlinks $_reallib); do
+-        [[ ! -e $initdir$_symlink ]] && {
++        [[ ! -e $initdir/$_symlink ]] && {
+             ddebug "Creating extra symlink: $_symlink"
+             inst_symlink $_symlink
+         }
+@@ -396,7 +398,7 @@ inst_binary() {
+     _bin=$(find_binary "$1") || return 1
+     _target=${2:-$_bin}
+     inst_symlink $_bin $_target && return 0
+-    [[ -e $initdir$_target ]] && return 0
++    [[ -e $initdir/$_target ]] && return 0
+ 
+     # If the binary being installed is also a library, add it to the loop.
+     _so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)'
+@@ -414,7 +416,7 @@ inst_binary() {
+         fi
+         [[ $_line =~ $_so_regex ]] || continue
+         _file=${BASH_REMATCH[1]}
+-        [[ -e ${initdir}$_file ]] && continue
++        [[ -e ${initdir}/$_file ]] && continue
+ 
+         # See if we are loading an optimized version of a shared lib.
+         if [[ $_file =~ $_lib_regex ]]; then
+@@ -439,19 +441,21 @@ inst_binary() {
+ # same as above, except for shell scripts.
+ # If your shell script does not start with shebang, it is not a shell script.
+ inst_script() {
+-    [[ -f $1 ]] || return 1
++    local _bin
++    _bin=$(find_binary "$1") || return 1
+     local _line _shebang_regex
+-    read -r -n 80 _line <"$1"
++    read -r -n 80 _line <"$_bin"
+     # If debug is set, clean unprintable chars to prevent messing up the term
+     [[ $debug ]] && _line=$(echo -n "$_line" | tr -c -d '[:print:][:space:]')
+     _shebang_regex='(#! *)(/[^ ]+).*'
+     [[ $_line =~ $_shebang_regex ]] || return 1
+-    inst "${BASH_REMATCH[2]}" && inst_simple "$@"
++    inst "${BASH_REMATCH[2]}" && inst_binary "$@"
+ }
+ 
+ # same as above, but specialized for symlinks
+ inst_symlink() {
+-    local _src=$1 _target=$initdir${2:-$1} _realsrc
++    local _src=$1 _target=$initdir/${2:-$1} _realsrc
++    strstr "$1" "/" || return 1
+     [[ -L $1 ]] || return 1
+     [[ -L $_target ]] && return 0
+     _realsrc=$(readlink -f "$_src")
diff --git a/dracut.spec b/dracut.spec
index ea72a06..6b80b5e 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -8,7 +8,7 @@
 
 Name: dracut
 Version: 013
-Release: 15%{?dist}
+Release: 16%{?dist}
 
 Summary: Initramfs generator using udev
 %if 0%{?fedora} || 0%{?rhel} > 6
@@ -25,11 +25,23 @@ Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar
 
 Patch2: 0002-90dmsquash-live-dmsquash-live-root-include-fs_lib.sh.patch
 Patch3: 0003-fix-live-crash-with-livenet-installed.patch
+Patch6: 0006-dracut-functions-s-emergency-shutdown-shutdown-emerg.patch
+Patch9: 0009-dracut-functions-speed-up-inst_dir.patch
+Patch12: 0012-dracut-functions-new-function-inst_any-d-dest-f1-f2-.patch
+Patch17: 0017-dracut-functions-fix-inst_dir-for-non-absolute-dirs.patch
 Patch18: 0018-90mdraid-65-md-incremental-imsm.rules-incremental-ru.patch
+Patch22: 0022-build-initramfs-unclear-_mpargs-in-instmods.patch
 Patch24: 0024-99base-init-save-and-restore-environment-given-from-.patch
 Patch26: 0026-dracut-functions-hmac-checksum-files-can-be-symlinks.patch
 Patch27: 0027-95udev-rules-add-input_id.patch
+Patch28: 0028-inst_simple-inst_dir-make-fast-case-faster.patch
+Patch29: 0029-filter_kernel_modules-is-a-specialized-filter_kernel.patch
+Patch30: 0030-install_kmod_with_fw-make-fast-case-faster.patch
+Patch31: 0031-instmods-get-filenames-from-stdin-if-no-args-use-it.patch
+Patch32: 0032-instmods-sanity-for-_mpargs.patch
+Patch33: 0033-instmods-factor-out-egrep-of-FATAL-Module-.-not-foun.patch
 Patch34: 0034-99base-init-do-not-fail-when-importing-the-original-.patch
+Patch35: 0035-dracut-cp-with-sparse.patch
 Patch37: 0037-dmsquash-live-root-use-blkid-to-determine-fstype-of-.patch
 Patch38: 0038-dmsquash-live-root-load-filesystem-modules-before-mo.patch
 Patch40: 0040-99base-init-remove-dev-root-helper-symlink.patch
@@ -54,9 +66,18 @@ Patch58: 0058-dracut-functions-inst_rules-add-missing.patch
 Patch59: 0059-90mdraid-check-precisely-for-supported-contaiers.patch
 Patch60: 0060-90mdraid-more-thorough-64-md-raid.rules-edit.patch
 Patch61: 0061-90mdraid-adjust-dev-md-loops.patch
+Patch62: 0062-dracut-PATCH-Parameter-expansion-occurs-before-comma.patch
 Patch64: 0064-order-mdadm-and-lvm-timeout-operations.patch
 Patch65: 0065-90mdraid-mdraid_start.sh-fix-path-to-md-sysfs.patch
 Patch66: 0066-90mdraid-module-setup.sh-fixed-sed-arguments.patch
+Patch70: 0070-convert_abs_rel-fixups.patch
+Patch74: 0074-dracut-functions-conv-normalize-minor-corrections.patch
+Patch90: 0090-90livenet-check-for-wget.patch
+Patch91: 0091-dracut-logger-re-set-debugging.patch
+Patch92: 0092-dracut-functions-inst_dir-handle-relative-symlinks.patch
+Patch93: 0093-90livenet-module-setup.sh-silence-check-for-wget.patch
+Patch95: 0095-90livenet-do-not-install-by-default.patch
+Patch96: 0096-dracut-functions-do-not-install-files-from-current-d.patch
 
 BuildArch: noarch
 BuildRequires: dash bash
@@ -192,11 +213,23 @@ This package contains tools to assemble the local initrd and host configuration.
 %setup -q -n %{name}-%{version}
 %patch2 -p1
 %patch3 -p1
+%patch6 -p1
+%patch9 -p1
+%patch12 -p1
+%patch17 -p1
 %patch18 -p1
+%patch22 -p1
 %patch24 -p1
 %patch26 -p1
 %patch27 -p1
+%patch28 -p1
+%patch29 -p1
+%patch30 -p1
+%patch31 -p1
+%patch32 -p1
+%patch33 -p1
 %patch34 -p1
+%patch35 -p1
 %patch37 -p1
 %patch38 -p1
 %patch40 -p1
@@ -221,12 +254,21 @@ This package contains tools to assemble the local initrd and host configuration.
 %patch59 -p1
 %patch60 -p1
 %patch61 -p1
+%patch62 -p1
 %patch64 -p1
 %patch65 -p1
 %patch66 -p1
+%patch70 -p1
+%patch74 -p1
+%patch90 -p1
+%patch91 -p1
+%patch92 -p1
+%patch93 -p1
+%patch95 -p1
+%patch96 -p1
 
 chmod a+x modules.d/*/*.sh
-find . -name *.orig -print0 | xargs -0 rm -f
+find . -name '*.orig' -print0 | xargs -0 rm -f
 %build
 make
 
@@ -365,6 +407,13 @@ rm -rf $RPM_BUILD_ROOT
 %dir /var/lib/dracut/overlay
 
 %changelog
+* Fri Oct 21 2011 Harald Hoyer <harald at redhat.com> 013-16
+- fixed livenet module wget bug
+Resolves: rhbz#747632
+- fixed relative symlink bugs
+- speedup image creation
+- protect against files in current directory
+
 * Tue Oct 04 2011 Harald Hoyer <harald at redhat.com> 013-15
 - fixed mdraid container handling
 Resolves: rhbz#743240


More information about the scm-commits mailing list