[dracut/f17] dracut-018-51.git20120604

Harald Hoyer harald at fedoraproject.org
Mon Jun 4 12:49:59 UTC 2012


commit 467a862355686f3fe0fe2d77f1cf0bcbe807422d
Author: Harald Hoyer <harald at redhat.com>
Date:   Mon Jun 4 14:49:29 2012 +0200

    dracut-018-51.git20120604
    
    - fix network rules for kdump
    Resolves: rhbz#822750
    - disable curl progress bar
    Resolves: rhbz#817301 rhbz#824883
    - do not default to dhcp for interfaces without ip=
    - do not arping with qeth layer3 interfaces
    Resolves: rhbz#825783
    - do not unpack the initramfs, if the old initramfs still exists
    - add rd.luks.allow-discards and honor options in crypttab
    - fixed dasd_mod param generation
    - fix return value of some installkernel() functions
    - do not rely on the presence of lib64, check with ldd
    - dasd: don't set an already set attribute
    Resolves: rhbz#826357
    - add filesystem options to fsck_single()

 ...ules-for-kdump-we-don-t-specify-netroot-i.patch |   42 +++++
 ...-lib-url-lib.sh-disable-curl-progress-bar.patch |   26 ++++
 ...p.sh-do-not-default-to-dhcp-for-interface.patch |   35 +++++
 ...do-not-arping-with-qeth-layer3-interfaces.patch |   59 ++++++++
 ...down.service-do-not-unpack-old-initramfs-.patch |   23 +++
 ...d.luks.allow-discards-and-honor-options-i.patch |  157 ++++++++++++++++++++
 ...rse-dasd-mod.sh-fixed-dasd_mod-param-gene.patch |   68 +++++++++
 ...urn-value-of-some-installkernel-functions.patch |   54 +++++++
 ...o-not-rely-on-the-presence-of-lib64-check.patch |   48 ++++++
 ...Don-t-set-an-already-set-attribute-826357.patch |   39 +++++
 0050-add-filesystem-options-to-fsck_single.patch   |  125 ++++++++++++++++
 dracut.spec                                        |   30 ++++-
 12 files changed, 705 insertions(+), 1 deletions(-)
---
diff --git a/0040-Relax-the-rules-for-kdump-we-don-t-specify-netroot-i.patch b/0040-Relax-the-rules-for-kdump-we-don-t-specify-netroot-i.patch
new file mode 100644
index 0000000..00c56b1
--- /dev/null
+++ b/0040-Relax-the-rules-for-kdump-we-don-t-specify-netroot-i.patch
@@ -0,0 +1,42 @@
+From b6a90dbd0b879d3d9746c82102fc5c4ba09f59b9 Mon Sep 17 00:00:00 2001
+From: Cong Wang <xiyou.wangcong at gmail.com>
+Date: Tue, 29 May 2012 09:17:01 +0200
+Subject: [PATCH] Relax the rules for kdump, we don't specify netroot in
+ kdump.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=822750
+---
+ modules.d/40network/parse-bond.sh   |    5 +----
+ modules.d/40network/parse-bridge.sh |    3 ---
+ 2 files changed, 1 insertion(+), 7 deletions(-)
+
+diff --git a/modules.d/40network/parse-bond.sh b/modules.d/40network/parse-bond.sh
+index 0a4c006..933ad27 100755
+--- a/modules.d/40network/parse-bond.sh
++++ b/modules.d/40network/parse-bond.sh
+@@ -15,10 +15,7 @@
+ 
+ # Check if bond parameter is valid
+ if getarg bond= >/dev/null ; then
+-    if [ -z "$netroot" ] ; then
+-        die "No netboot configured, bond is invalid"
+-    fi
+-    command -v brctl >/dev/null 2>&1 || die "No 'brctl' installed"
++    :
+ fi
+ 
+ # We translate list of slaves to space-separated here to mwke it easier to loop over them in ifup
+diff --git a/modules.d/40network/parse-bridge.sh b/modules.d/40network/parse-bridge.sh
+index aaa5a54..6e1fee1 100755
+--- a/modules.d/40network/parse-bridge.sh
++++ b/modules.d/40network/parse-bridge.sh
+@@ -13,9 +13,6 @@
+ 
+ # Check if bridge parameter is valid
+ if getarg bridge= >/dev/null ; then
+-    if [ -z "$netroot" ] ; then
+-        die "No netboot configured, bridge is invalid"
+-    fi
+     command -v brctl >/dev/null 2>&1 || die "No 'brctl' installed" 
+ fi
+ 
diff --git a/0041-url-lib-url-lib.sh-disable-curl-progress-bar.patch b/0041-url-lib-url-lib.sh-disable-curl-progress-bar.patch
new file mode 100644
index 0000000..7882507
--- /dev/null
+++ b/0041-url-lib-url-lib.sh-disable-curl-progress-bar.patch
@@ -0,0 +1,26 @@
+From a07fae1ca1a095b4cca4399a42f7c2c975fd2f5d Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald at redhat.com>
+Date: Tue, 29 May 2012 16:10:46 +0200
+Subject: [PATCH] url-lib/url-lib.sh: disable curl progress bar
+
+https://bugzilla.redhat.com/show_bug.cgi?id=817301
+https://bugzilla.redhat.com/show_bug.cgi?id=824883
+---
+ modules.d/45url-lib/url-lib.sh |    4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/modules.d/45url-lib/url-lib.sh b/modules.d/45url-lib/url-lib.sh
+index 5721294..e9ece70 100755
+--- a/modules.d/45url-lib/url-lib.sh
++++ b/modules.d/45url-lib/url-lib.sh
+@@ -56,10 +56,6 @@ export CURL_HOME="/run/initramfs/url-lib"
+ mkdir -p $CURL_HOME
+ curl_args="--location --retry 3 --fail --show-error"
+ 
+-# technically "dumb" can handle the progress bar, but the only thing I've ever
+-# seen using TERM=dumb is s390 CMS, and it's too dumb for --progress-bar
+-[ "$TERM" != "dumb" ] && curl_args="$curl_args --progress-bar"
+-
+ curl_fetch_url() {
+     local url="$1" outloc="$2"
+     echo "$url" > /proc/self/fd/0
diff --git a/0042-network-ifup.sh-do-not-default-to-dhcp-for-interface.patch b/0042-network-ifup.sh-do-not-default-to-dhcp-for-interface.patch
new file mode 100644
index 0000000..ebb7edb
--- /dev/null
+++ b/0042-network-ifup.sh-do-not-default-to-dhcp-for-interface.patch
@@ -0,0 +1,35 @@
+From 588f0347536f3668708131353b2cb01f21594b59 Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald at redhat.com>
+Date: Tue, 29 May 2012 16:34:58 +0200
+Subject: [PATCH] network/ifup.sh: do not default to dhcp, for interfaces
+ without ip=...
+
+Don't try to be smarter than the admin configuring the machine.
+Does also conflict with other methods trying to setup the interfaces,
+like cmsifup.sh from the cms module.
+---
+ modules.d/40network/ifup.sh |   11 -----------
+ 1 file changed, 11 deletions(-)
+
+diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
+index 2111b41..b8f07f4 100755
+--- a/modules.d/40network/ifup.sh
++++ b/modules.d/40network/ifup.sh
+@@ -202,17 +202,6 @@ if [ "$netif" = "$bridgename" ] && [ ! -e /tmp/net.$bridgename.up ]; then
+     brctl addif $bridgename $ethname
+ fi
+ 
+-# No ip lines default to dhcp
+-ip=$(getarg ip)
+-
+-if [ -z "$ip" ]; then
+-    if [ "$netroot" = "dhcp6" ]; then
+-        do_dhcp -6
+-    else
+-        do_dhcp -4
+-    fi
+-fi
+-
+ # Specific configuration, spin through the kernel command line
+ # looking for ip= lines
+ for p in $(getargs ip=); do
diff --git a/0043-network-do-not-arping-with-qeth-layer3-interfaces.patch b/0043-network-do-not-arping-with-qeth-layer3-interfaces.patch
new file mode 100644
index 0000000..9cee18a
--- /dev/null
+++ b/0043-network-do-not-arping-with-qeth-layer3-interfaces.patch
@@ -0,0 +1,59 @@
+From 7d6493ec506832156352a30b8c6a85446d2f6142 Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald at redhat.com>
+Date: Tue, 29 May 2012 17:38:18 +0200
+Subject: [PATCH] network: do not arping with qeth layer3 interfaces
+
+https://bugzilla.redhat.com/show_bug.cgi?id=825783
+---
+ modules.d/40network/dhclient-script.sh |   13 ++++++++++---
+ modules.d/40network/net-lib.sh         |   10 +++++++++-
+ 2 files changed, 19 insertions(+), 4 deletions(-)
+
+diff --git a/modules.d/40network/dhclient-script.sh b/modules.d/40network/dhclient-script.sh
+index 52e4900..2f05549 100755
+--- a/modules.d/40network/dhclient-script.sh
++++ b/modules.d/40network/dhclient-script.sh
+@@ -66,10 +66,17 @@ case $reason in
+         ;;
+     BOUND)
+         echo "dhcp: BOND setting $netif"
+-        if ! arping -q -D -c 2 -I $netif $new_ip_address ; then
+-            warn "Duplicate address detected for $new_ip_address while doing dhcp. retrying"
+-            exit 1
++        unset layer2
++        if [ -f /sys/class/net/$netif/device/layer2 ]; then
++            read layer2 < /sys/class/net/$netif/device/layer2
+         fi
++        if [ "$layer2" != "0" ]; then
++            if ! arping -q -D -c 2 -I $netif $new_ip_address ; then
++                warn "Duplicate address detected for $new_ip_address while doing dhcp. retrying"
++                exit 1
++            fi
++        fi
++        unset layer2
+         setup_interface
+         set | while read line; do
+             [ "${line#new_}" = "$line" ] && continue
+diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
+index c0f73da..1acd549 100644
+--- a/modules.d/40network/net-lib.sh
++++ b/modules.d/40network/net-lib.sh
+@@ -99,9 +99,17 @@ setup_net() {
+     else
+         dest="$gw_ip"
+     fi
+-    if [ -n "$dest" ] && ! arping -q -f -w 60 -I $netif $dest ; then
++
++    unset layer2
++    if [ -f /sys/class/net/$netif/device/layer2 ]; then
++        read layer2 < /sys/class/net/$netif/device/layer2
++    fi
++
++    if [ "$layer2" != "0" ] && [ -n "$dest" ] && ! arping -q -f -w 60 -I $netif $dest ; then
+         info "Resolving $dest via ARP on $netif failed"
+     fi
++    unset layer2
++
+     > /tmp/net.$netif.did-setup
+ }
+ 
diff --git a/0044-dracut-shutdown.service-do-not-unpack-old-initramfs-.patch b/0044-dracut-shutdown.service-do-not-unpack-old-initramfs-.patch
new file mode 100644
index 0000000..572210d
--- /dev/null
+++ b/0044-dracut-shutdown.service-do-not-unpack-old-initramfs-.patch
@@ -0,0 +1,23 @@
+From f7b641bbe85588f84f6e5722533f7ef9e1433d7f Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald at redhat.com>
+Date: Thu, 31 May 2012 09:56:24 +0200
+Subject: [PATCH] dracut-shutdown.service: do not unpack old initramfs on
+ shutdown
+
+Do not unpack the initramfs, if the old initramfs still exists.
+---
+ dracut-shutdown.service |    1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/dracut-shutdown.service b/dracut-shutdown.service
+index 4f06e35..6756355 100644
+--- a/dracut-shutdown.service
++++ b/dracut-shutdown.service
+@@ -11,6 +11,7 @@ After=getty at tty1.service prefdm.service
+ Before=reboot.service
+ DefaultDependencies=no
+ ConditionPathExists=/run/initramfs/.need_shutdown
++ConditionPathExists=!/run/initramfs/bin/sh
+ 
+ [Service]
+ ExecStart=/usr/lib/dracut/dracut-initramfs-restore
diff --git a/0045-crypt-add-rd.luks.allow-discards-and-honor-options-i.patch b/0045-crypt-add-rd.luks.allow-discards-and-honor-options-i.patch
new file mode 100644
index 0000000..d254676
--- /dev/null
+++ b/0045-crypt-add-rd.luks.allow-discards-and-honor-options-i.patch
@@ -0,0 +1,157 @@
+From 9ad3b951e238e790cc803cc1e69aa85b0e308188 Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald at redhat.com>
+Date: Thu, 31 May 2012 11:46:10 +0200
+Subject: [PATCH] crypt: add rd.luks.allow-discards and honor options in
+ crypttab
+
+also fixed the retry loop for rd.luks.key
+---
+ dracut.cmdline.7.asc               |   10 +++++
+ modules.d/90crypt/cryptroot-ask.sh |   73 ++++++++++++++++++++++++++++--------
+ 2 files changed, 67 insertions(+), 16 deletions(-)
+
+diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
+index 76db651..eda72f1 100644
+--- a/dracut.cmdline.7.asc
++++ b/dracut.cmdline.7.asc
+@@ -191,6 +191,16 @@ crypto LUKS
+     LUKS UUID, so you don't have to specify the full UUID.
+     This parameter can be specified multiple times.
+ 
++**rd.luks.allow-discards=**_<luks uuid>_::
++    Allow  using  of discards (TRIM) requests for LUKS partitions with the given UUID.
++    Any "luks-" of the LUKS UUID is removed before comparing to _<luks uuid>_.
++    The comparisons also matches, if _<luks uuid>_ is only the beginning of the
++    LUKS UUID, so you don't have to specify the full UUID.
++    This parameter can be specified multiple times.
++
++**rd.luks.allow-discards::
++    Allow  using  of discards (TRIM) requests on all LUKS partitions.
++
+ **rd.luks.crypttab=0**::
+     do not check, if LUKS partition is in _/etc/crypttab_
+ 
+diff --git a/modules.d/90crypt/cryptroot-ask.sh b/modules.d/90crypt/cryptroot-ask.sh
+index aba1331..d373a90 100755
+--- a/modules.d/90crypt/cryptroot-ask.sh
++++ b/modules.d/90crypt/cryptroot-ask.sh
+@@ -32,9 +32,12 @@ else
+     device="$1"
+ fi
+ 
++# number of tries
++numtries=${3:-10}
++
+ # TODO: improve to support what cmdline does
+ if [ -f /etc/crypttab ] && getargbool 1 rd.luks.crypttab -n rd_NO_CRYPTTAB; then
+-    while read name dev luksfile rest; do
++    while read name dev luksfile luksoptions; do
+         # ignore blank lines and comments
+         if [ -z "$name" -o "${name#\#}" != "$name" ]; then
+             continue
+@@ -57,17 +60,59 @@ if [ -f /etc/crypttab ] && getargbool 1 rd.luks.crypttab -n rd_NO_CRYPTTAB; then
+             fi
+         fi
+     done < /etc/crypttab
+-    unset name dev rest
++    unset name dev
+ fi
+ 
+ #
+ # Open LUKS device
+ #
+ 
+-info "luksOpen $device $luksname $luksfile"
++info "luksOpen $device $luksname $luksfile $luksoptions"
++
++OLD_IFS="$IFS"
++IFS=,
++set -- $luksoptions
++IFS="$OLD_IFS"
++
++while [ $# -gt 0 ]; do
++    case $1 in
++        noauto)
++            # skip this
++            exit 0
++            ;;
++        swap)
++            # skip this
++            exit 0
++            ;;
++        tmp)
++            # skip this
++            exit 0
++            ;;
++        allow-discards)
++            allowdiscards="--allow-discards"
++    esac
++    shift
++done
++
++# parse for allow-discards
++if strstr "$(cryptsetup --help)" "allow-discards"; then
++    if discarduuids=$(getargs "rd.luks.allow-discards"); then
++        if strstr " $discarduuids " " ${luksdev##luks-}"; then
++            allowdiscards="--allow-discards"
++        fi
++    elif getargbool rd.luks.allow-discards; then
++        allowdiscards="--allow-discards"
++    fi
++fi
++
++if strstr "$(cryptsetup --help)" "allow-discards"; then
++    cryptsetupopts="$cryptsetupopts $allowdiscards"
++fi
++
++unset allowdiscards
+ 
+ if [ -n "$luksfile" -a "$luksfile" != "none" -a -e "$luksfile" ]; then
+-    if cryptsetup --key-file "$luksfile" luksOpen "$device" "$luksname"; then
++    if cryptsetup --key-file "$luksfile" $cryptsetupopts luksOpen "$device" "$luksname"; then
+         ask_passphrase=0
+     fi
+ else
+@@ -76,26 +121,22 @@ else
+             keydev="${tmp%%:*}"
+             keypath="${tmp#*:}"
+         else
+-            if [ $# -eq 3 ]; then
+-                if [ $3 -eq 0 ]; then
+-                    info "No key found for $device.  Fallback to passphrase mode."
+-                    break
+-                fi
+-                info "No key found for $device.  Will try $3 time(s) more later."
+-                set -- "$1" "$2" "$(($3 - 1))"
+-            else
+-                info "No key found for $device.  Will try later."
++            if [ $numtries -eq 0 ]; then
++                warn "No key found for $device.  Fallback to passphrase mode."
++                break
+             fi
++            sleep 1
++            info "No key found for $device.  Will try $numtries time(s) more later."
+             initqueue --unique --onetime --settled \
+                 --name cryptroot-ask-$luksname \
+-                $(command -v cryptroot-ask) "$@"
++                $(command -v cryptroot-ask) "$device" "$luksname" "$(($numtries-1))"
+             exit 0
+         fi
+         unset tmp
+ 
+         info "Using '$keypath' on '$keydev'"
+         readkey "$keypath" "$keydev" "$device" \
+-            | cryptsetup -d - luksOpen "$device" "$luksname"
++            | cryptsetup -d - $cryptsetupopts luksOpen "$device" "$luksname"
+         unset keypath keydev
+         ask_passphrase=0
+         break
+@@ -103,7 +144,7 @@ else
+ fi
+ 
+ if [ $ask_passphrase -ne 0 ]; then
+-    luks_open="$(command -v cryptsetup) luksOpen"
++    luks_open="$(command -v cryptsetup) $cryptsetupopts luksOpen"
+     ask_for_password --ply-tries 5 \
+         --ply-cmd "$luks_open -T1 $device $luksname" \
+         --ply-prompt "Password ($device)" \
diff --git a/0046-dasd_mod-parse-dasd-mod.sh-fixed-dasd_mod-param-gene.patch b/0046-dasd_mod-parse-dasd-mod.sh-fixed-dasd_mod-param-gene.patch
new file mode 100644
index 0000000..caacb4a
--- /dev/null
+++ b/0046-dasd_mod-parse-dasd-mod.sh-fixed-dasd_mod-param-gene.patch
@@ -0,0 +1,68 @@
+From 328c7ae8c4d74bbbc457d7a029ac5ea444a83bb4 Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald at redhat.com>
+Date: Thu, 31 May 2012 09:12:51 +0200
+Subject: [PATCH] dasd_mod/parse-dasd-mod.sh: fixed dasd_mod param generation
+
+---
+ modules.d/95dasd_mod/parse-dasd-mod.sh |   44 +++++++++++++++++++++++++++-----
+ 1 file changed, 38 insertions(+), 6 deletions(-)
+
+diff --git a/modules.d/95dasd_mod/parse-dasd-mod.sh b/modules.d/95dasd_mod/parse-dasd-mod.sh
+index d7e8664..91c3274 100755
+--- a/modules.d/95dasd_mod/parse-dasd-mod.sh
++++ b/modules.d/95dasd_mod/parse-dasd-mod.sh
+@@ -2,16 +2,48 @@
+ # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+ # ex: ts=8 sw=4 sts=4 et filetype=sh
+ mod_args=""
+-for dasd_arg in $(getargs rd.dasd= rd_DASD= DASD=); do
+-    if [ -z $mod_args ]; then
+-        mod_args="$dasd_arg"
++
++convert_dasd_param() {
++    local bus_id params
++    params=""
++    bus_id=$1; shift
++    while [ $# -gt 0 ]; do
++        case "$1" in
++            use_diag\=1)
++                params="$params:diag"
++                ;;
++            readonly\=1)
++                params="$params:ro"
++                ;;
++            erplog\=1)
++                params="$params:erplog"
++                ;;
++            failfast\=1)
++                params="$params:failfast"
++                ;;
++        esac
++        shift
++    done
++    params="${params#*:}"
++    if [ -n "$params" ]; then
++        echo "$bus_id($params)"
+     else
+-        # We've already got some thing in mod_args, add to it
+-        mod_args="$mod_args,$dasd_arg"
++        echo "$bus_id"
+     fi
++}
++
++for dasd_arg in $(getargs rd.dasd= rd_DASD= DASD=); do
++    OLD_IFS=$IFS
++    IFS=","
++    set -- $dasd_arg
++    IFS=$OLD_IFS
++    dasd_arg=$(convert_dasd_param "$@")
++    mod_args="$mod_args,$dasd_arg"
+ done
+ 
+-if [ ! -z $mod_args ]; then
++mod_args="${mod_args#*,}"
++
++if [ -n "$mod_args" ]; then
+     [ -d /etc/modprobe.d ] || mkdir -m 0755 -p /etc/modprobe.d
+     echo "options dasd_mod dasd=$mod_args" >> /etc/modprobe.d/dasd_mod.conf
+ fi
diff --git a/0047-fix-return-value-of-some-installkernel-functions.patch b/0047-fix-return-value-of-some-installkernel-functions.patch
new file mode 100644
index 0000000..4415b03
--- /dev/null
+++ b/0047-fix-return-value-of-some-installkernel-functions.patch
@@ -0,0 +1,54 @@
+From 0a1ddd3fd3754c68bd5256e4b87b6978863efa31 Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald at redhat.com>
+Date: Fri, 1 Jun 2012 17:09:25 +0200
+Subject: [PATCH] fix return value of some installkernel() functions
+
+---
+ modules.d/40network/module-setup.sh   |    3 +++
+ modules.d/90multipath/module-setup.sh |    3 +++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh
+index c2ad815..e32eb28 100755
+--- a/modules.d/40network/module-setup.sh
++++ b/modules.d/40network/module-setup.sh
+@@ -27,6 +27,7 @@ installkernel() {
+     net_module_filter() {
+         local _net_drivers='eth_type_trans|register_virtio_device'
+         local _unwanted_drivers='/(wireless|isdn|uwb)/'
++        local _ret
+         # subfunctions inherit following FDs
+         local _merge=8 _side2=9
+         function nmf1() {
+@@ -55,7 +56,9 @@ installkernel() {
+         # Use two parallel streams to filter alternating modules.
+         set +x
+         eval "( ( rotor ) ${_side2}>&1 | nmf1 ) ${_merge}>&1"
++        _ret=$?
+         [[ $debug ]] && set -x
++        return $_ret
+     }
+ 
+     { find_kernel_modules_by_path drivers/net; find_kernel_modules_by_path drivers/s390/net; } \
+diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
+index 2f6b416..43057f3 100755
+--- a/modules.d/90multipath/module-setup.sh
++++ b/modules.d/90multipath/module-setup.sh
+@@ -31,6 +31,7 @@ depends() {
+ }
+ 
+ installkernel() {
++    local _ret
+     set +x
+     mp_mod_filter() {
+         local _mpfuncs='scsi_register_device_handler|dm_dirty_log_type_register|dm_register_path_selector|dm_register_target'
+@@ -45,7 +46,9 @@ installkernel() {
+ 
+     ( find_kernel_modules_by_path drivers/scsi; find_kernel_modules_by_path drivers/s390/scsi ;
+       find_kernel_modules_by_path drivers/md )  |  mp_mod_filter  |  instmods
++    _ret=$?
+     [[ $debug ]] && set -x
++    return $_ret
+ }
+ 
+ install() {
diff --git a/0048-dracut.sh-do-not-rely-on-the-presence-of-lib64-check.patch b/0048-dracut.sh-do-not-rely-on-the-presence-of-lib64-check.patch
new file mode 100644
index 0000000..7ed6de7
--- /dev/null
+++ b/0048-dracut.sh-do-not-rely-on-the-presence-of-lib64-check.patch
@@ -0,0 +1,48 @@
+From 71909cc72ccd11af9c542b134b112b8d6f8c5211 Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald at redhat.com>
+Date: Mon, 4 Jun 2012 11:33:29 +0200
+Subject: [PATCH] dracut.sh: do not rely on the presence of lib64, check with
+ ldd
+
+---
+ dracut.sh |   27 +++++++++++++++++----------
+ 1 file changed, 17 insertions(+), 10 deletions(-)
+
+diff --git a/dracut.sh b/dracut.sh
+index 1048e75..44dcc94 100755
+--- a/dracut.sh
++++ b/dracut.sh
+@@ -512,16 +512,23 @@ ddebug "Executing $0 $dracut_args"
+ }
+ 
+ # Detect lib paths
+-[[ $libdir ]] || for libdir in /lib64 /lib; do
+-    [[ -d $libdir ]] && libdirs+=" $libdir" && break
+-done || {
+-    dfatal 'No lib directory?!!!'
+-    exit 1
+-}
+-
+-[[ $usrlibdir ]] || for usrlibdir in /usr/lib64 /usr/lib; do
+-    [[ -d $usrlibdir ]] && libdirs+=" $usrlibdir" && break
+-done || dwarn 'No usr/lib directory!'
++if ! [[ $libdir ]] || ! [[ $usrlibdir ]] ; then
++    if strstr "$(ldd /bin/sh)" "/lib64/" &>/dev/null \
++        && [[ -d /lib64 ]]; then
++        libdir=/lib64
++        usrlibdir=/usr/lib64
++    else
++        libdir=/lib
++        usrlibdir=/usr/lib
++    fi
++    for i in $libdir $usrlibdir; do
++        if [[ -d $i ]]; then
++            libdirs+=" $i"
++        else
++            dwarn 'No $i directory??!!'
++        fi
++    done
++fi
+ 
+ # This is kinda legacy -- eventually it should go away.
+ case $dracutmodules in
diff --git a/0049-Don-t-set-an-already-set-attribute-826357.patch b/0049-Don-t-set-an-already-set-attribute-826357.patch
new file mode 100644
index 0000000..da10513
--- /dev/null
+++ b/0049-Don-t-set-an-already-set-attribute-826357.patch
@@ -0,0 +1,39 @@
+From dbd9f15d806bc3925991809525ab44faf7ecc5f9 Mon Sep 17 00:00:00 2001
+From: Jesse Keating <jkeating at redhat.com>
+Date: Thu, 31 May 2012 18:41:25 -0700
+Subject: [PATCH] Don't set an already set attribute (#826357)
+
+Depending on how the dasd_mod module was loaded, our device could have
+already been marked as online or offline.  We need to make the sysecho
+sensitive to this and not fail if the attribute we're trying to set has
+already been set.
+---
+ modules.d/80cms/cmssetup.sh |    8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/modules.d/80cms/cmssetup.sh b/modules.d/80cms/cmssetup.sh
+index 995bfa7..41c853c 100755
+--- a/modules.d/80cms/cmssetup.sh
++++ b/modules.d/80cms/cmssetup.sh
+@@ -5,7 +5,7 @@
+ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
+ 
+ function sysecho () {
+-    file=$1
++    file="$1"
+     shift
+     local i=1
+     while [ $i -le 10 ] ; do
+@@ -16,7 +16,11 @@ function sysecho () {
+             break
+         fi
+     done
+-    [ -f "$file" ] && echo $* > $file
++    local status
++    read status < "$file"
++    if [[ ! $status == $* ]]; then
++        [ -f "$file" ] && echo $* > "$file"
++    fi
+ }
+ 
+ function dasd_settle() {
diff --git a/0050-add-filesystem-options-to-fsck_single.patch b/0050-add-filesystem-options-to-fsck_single.patch
new file mode 100644
index 0000000..df5c036
--- /dev/null
+++ b/0050-add-filesystem-options-to-fsck_single.patch
@@ -0,0 +1,125 @@
+From d1d8f11ea7a97491c46a8f406ed55bf74a29c460 Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald at redhat.com>
+Date: Thu, 31 May 2012 12:57:23 +0200
+Subject: [PATCH] add filesystem options to fsck_single()
+
+if we have e.g. special btrfs options for "/" and "/usr", we want to use
+those for the test mount to determine if the filesystem is corrupted.
+---
+ modules.d/95fstab-sys/mount-sys.sh     |    2 +-
+ modules.d/95rootfs-block/mount-root.sh |    2 +-
+ modules.d/98usrmount/mount-usr.sh      |    5 +++--
+ modules.d/99base/mount-hook.sh         |    2 +-
+ modules.d/99fs-lib/fs-lib.sh           |    9 +++++----
+ 5 files changed, 11 insertions(+), 9 deletions(-)
+
+diff --git a/modules.d/95fstab-sys/mount-sys.sh b/modules.d/95fstab-sys/mount-sys.sh
+index 895eb58..a1e5ab1 100755
+--- a/modules.d/95fstab-sys/mount-sys.sh
++++ b/modules.d/95fstab-sys/mount-sys.sh
+@@ -12,7 +12,7 @@ fstab_mount() {
+     while read _dev _mp _fs _opts _dump _pass _rest; do
+         [ -z "${_dev%%#*}" ] && continue # Skip comment lines
+         if [ "$_pass" -gt 0 ] && ! strstr "$_opts" _netdev; then
+-            fsck_single "$_dev" "$_fs"
++            fsck_single "$_dev" "$_fs" "$_opts"
+         fi
+         _fs=$(det_fs "$_dev" "$_fs")
+         info "Mounting $_dev"
+diff --git a/modules.d/95rootfs-block/mount-root.sh b/modules.d/95rootfs-block/mount-root.sh
+index aef99ae..2cae526 100755
+--- a/modules.d/95rootfs-block/mount-root.sh
++++ b/modules.d/95rootfs-block/mount-root.sh
+@@ -105,7 +105,7 @@ mount_root() {
+     ran_fsck=0
+     if [ -z "$fastboot" -a "$READONLY" != "yes" ] && ! strstr "${rflags},${rootopts}" _netdev; then
+         umount "$NEWROOT"
+-        fsck_single "${root#block:}" "$rootfs" "$fsckoptions"
++        fsck_single "${root#block:}" "$rootfs" "$rflags" "$fsckoptions"
+         _ret=$?
+         [ $_ret -ne 255 ] && echo $_ret >/run/initramfs/root-fsck
+         ran_fsck=1
+diff --git a/modules.d/98usrmount/mount-usr.sh b/modules.d/98usrmount/mount-usr.sh
+index 39f75b9..92638d1 100755
+--- a/modules.d/98usrmount/mount-usr.sh
++++ b/modules.d/98usrmount/mount-usr.sh
+@@ -9,6 +9,7 @@ fsck_usr()
+ {
+     local _dev=$1
+     local _fs=$2
++    local _fsopts=$3
+     local _fsckoptions
+ 
+     if [ -f "$NEWROOT"/fsckoptions ]; then
+@@ -31,7 +32,7 @@ fsck_usr()
+         _fsckoptions="$AUTOFSCK_OPT $_fsckoptions"
+     fi
+ 
+-    fsck_single "$_dev" "$_fs" "$_fsckoptions"
++    fsck_single "$_dev" "$_fs" "$_fsopts" "$_fsckoptions"
+ }
+ 
+ mount_usr()
+@@ -60,7 +61,7 @@ mount_usr()
+     if [ "x$_usr_found" != "x" ]; then
+         # we have to mount /usr
+         if [ "0" != "${_passno:-0}" ]; then
+-            fsck_usr "$_dev" "$_fs"
++            fsck_usr "$_dev" "$_fs" "$_opts"
+         else
+             :
+         fi
+diff --git a/modules.d/99base/mount-hook.sh b/modules.d/99base/mount-hook.sh
+index 99b17dd..dcf1415 100755
+--- a/modules.d/99base/mount-hook.sh
++++ b/modules.d/99base/mount-hook.sh
+@@ -113,7 +113,7 @@ mount_root() {
+     # printf '%s %s %s %s 1 1 \n' "$esc_root" "$NEWROOT" "$rootfs" "$rflags" >/etc/fstab
+ 
+     if [ -z "$fastboot" -a "$READONLY" != "yes" ] && ! strstr "${rflags},${rootopts}" _netdev; then
+-        fsck_single "${root#block:}" "$rootfs" "$fsckoptions"
++        fsck_single "${root#block:}" "$rootfs" "$rflags" "$fsckoptions"
+         _ret=$?
+         [ $_ret -ne 255 ] && echo $_ret >/run/initramfs/root-fsck
+     fi
+diff --git a/modules.d/99fs-lib/fs-lib.sh b/modules.d/99fs-lib/fs-lib.sh
+index f9dbbf9..75bee92 100755
+--- a/modules.d/99fs-lib/fs-lib.sh
++++ b/modules.d/99fs-lib/fs-lib.sh
+@@ -89,7 +89,7 @@ fsck_drv_xfs() {
+     mkdir -p /tmp/.xfs
+ 
+     info "trying to mount $_dev"
+-    if mount -t xfs "$_dev" "/tmp/.xfs" >/dev/null 2>&1; then
++    if mount -t xfs ${_fsopts+-o $_fsopts} "$_dev" "/tmp/.xfs" >/dev/null 2>&1; then
+         _ret=0
+         info "xfs: $_dev is clean"
+         umount "$_dev" >/dev/null 2>&1
+@@ -119,7 +119,7 @@ fsck_drv_btrfs() {
+     mkdir -p /tmp/.btrfs
+ 
+     info "trying to mount $_dev"
+-    if mount -t btrfs "$_dev" "/tmp/.btrfs" >/dev/null 2>&1; then
++    if mount -t btrfs ${_fsopts+-o $_fsopts} "$_dev" "/tmp/.btrfs" >/dev/null 2>&1; then
+         _ret=0
+         info "btrfs: $_dev is clean"
+         umount "$_dev" >/dev/null 2>&1
+@@ -177,7 +177,7 @@ fsck_drv_std() {
+ 
+ # checks single filesystem, relying on specific "driver"; we don't rely on
+ # automatic checking based on fstab, so empty one is passed;
+-# takes 3 arguments - device, filesystem, additional fsck options;
++# takes 4 arguments - device, filesystem, filesystem options, additional fsck options;
+ # first 2 arguments are mandatory (fs may be auto or "")
+ # returns 255 if filesystem wasn't checked at all (e.g. due to lack of
+ # necessary tools or insufficient options)
+@@ -185,7 +185,8 @@ fsck_single() {
+     local FSTAB_FILE=/etc/fstab.empty
+     local _dev="$1"
+     local _fs="${2:-auto}"
+-    local _fop="$3"
++    local _fsopts="$3"
++    local _fop="$4"
+     local _drv
+ 
+     [ $# -lt 2 ] && return 255
diff --git a/dracut.spec b/dracut.spec
index 5cd9345..c4cd791 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -10,7 +10,7 @@
 
 Name: dracut
 Version: 018
-Release: 40.git20120522%{?dist}
+Release: 51.git20120604%{?dist}
 
 Summary: Initramfs generator using udev
 %if 0%{?fedora} || 0%{?rhel}
@@ -63,6 +63,17 @@ Patch36: 0036-Use-the-right-argument-for-dasd-module-options.patch
 Patch37: 0037-Translate-dasd-arg-contents-into-proper-dasd.conf.patch
 Patch38: 0038-Normalize-dasd-argument-content-for-dasd.conf.patch
 Patch39: 0039-ifcfg-write-ifcfg.sh-fixed-IFS-resetting.patch
+Patch40: 0040-Relax-the-rules-for-kdump-we-don-t-specify-netroot-i.patch
+Patch41: 0041-url-lib-url-lib.sh-disable-curl-progress-bar.patch
+Patch42: 0042-network-ifup.sh-do-not-default-to-dhcp-for-interface.patch
+Patch43: 0043-network-do-not-arping-with-qeth-layer3-interfaces.patch
+Patch44: 0044-dracut-shutdown.service-do-not-unpack-old-initramfs-.patch
+Patch45: 0045-crypt-add-rd.luks.allow-discards-and-honor-options-i.patch
+Patch46: 0046-dasd_mod-parse-dasd-mod.sh-fixed-dasd_mod-param-gene.patch
+Patch47: 0047-fix-return-value-of-some-installkernel-functions.patch
+Patch48: 0048-dracut.sh-do-not-rely-on-the-presence-of-lib64-check.patch
+Patch49: 0049-Don-t-set-an-already-set-attribute-826357.patch
+Patch50: 0050-add-filesystem-options-to-fsck_single.patch
 
 
 BuildArch: noarch
@@ -378,6 +389,23 @@ rm -rf $RPM_BUILD_ROOT
 %dir /var/lib/dracut/overlay
 
 %changelog
+* Mon Jun 04 2012 Harald Hoyer <harald at redhat.com> 018-51.git20120604
+- fix network rules for kdump
+Resolves: rhbz#822750
+- disable curl progress bar
+Resolves: rhbz#817301 rhbz#824883
+- do not default to dhcp for interfaces without ip=
+- do not arping with qeth layer3 interfaces
+Resolves: rhbz#825783
+- do not unpack the initramfs, if the old initramfs still exists
+- add rd.luks.allow-discards and honor options in crypttab
+- fixed dasd_mod param generation
+- fix return value of some installkernel() functions
+- do not rely on the presence of lib64, check with ldd
+- dasd: don't set an already set attribute
+Resolves: rhbz#826357
+- add filesystem options to fsck_single()
+
 * Tue May 22 2012 Harald Hoyer <harald at redhat.com> 018-40.git20120522
 - fixed s390 dasd handling
 - fixed DNS bug for s390


More information about the scm-commits mailing list