diff --git a/0016-dracut.sh-mkdir-initdir-lib-dracut.patch b/0016-dracut.sh-mkdir-initdir-lib-dracut.patch new file mode 100644 index 0000000..bef4cb1 --- /dev/null +++ b/0016-dracut.sh-mkdir-initdir-lib-dracut.patch @@ -0,0 +1,33 @@ +From 43fed15129dc4916c37ebd8980aba78b6609943b Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 12 Jun 2012 11:35:49 -0400 +Subject: [PATCH] dracut.sh: mkdir $initdir/lib/dracut + +--- + dracut.sh | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/dracut.sh b/dracut.sh +index a1b39e3..c26e0f8 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -731,7 +731,10 @@ if [[ $kernel_only != yes ]]; then + mkdir -m 0755 -p ${initdir}/lib/dracut/hooks/$_d + done + if [[ "$UID" = "0" ]]; then +- cp -a /dev/kmsg /dev/null /dev/console $initdir/dev ++ for i in /dev/kmsg /dev/null /dev/console; do ++ [ -e $i ] || continue ++ cp -a $i $initdir/dev ++ done + fi + fi + +@@ -780,6 +783,7 @@ done + unset moddir + + for i in $modules_loaded; do ++ mkdir -p $initdir/lib/dracut + echo "$i" >> $initdir/lib/dracut/modules.txt + done + diff --git a/0017-fix-ifup-for-static-ipv6.patch b/0017-fix-ifup-for-static-ipv6.patch new file mode 100644 index 0000000..7df160e --- /dev/null +++ b/0017-fix-ifup-for-static-ipv6.patch @@ -0,0 +1,34 @@ +From 50b08e7b85085169459dd971b711f712744598ef Mon Sep 17 00:00:00 2001 +From: Will Woods +Date: Mon, 11 Jun 2012 13:46:21 -0400 +Subject: [PATCH] fix ifup for static ipv6 + +"brd +" is not valid for ipv6. This causes the 'ip addr add' command to +fail with the message "Broadcast can be set only for IPv4 addresses". + +So: don't use "brd +" for ipv6. +--- + modules.d/40network/ifup.sh | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh +index 35ae3c6..ae434a8 100755 +--- a/modules.d/40network/ifup.sh ++++ b/modules.d/40network/ifup.sh +@@ -105,10 +105,13 @@ do_static() { + wait_for_if_up $netif + [ -n "$macaddr" ] && ip link set address $macaddr + [ -n "$mtu" ] && ip link set mtu $mtu +- # do not flush addr for ipv6 +- strstr $ip '*:*:*' || \ ++ if strstr $ip '*:*:*'; then ++ # note no ip addr flush for ipv6 ++ ip addr add $ip/$mask dev $netif ++ else + ip addr flush dev $netif +- ip addr add $ip/$mask brd + dev $netif ++ ip addr add $ip/$mask brd + dev $netif ++ fi + + [ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw + [ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname diff --git a/0018-ifcfg-fix-output-for-ipv6-static-addressing.patch b/0018-ifcfg-fix-output-for-ipv6-static-addressing.patch new file mode 100644 index 0000000..daea958 --- /dev/null +++ b/0018-ifcfg-fix-output-for-ipv6-static-addressing.patch @@ -0,0 +1,48 @@ +From 30430fbe3096da363a2ef6b8c791e701643e15aa Mon Sep 17 00:00:00 2001 +From: Will Woods +Date: Mon, 11 Jun 2012 13:46:22 -0400 +Subject: [PATCH] ifcfg: fix output for ipv6 static addressing + +IPV6 configuration is pretty different than IPV4; write out the correct +set of values to make static IPV6 addressing work. +--- + modules.d/45ifcfg/write-ifcfg.sh | 23 ++++++++++++++++------- + 1 file changed, 16 insertions(+), 7 deletions(-) + +diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh +index 202a16a..b62170d 100755 +--- a/modules.d/45ifcfg/write-ifcfg.sh ++++ b/modules.d/45ifcfg/write-ifcfg.sh +@@ -109,16 +109,25 @@ for netif in $IFACES ; do + echo "BOOTPROTO=dhcp" + cp /tmp/net.$netif.lease /tmp/ifcfg-leases/dhclient-$uuid-$netif.lease + else +- echo "BOOTPROTO=none" +- # If we've booted with static ip= lines, the override file is there ++ # If we've booted with static ip= lines, the override file is there + [ -e /tmp/net.$netif.override ] && . /tmp/net.$netif.override +- echo "IPADDR=$ip" +- if strstr "$mask" "."; then +- echo "NETMASK=$mask" ++ if strstr "$ip" '*:*:*'; then ++ echo "IPV6_AUTOCONF=no" ++ echo "IPV6ADDR=$ip/$mask" + else +- echo "PREFIX=$mask" ++ echo "BOOTPROTO=none" ++ echo "IPADDR=$ip" ++ if strstr "$mask" "."; then ++ echo "NETMASK=$mask" ++ else ++ echo "PREFIX=$mask" ++ fi ++ fi ++ if strstr "$gw" '*:*:*'; then ++ echo "IPV6_DEFAULTGW=$gw" ++ elif [ -n "$gw" ]; then ++ echo "GATEWAY=$gw" + fi +- [ -n "$gw" ] && echo "GATEWAY=$gw" + fi + } > /tmp/ifcfg/ifcfg-$netif + diff --git a/0019-add-PARTUUID-as-root-PARTUUID-partition-uuid-paramet.patch b/0019-add-PARTUUID-as-root-PARTUUID-partition-uuid-paramet.patch new file mode 100644 index 0000000..604808a --- /dev/null +++ b/0019-add-PARTUUID-as-root-PARTUUID-partition-uuid-paramet.patch @@ -0,0 +1,37 @@ +From b23a2837db758215c9855f14b7d1081b7ad0077c Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 14 Jun 2012 13:04:22 +0200 +Subject: [PATCH] add PARTUUID as root=PARTUUID= parameter + +--- + dracut.cmdline.7.asc | 1 + + modules.d/95rootfs-block/parse-block.sh | 4 ++++ + 2 files changed, 5 insertions(+) + +diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc +index 9fa0ee8..883223c 100644 +--- a/dracut.cmdline.7.asc ++++ b/dracut.cmdline.7.asc +@@ -47,6 +47,7 @@ root=/dev/disk/by-label/Root + root=LABEL=Root + root=/dev/disk/by-uuid/3f5ad593-4546-4a94-a374-bcfb68aa11f7 + root=UUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7 ++root=PARTUUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7 + ---- + + **rootfstype=**__:: "auto" if not specified, e.g.: +diff --git a/modules.d/95rootfs-block/parse-block.sh b/modules.d/95rootfs-block/parse-block.sh +index 69f38be..3745352 100755 +--- a/modules.d/95rootfs-block/parse-block.sh ++++ b/modules.d/95rootfs-block/parse-block.sh +@@ -12,6 +12,10 @@ case "$root" in + root="${root#block:}" + root="block:/dev/disk/by-uuid/${root#UUID=}" + rootok=1 ;; ++ block:PARTUUID=*|PARTUUID=*) ++ root="${root#block:}" ++ root="block:/dev/disk/by-partuuid/${root#PARTUUID=}" ++ rootok=1 ;; + /dev/*) + root="block:${root}" + rootok=1 ;; diff --git a/0020-Debian-multiarch-support.patch b/0020-Debian-multiarch-support.patch new file mode 100644 index 0000000..80cbd47 --- /dev/null +++ b/0020-Debian-multiarch-support.patch @@ -0,0 +1,45 @@ +From cacaa90c63512a068720d61d671ce3ddd1fbd81d Mon Sep 17 00:00:00 2001 +From: Thomas Lange +Date: Thu, 14 Jun 2012 17:42:34 +0200 +Subject: [PATCH] Debian multiarch support + +Hi Jon, + +here's the diff which works for me. The quotation marks around $@ do +not work for me. Instead of "$@" I must to use $_dir/$@ (or +"$_dir"/$@) but no quotation marks around $@. Could you please review +my patch. +--- + dracut-functions.sh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 6a72fce..38367b4 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -699,13 +699,13 @@ dracut_install() { + + # inst_libdir_file [-n ] [...] + # Install a located on a lib directory to the initramfs image +-# -n install non-matching files ++# -n install matching files + inst_libdir_file() { + if [[ "$1" == "-n" ]]; then +- local _pattern=$1 ++ local _pattern=$2 + shift 2 + for _dir in $libdirs; do +- for _i in "$@"; do ++ for _i in $_dir/$@; do + for _f in "$_dir"/$_i; do + [[ "$_i" =~ $_pattern ]] || continue + [[ -e "$_i" ]] && dracut_install "$_i" +@@ -714,7 +714,7 @@ inst_libdir_file() { + done + else + for _dir in $libdirs; do +- for _i in "$@"; do ++ for _i in $_dir/$@; do + for _f in "$_dir"/$_i; do + [[ -e "$_f" ]] && dracut_install "$_f" + done diff --git a/0021-dracut-functions.sh-fixup-inst_libdir_file-again.patch b/0021-dracut-functions.sh-fixup-inst_libdir_file-again.patch new file mode 100644 index 0000000..d219bc7 --- /dev/null +++ b/0021-dracut-functions.sh-fixup-inst_libdir_file-again.patch @@ -0,0 +1,34 @@ +From 7828692f97c2db3af36ad8ac3e75b60cfd971875 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 15 Jun 2012 09:34:00 +0200 +Subject: [PATCH] dracut-functions.sh: fixup inst_libdir_file() again + +--- + dracut-functions.sh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 38367b4..7439131 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -705,16 +705,16 @@ inst_libdir_file() { + local _pattern=$2 + shift 2 + for _dir in $libdirs; do +- for _i in $_dir/$@; do ++ for _i in "$@"; do + for _f in "$_dir"/$_i; do +- [[ "$_i" =~ $_pattern ]] || continue +- [[ -e "$_i" ]] && dracut_install "$_i" ++ [[ "$_f" =~ $_pattern ]] || continue ++ [[ -e "$_f" ]] && dracut_install "$_f" + done + done + done + else + for _dir in $libdirs; do +- for _i in $_dir/$@; do ++ for _i in "$@"; do + for _f in "$_dir"/$_i; do + [[ -e "$_f" ]] && dracut_install "$_f" + done diff --git a/0022-dracut.sh-output-unknown-argument.patch b/0022-dracut.sh-output-unknown-argument.patch new file mode 100644 index 0000000..45dc59c --- /dev/null +++ b/0022-dracut.sh-output-unknown-argument.patch @@ -0,0 +1,21 @@ +From 1d2c070071996dc6a31e4981b770e01746fa0ff0 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 15 Jun 2012 11:11:10 +0200 +Subject: [PATCH] dracut.sh: output unknown argument + +--- + dracut.sh | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/dracut.sh b/dracut.sh +index c26e0f8..309fd7d 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -289,6 +289,7 @@ while (($# > 0)); do + elif ! [[ ${kernel+x} ]]; then + kernel=$1 + else ++ echo "Unknown argument: $1" + usage; exit 1; + fi + ;; diff --git a/0023-dracut.sh-unset-some-variables.patch b/0023-dracut.sh-unset-some-variables.patch new file mode 100644 index 0000000..424132a --- /dev/null +++ b/0023-dracut.sh-unset-some-variables.patch @@ -0,0 +1,22 @@ +From f79e587cf34e9d9c68e87ebad3e5620b0a190581 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 15 Jun 2012 11:11:30 +0200 +Subject: [PATCH] dracut.sh: unset some variables + +--- + dracut.sh | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/dracut.sh b/dracut.sh +index 309fd7d..64cd75e 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -217,6 +217,8 @@ push_arg() { + } + + verbosity_mod_l=0 ++unset kernel ++unset outfile + + while (($# > 0)); do + case ${1%%=*} in diff --git a/0024-nfs-extend-libnss-wildcard.patch b/0024-nfs-extend-libnss-wildcard.patch new file mode 100644 index 0000000..96186a7 --- /dev/null +++ b/0024-nfs-extend-libnss-wildcard.patch @@ -0,0 +1,22 @@ +From 9f6baa127aa6a4fb6cec9a6ef4e8d5b3299362b0 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 15 Jun 2012 11:12:08 +0200 +Subject: [PATCH] nfs: extend libnss wildcard + +--- + modules.d/95nfs/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh +index bf87762..fb4dc9c 100755 +--- a/modules.d/95nfs/module-setup.sh ++++ b/modules.d/95nfs/module-setup.sh +@@ -52,7 +52,7 @@ install() { + _nsslibs=${_nsslibs#|} + _nsslibs=${_nsslibs%|} + +- inst_libdir_file -n "$_nsslibs" "libnss*.so" ++ inst_libdir_file -n "$_nsslibs" 'libnss*.so*' + + inst_hook cmdline 90 "$moddir/parse-nfsroot.sh" + inst_hook pre-udev 99 "$moddir/nfs-start-rpc.sh" diff --git a/0025-TEST-50-MULTINIC-install-correct-nss-libs.patch b/0025-TEST-50-MULTINIC-install-correct-nss-libs.patch new file mode 100644 index 0000000..1b60585 --- /dev/null +++ b/0025-TEST-50-MULTINIC-install-correct-nss-libs.patch @@ -0,0 +1,206 @@ +From 3eca0cc846e89675949abb11e9606f3222a2e266 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 15 Jun 2012 11:12:46 +0200 +Subject: [PATCH] TEST-50-MULTINIC: install correct nss libs + +--- + test/TEST-50-MULTINIC/test.sh | 118 ++++++++++++++++++++++++++--------------- + 1 file changed, 74 insertions(+), 44 deletions(-) + +diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh +index 712f90e..6efa8ef 100755 +--- a/test/TEST-50-MULTINIC/test.sh ++++ b/test/TEST-50-MULTINIC/test.sh +@@ -12,7 +12,7 @@ run_server() { + # Start server first + echo "MULTINIC TEST SETUP: Starting DHCP/NFS server" + +- $testdir/run-qemu -hda $TESTDIR/server.ext2 -m 256M -nographic \ ++ $testdir/run-qemu -hda $TESTDIR/server.ext3 -m 512M -nographic \ + -net nic,macaddr=52:54:00:12:34:56,model=e1000 \ + -net socket,listen=127.0.0.1:12350 \ + -serial $SERIAL \ +@@ -122,15 +122,41 @@ test_client() { + + test_setup() { + # Make server root +- dd if=/dev/null of=$TESTDIR/server.ext2 bs=1M seek=60 +- mke2fs -F $TESTDIR/server.ext2 +- mkdir $TESTDIR/mnt +- sudo mount -o loop $TESTDIR/server.ext2 $TESTDIR/mnt ++ dd if=/dev/null of=$TESTDIR/server.ext3 bs=1M seek=60 ++ mke2fs -j -F $TESTDIR/server.ext3 ++ mkdir $TESTDIR/mnt ++ sudo mount -o loop $TESTDIR/server.ext3 $TESTDIR/mnt ++ ++ export kernel=$KVERSION ++ export srcmods="/lib/modules/$kernel/" ++ # Detect lib paths ++ ++ . $basedir/dracut-functions.sh ++ if ! [[ $libdirs ]] ; then ++ if strstr "$(ldd /bin/sh)" "/lib64/" &>/dev/null \ ++ && [[ -d /lib64 ]]; then ++ libdirs+=" /lib64" ++ [[ -d /usr/lib64 ]] && libdirs+=" /usr/lib64" ++ else ++ libdirs+=" /lib" ++ [[ -d /usr/lib ]] && libdirs+=" /usr/lib" ++ fi ++ fi + +- kernel=$KVERSION +- ( ++ ( + initdir=$TESTDIR/mnt +- . $basedir/dracut-functions.sh ++ ++ for _f in modules.builtin.bin modules.builtin; do ++ [[ $srcmods/$_f ]] && break ++ done || { ++ dfatal "No modules.builtin.bin and modules.builtin found!" ++ return 1 ++ } ++ ++ for _f in modules.builtin.bin modules.builtin modules.order; do ++ [[ $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f" ++ done ++ + dracut_install sh ls shutdown poweroff stty cat ps ln ip \ + dmesg mkdir cp ping exportfs \ + modprobe rpc.nfsd rpc.mountd showmount tcpdump \ +@@ -144,36 +170,32 @@ test_setup() { + [ -f /etc/netconfig ] && dracut_install /etc/netconfig + type -P dhcpd >/dev/null && dracut_install dhcpd + [ -x /usr/sbin/dhcpd3 ] && inst /usr/sbin/dhcpd3 /usr/sbin/dhcpd +- instmods nfsd sunrpc ipv6 ++ instmods nfsd sunrpc ipv6 lockd + inst ./server-init.sh /sbin/init + inst ./hosts /etc/hosts + inst ./exports /etc/exports + inst ./dhcpd.conf /etc/dhcpd.conf + dracut_install /etc/nsswitch.conf /etc/rpc /etc/protocols + dracut_install rpc.idmapd /etc/idmapd.conf +- if ldd $(type -P rpc.idmapd) |grep -q lib64; then +- LIBDIR="/lib64" +- else +- LIBDIR="/lib" +- fi + +- dracut_install $(ls {/usr,}$LIBDIR/libnfsidmap*.so* 2>/dev/null ) +- dracut_install $(ls {/usr,}$LIBDIR/libnfsidmap/*.so 2>/dev/null ) +- dracut_install $(ls {/usr,}$LIBDIR/libnss*.so 2>/dev/null) ++ inst_libdir_file 'libnfsidmap_nsswitch.so*' ++ inst_libdir_file 'libnfsidmap/*.so*' ++ inst_libdir_file 'libnfsidmap*.so*' + ++ _nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \ ++ | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|') ++ _nsslibs=${_nsslibs#|} ++ _nsslibs=${_nsslibs%|} + +- nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \ +- | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|') +- nsslibs=${nsslibs#|} +- nsslibs=${nsslibs%|} ++ inst_libdir_file -n "$_nsslibs" 'libnss*.so*' + +- dracut_install $(for i in $(ls {/usr,}$LIBDIR/libnss*.so 2>/dev/null); do echo $i;done | egrep "$nsslibs") + ( + cd "$initdir"; + mkdir -p dev sys proc etc var/run tmp var/lib/{dhcpd,rpcbind} + mkdir -p var/lib/nfs/{v4recovery,rpc_pipefs} + chmod 777 var/lib/rpcbind var/lib/nfs + ) ++ + inst /etc/nsswitch.conf /etc/nsswitch.conf + inst /etc/passwd /etc/passwd + inst /etc/group /etc/group +@@ -181,49 +203,57 @@ test_setup() { + inst_library $i + done + +- /sbin/depmod -a -b "$initdir" $kernel ++ /sbin/depmod -a -b "$initdir" $kernel ++ + cp -a /etc/ld.so.conf* $initdir/etc + sudo ldconfig -r "$initdir" +- ) ++ ) + + # Make client root inside server root + initdir=$TESTDIR/mnt/nfs/client + mkdir -p $initdir + + ( +- . $basedir/dracut-functions.sh +- dracut_install sh shutdown poweroff stty cat ps ln ip \ +- mount dmesg mkdir \ +- cp ping grep ls ++ dracut_install sh shutdown poweroff stty cat ps ln ip \ ++ mount dmesg mkdir cp ping grep ls + for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do + [ -f ${_terminfodir}/l/linux ] && break + done + dracut_install -o ${_terminfodir}/l/linux +- inst ./client-init.sh /sbin/init +- ( +- cd "$initdir" +- mkdir -p dev sys proc etc run +- mkdir -p var/lib/nfs/rpc_pipefs ++ inst ./client-init.sh /sbin/init ++ ( ++ cd "$initdir" ++ mkdir -p dev sys proc etc run ++ mkdir -p var/lib/nfs/rpc_pipefs + ) +- inst /etc/nsswitch.conf /etc/nsswitch.conf +- inst /etc/passwd /etc/passwd +- inst /etc/group /etc/group +- for i in /lib*/libnss_files*;do +- inst_library $i +- done ++ inst /etc/nsswitch.conf /etc/nsswitch.conf ++ inst /etc/passwd /etc/passwd ++ inst /etc/group /etc/group ++ ++ inst_libdir_file 'libnfsidmap_nsswitch.so*' ++ inst_libdir_file 'libnfsidmap/*.so*' ++ inst_libdir_file 'libnfsidmap*.so*' ++ ++ _nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \ ++ | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|') ++ _nsslibs=${_nsslibs#|} ++ _nsslibs=${_nsslibs%|} ++ ++ inst_libdir_file -n "$_nsslibs" 'libnss*.so*' + + cp -a /etc/ld.so.conf* $initdir/etc + sudo ldconfig -r "$initdir" +- ) ++ ) ++ ++ chroot $initdir + +- sudo umount $TESTDIR/mnt +- rm -fr $TESTDIR/mnt ++ sudo umount $TESTDIR/mnt ++ rm -fr $TESTDIR/mnt + + # Make an overlay with needed tools for the test harness + ( + initdir=$TESTDIR/overlay + mkdir $TESTDIR/overlay +- . $basedir/dracut-functions.sh + dracut_install poweroff shutdown + inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules +@@ -232,7 +262,7 @@ test_setup() { + # Make server's dracut image + $basedir/dracut.sh -l -i $TESTDIR/overlay / \ + -m "dash udev-rules base rootfs-block debug kernel-modules" \ +- -d "piix ide-gd_mod ata_piix ext2 sd_mod e1000" \ ++ -d "piix ide-gd_mod ata_piix ext3 sd_mod e1000" \ + -f $TESTDIR/initramfs.server $KVERSION || return 1 + + # Make client's dracut image diff --git a/0026-Revert-network-ifup.sh-default-to-dhcp-for-BOOTIF.patch b/0026-Revert-network-ifup.sh-default-to-dhcp-for-BOOTIF.patch new file mode 100644 index 0000000..49f2b8b --- /dev/null +++ b/0026-Revert-network-ifup.sh-default-to-dhcp-for-BOOTIF.patch @@ -0,0 +1,28 @@ +From f9ad49c2a59d1c452a2137a6332ff77afcde1be3 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 15 Jun 2012 11:55:59 +0200 +Subject: [PATCH] Revert "network/ifup.sh: default to dhcp for BOOTIF" + +This reverts commit bebb12fd0ec3cbb88006e384a9a277391a2f3a37. +--- + modules.d/40network/ifup.sh | 7 ------- + 1 file changed, 7 deletions(-) + +diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh +index ae434a8..245b450 100755 +--- a/modules.d/40network/ifup.sh ++++ b/modules.d/40network/ifup.sh +@@ -216,13 +216,6 @@ if [ "$netif" = "$vlanname" ] && [ ! -e /tmp/net.$vlanname.up ]; then + ip link add dev "$vlanname" link "$phydevice" type vlan id "$(get_vid $vlanname; echo $?)" + fi + +-# BOOTIF= defaults to dhcpv4 +-bootif=$(getargs BOOTIF=) +-if [ -n "$bootif" ] ; then +- do_dhcp -4 +- exit 0 +-fi +- + # Specific configuration, spin through the kernel command line + # looking for ip= lines + for p in $(getargs ip=); do diff --git a/0027-Revert-network-ifup.sh-do-not-default-to-dhcp-for-in.patch b/0027-Revert-network-ifup.sh-do-not-default-to-dhcp-for-in.patch new file mode 100644 index 0000000..992f0a3 --- /dev/null +++ b/0027-Revert-network-ifup.sh-do-not-default-to-dhcp-for-in.patch @@ -0,0 +1,33 @@ +From c9aa3cc950ebec597e51cbc0899777c2a99ca276 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 15 Jun 2012 11:56:05 +0200 +Subject: [PATCH] Revert "network/ifup.sh: do not default to dhcp, for + interfaces without ip=..." + +This reverts commit ede0532c580fdbace548511b07857fb2e004b299. +--- + modules.d/40network/ifup.sh | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh +index 245b450..31eb966 100755 +--- a/modules.d/40network/ifup.sh ++++ b/modules.d/40network/ifup.sh +@@ -216,6 +216,17 @@ if [ "$netif" = "$vlanname" ] && [ ! -e /tmp/net.$vlanname.up ]; then + ip link add dev "$vlanname" link "$phydevice" type vlan id "$(get_vid $vlanname; echo $?)" + 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/0028-resolve-conflict-between-cms-network-rules-and-defau.patch b/0028-resolve-conflict-between-cms-network-rules-and-defau.patch new file mode 100644 index 0000000..2bf6bc1 --- /dev/null +++ b/0028-resolve-conflict-between-cms-network-rules-and-defau.patch @@ -0,0 +1,36 @@ +From 8fab6e0463e0b0c70327c2733911098aa56137a7 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 12 Jun 2012 14:40:43 +0200 +Subject: [PATCH] resolve conflict between cms network rules and default rules + +--- + modules.d/40network/net-genrules.sh | 2 +- + modules.d/80cms/cmssetup.sh | 2 ++ + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/modules.d/40network/net-genrules.sh b/modules.d/40network/net-genrules.sh +index 2d3dff2..99d0fe5 100755 +--- a/modules.d/40network/net-genrules.sh ++++ b/modules.d/40network/net-genrules.sh +@@ -53,7 +53,7 @@ fix_bootif() { + + # Default: We don't know the interface to use, handle all + else +- printf 'SUBSYSTEM=="net", RUN+="%s"\n' "/sbin/initqueue --onetime $ifup" ++ printf 'SUBSYSTEM=="net", RUN+="%s"\n' "/sbin/initqueue --onetime $ifup" > /etc/udev/rules.d/61-default-net.rules + fi + + } > /etc/udev/rules.d/60-net.rules +diff --git a/modules.d/80cms/cmssetup.sh b/modules.d/80cms/cmssetup.sh +index 41c853c..2208803 100755 +--- a/modules.d/80cms/cmssetup.sh ++++ b/modules.d/80cms/cmssetup.sh +@@ -166,6 +166,8 @@ processcmsfile() + fi + + printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="%s", KERNELS=="%s", ENV{INTERFACE}=="?*", RUN+="/sbin/initqueue --onetime --unique --name cmsifup-$env{INTERFACE} /sbin/cmsifup $env{INTERFACE}"\n' "$driver" "$devbusid" > /etc/udev/rules.d/99-cms.rules ++ # remove the default net rules ++ rm -f /etc/udev/rules.d/61-default-net.rules + [[ -f /etc/udev/rules.d/60-net.rules ]] \ + || printf 'SUBSYSTEM=="net", ACTION=="online", RUN+="/sbin/initqueue --onetime --env netif=$env{INTERFACE} source_hook initqueue/online"\n' >> /etc/udev/rules.d/99-cms.rules + diff --git a/0029-fixed-instmods-return-code-and-set-pipefail-globally.patch b/0029-fixed-instmods-return-code-and-set-pipefail-globally.patch new file mode 100644 index 0000000..197519e --- /dev/null +++ b/0029-fixed-instmods-return-code-and-set-pipefail-globally.patch @@ -0,0 +1,108 @@ +From 7abd426438984f9c3112fd409e9c019408fe85a4 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 18 Jun 2012 12:51:21 +0200 +Subject: [PATCH] fixed instmods() return code and set pipefail globally + +--- + dracut-functions.sh | 21 +++++++++------------ + dracut.sh | 2 ++ + 2 files changed, 11 insertions(+), 12 deletions(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 7439131..68c81f2 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -1028,11 +1028,11 @@ install_kmod_with_fw() { + _kmod=${_kmod/-/_} + if [[ "$_kmod" =~ $omit_drivers ]]; then + dinfo "Omitting driver $_kmod" +- return 1 ++ return 0 + fi + if [[ "${1##*/lib/modules/$kernel/}" =~ $omit_drivers ]]; then + dinfo "Omitting driver $_kmod" +- return 1 ++ return 0 + fi + fi + +@@ -1073,16 +1073,13 @@ install_kmod_with_fw() { + # rest of args = arguments to modprobe + # _fderr specifies FD passed from surrounding scope + for_each_kmod_dep() { +- local _func=$1 _kmod=$2 _cmd _modpath _options _found=0 ++ local _func=$1 _kmod=$2 _cmd _modpath _options + shift 2 + modprobe "$@" --ignore-install --show-depends $_kmod 2>&${_fderr} | ( + while read _cmd _modpath _options; do + [[ $_cmd = insmod ]] || continue + $_func ${_modpath} || exit $? +- _found=1 + done +- [[ $_found -eq 0 ]] && exit 1 +- exit 0 + ) + } + +@@ -1127,14 +1124,16 @@ instmods() { + ( [[ "$_mpargs" ]] && echo $_mpargs + cat "${srcmods}/modules.${_mod#=}" ) \ + | instmods ++ ((_ret+=$?)) + else + ( [[ "$_mpargs" ]] && echo $_mpargs +- find "$srcmods" -path "*/${_mod#=}/*" -printf '%f\n' ) \ ++ find "$srcmods" -type f -path "*/${_mod#=}/*" -printf '%f\n' ) \ + | instmods ++ ((_ret+=$?)) + fi + ;; + --*) _mpargs+=" $_mod" ;; +- i2o_scsi) return ;; # Do not load this diagnostic-only module ++ i2o_scsi) return 0;; # Do not load this diagnostic-only module + *) + _mod=${_mod##*/} + # if we are already installed, skip this module and go on +@@ -1143,14 +1142,14 @@ instmods() { + + if [[ $omit_drivers ]] && [[ "$1" =~ $omit_drivers ]]; then + dinfo "Omitting driver ${_mod##$srcmods}" +- return ++ return 0 + fi + # If we are building a host-specific initramfs and this + # module is not already loaded, move on to the next one. + [[ $hostonly ]] \ + && ! [[ -d $(echo /sys/module/${_mod//-/_}|{ read a b; echo $a; }) ]] \ + && ! [[ "$add_drivers" =~ " ${_mod} " ]] \ +- && return ++ && return 0 + + # We use '-d' option in modprobe only if modules prefix path + # differs from default '/'. This allows us to use Dracut with +@@ -1193,12 +1192,10 @@ instmods() { + } + + local _ret _filter_not_found='FATAL: Module .* not found.' +- set -o pipefail + # Capture all stderr from modprobe to _fderr. We could use {var}>... + # redirections, but that would make dracut require bash4 at least. + eval "( instmods_1 \"\$@\" ) ${_fderr}>&1" \ + | while read line; do [[ "$line" =~ $_filter_not_found ]] || echo $line;done | derror + _ret=$? +- set +o pipefail + return $_ret + } +diff --git a/dracut.sh b/dracut.sh +index 64cd75e..919f78e 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -26,6 +26,8 @@ + # store for logging + dracut_args="$@" + ++set -o pipefail ++ + usage() { + [[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut + if [[ -f $dracutbasedir/dracut-version.sh ]]; then diff --git a/0030-Set-some-global-variables-in-dracut-functions.sh.patch b/0030-Set-some-global-variables-in-dracut-functions.sh.patch new file mode 100644 index 0000000..c0f0383 --- /dev/null +++ b/0030-Set-some-global-variables-in-dracut-functions.sh.patch @@ -0,0 +1,109 @@ +From 8d95b8b338d65188c517b3bda8a4697867c6ef01 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 18 Jun 2012 12:52:39 +0200 +Subject: [PATCH] Set some global variables in dracut-functions.sh + +--- + dracut-functions.sh | 34 +++++++++++++++++++++++++++++++--- + dracut.sh | 22 ---------------------- + 2 files changed, 31 insertions(+), 25 deletions(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 68c81f2..1137919 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -20,6 +20,9 @@ + # along with this program. If not, see . + # + ++# Generic substring function. If $2 is in $1, return 0. ++strstr() { [ "${1#*$2*}" != "$1" ]; } ++ + if ! [[ $dracutbasedir ]]; then + dracutbasedir=${BASH_SOURCE[0]%/*} + [[ $dracutbasedir = "dracut-functions" ]] && dracutbasedir="." +@@ -27,6 +30,34 @@ if ! [[ $dracutbasedir ]]; then + dracutbasedir="$(readlink -f $dracutbasedir)" + fi + ++# Detect lib paths ++if ! [[ $libdirs ]] ; then ++ if strstr "$(ldd /bin/sh)" "/lib64/" &>/dev/null \ ++ && [[ -d /lib64 ]]; then ++ libdirs+=" /lib64" ++ [[ -d /usr/lib64 ]] && libdirs+=" /usr/lib64" ++ else ++ libdirs+=" /lib" ++ [[ -d /usr/lib ]] && libdirs+=" /usr/lib" ++ fi ++ export libdirs ++fi ++ ++if ! [[ $kernel ]]; then ++ kernel=$(uname -r) ++ export kernel ++fi ++ ++srcmods="/lib/modules/$kernel/" ++[[ $drivers_dir ]] && { ++ if vercmp $(modprobe --version | cut -d' ' -f3) lt 3.7; then ++ dfatal 'To use --kmoddir option module-init-tools >= 3.7 is required.' ++ exit 1 ++ fi ++ srcmods="$drivers_dir" ++} ++export srcmods ++ + if ! type dinfo >/dev/null 2>&1; then + . "$dracutbasedir/dracut-logger.sh" + dlog_init +@@ -41,9 +72,6 @@ fi + export hookdirs + } + +-# Generic substring function. If $2 is in $1, return 0. +-strstr() { [ "${1#*$2*}" != "$1" ]; } +- + # Create all subdirectories for given path without creating the last element. + # $1 = path + mksubdirs() { mkdir -m 0755 -p ${1%/*}; } +diff --git a/dracut.sh b/dracut.sh +index 919f78e..5600ec0 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -531,18 +531,6 @@ ddebug "Executing $0 $dracut_args" + exit 0 + } + +-# Detect lib paths +-if ! [[ $libdirs ]] ; then +- if strstr "$(ldd /bin/sh)" "/lib64/" &>/dev/null \ +- && [[ -d /lib64 ]]; then +- libdirs+=" /lib64" +- [[ -d /usr/lib64 ]] && libdirs+=" /usr/lib64" +- else +- libdirs+=" /lib" +- [[ -d /usr/lib ]] && libdirs+=" /usr/lib" +- fi +-fi +- + # This is kinda legacy -- eventually it should go away. + case $dracutmodules in + ""|auto) dracutmodules="all" ;; +@@ -550,16 +538,6 @@ esac + + abs_outfile=$(readlink -f "$outfile") && outfile="$abs_outfile" + +-srcmods="/lib/modules/$kernel/" +-[[ $drivers_dir ]] && { +- if vercmp $(modprobe --version | cut -d' ' -f3) lt 3.7; then +- dfatal 'To use --kmoddir option module-init-tools >= 3.7 is required.' +- exit 1 +- fi +- srcmods="$drivers_dir" +-} +-export srcmods +- + [[ -f $srcmods/modules.dep ]] || { + dfatal "$srcmods/modules.dep is missing. Did you run depmod?" + exit 1 diff --git a/0031-iscsi-module-setup.sh-only-install-s390-driver-on-s3.patch b/0031-iscsi-module-setup.sh-only-install-s390-driver-on-s3.patch new file mode 100644 index 0000000..35f87cd --- /dev/null +++ b/0031-iscsi-module-setup.sh-only-install-s390-driver-on-s3.patch @@ -0,0 +1,33 @@ +From 4f9f76cd629cfe7c31586eb2bfd0d4c61322db86 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 18 Jun 2012 13:26:55 +0200 +Subject: [PATCH] iscsi/module-setup.sh: only install s390 driver on s390 arch + +--- + modules.d/95iscsi/module-setup.sh | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh +index bfd9d73..fefc240 100755 +--- a/modules.d/95iscsi/module-setup.sh ++++ b/modules.d/95iscsi/module-setup.sh +@@ -37,6 +37,8 @@ depends() { + } + + installkernel() { ++ local _arch=$(uname -m) ++ + instmods iscsi_tcp iscsi_ibft crc32c bnx2i iscsi_boot_sysfs qla4xxx cxgb3i cxgb4i be2iscsi + iscsi_module_filter() { + local _iscsifuncs='iscsi_register_transport' +@@ -47,8 +49,9 @@ installkernel() { + *.ko.xz) [[ $(xz -dc <$_f) =~ $_iscsifuncs ]] && echo "$_f" ;; + esac + done ++ return 0; + } +- { find_kernel_modules_by_path drivers/scsi; find_kernel_modules_by_path drivers/s390/scsi; } \ ++ { find_kernel_modules_by_path drivers/scsi; if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then find_kernel_modules_by_path drivers/s390/scsi; fi;} \ + | iscsi_module_filter | instmods + } + diff --git a/0032-plymouth-fixed-inst_libdir_file-call.patch b/0032-plymouth-fixed-inst_libdir_file-call.patch new file mode 100644 index 0000000..d2f5273 --- /dev/null +++ b/0032-plymouth-fixed-inst_libdir_file-call.patch @@ -0,0 +1,33 @@ +From 0efc6c716a0f4e0def943e3c661decc75fe6f958 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 18 Jun 2012 13:45:13 +0200 +Subject: [PATCH] plymouth: fixed inst_libdir_file() call + +https://bugzilla.redhat.com/show_bug.cgi?id=831349 +--- + modules.d/50plymouth/plymouth-populate-initrd.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/modules.d/50plymouth/plymouth-populate-initrd.sh b/modules.d/50plymouth/plymouth-populate-initrd.sh +index 7ab1a5d..1e2ffe7 100755 +--- a/modules.d/50plymouth/plymouth-populate-initrd.sh ++++ b/modules.d/50plymouth/plymouth-populate-initrd.sh +@@ -11,8 +11,9 @@ dracut_install /bin/plymouth \ + + mkdir -m 0755 -p "${initdir}/usr/share/plymouth" + ++inst_libdir_file "plymouth/text.so" "plymouth/details.so" ++ + if [[ $hostonly ]]; then +- inst_libdir_file "plymouth/text.so" "plymouth/details.so" + dracut_install \ + "/usr/share/plymouth/themes/details/details.plymouth" \ + "/usr/share/plymouth/themes/text/text.plymouth" \ +@@ -37,7 +38,6 @@ else + mkdir -m 0755 -p "${initdir}/$THEME_DIR" + dracut_install "$x" + done +- inst_libdir_file "/plymouth/{text,details}.so" + ( + cd ${initdir}/usr/share/plymouth/themes; + ln -s text/text.plymouth default.plymouth 2>&1; diff --git a/0033-add-04watchdog-dracut-module.patch b/0033-add-04watchdog-dracut-module.patch new file mode 100644 index 0000000..0adbaf8 --- /dev/null +++ b/0033-add-04watchdog-dracut-module.patch @@ -0,0 +1,80 @@ +From ef914f7d833b7ea7a5916e7d56c9e9c158d3783a Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 18 Jun 2012 19:17:22 +0200 +Subject: [PATCH] add 04watchdog dracut module + +--- + dracut.spec | 1 + + modules.d/04watchdog/module-setup.sh | 23 +++++++++++++++++++++++ + modules.d/04watchdog/watchdog.sh | 6 ++++++ + modules.d/99base/dracut-lib.sh | 2 ++ + 4 files changed, 32 insertions(+) + create mode 100755 modules.d/04watchdog/module-setup.sh + create mode 100755 modules.d/04watchdog/watchdog.sh + +diff --git a/dracut.spec b/dracut.spec +index eb5df2c..6e8c733 100644 +--- a/dracut.spec ++++ b/dracut.spec +@@ -254,6 +254,7 @@ rm -rf $RPM_BUILD_ROOT + %{_mandir}/man5/dracut.conf.5* + %{dracutlibdir}/modules.d/00bootchart + %{dracutlibdir}/modules.d/00dash ++%{dracutlibdir}/modules.d/04watchdog + %{dracutlibdir}/modules.d/05busybox + %{dracutlibdir}/modules.d/10i18n + %{dracutlibdir}/modules.d/30convertfs +diff --git a/modules.d/04watchdog/module-setup.sh b/modules.d/04watchdog/module-setup.sh +new file mode 100755 +index 0000000..eb46143 +--- /dev/null ++++ b/modules.d/04watchdog/module-setup.sh +@@ -0,0 +1,23 @@ ++#!/bin/bash ++# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- ++# ex: ts=8 sw=4 sts=4 et filetype=sh ++ ++check() { ++ return 255 ++} ++ ++depends() { ++ return 0 ++} ++ ++install() { ++ inst_hook cmdline 00 "$moddir/watchdog.sh" ++ inst_hook cmdline 50 "$moddir/watchdog.sh" ++ inst_hook pre-trigger 00 "$moddir/watchdog.sh" ++ inst_hook initqueue 00 "$moddir/watchdog.sh" ++ inst_hook mount 00 "$moddir/watchdog.sh" ++ inst_hook mount 50 "$moddir/watchdog.sh" ++ inst_hook pre-pivot 00 "$moddir/watchdog.sh" ++ inst_hook cleanup 00 "$moddir/watchdog.sh" ++} ++ +diff --git a/modules.d/04watchdog/watchdog.sh b/modules.d/04watchdog/watchdog.sh +new file mode 100755 +index 0000000..712969f +--- /dev/null ++++ b/modules.d/04watchdog/watchdog.sh +@@ -0,0 +1,6 @@ ++#!/bin/sh ++if [ -e /dev/watchdog ]; then ++ >/dev/watchdog ++else ++ modprobe ib700wdt ++fi +diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh +index 3ecba9a..8cfd7b3 100755 +--- a/modules.d/99base/dracut-lib.sh ++++ b/modules.d/99base/dracut-lib.sh +@@ -832,6 +832,8 @@ emergency_shell() + fi + [ -c "$_ctty" ] || _ctty=/dev/tty1 + strstr "$(setsid --help 2>/dev/null)" "ctty" && CTTY="-c" ++ # stop watchdog ++ echo 'V' > /dev/watchdog + setsid $CTTY /bin/sh -i -l 0<$_ctty 1>$_ctty 2>&1 + else + warn "$action has failed. To debug this issue add \"rd.shell\" to the kernel command line." diff --git a/0034-TEST-01-BASIC-add-watchdog.patch b/0034-TEST-01-BASIC-add-watchdog.patch new file mode 100644 index 0000000..833ed58 --- /dev/null +++ b/0034-TEST-01-BASIC-add-watchdog.patch @@ -0,0 +1,61 @@ +From c8f3a1c057ffd4ea288f9e38d9e396eebdafcd0c Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 18 Jun 2012 19:20:16 +0200 +Subject: [PATCH] TEST-01-BASIC: add watchdog + +--- + test/TEST-01-BASIC/test-init.sh | 3 ++- + test/TEST-01-BASIC/test.sh | 11 +++++++---- + 2 files changed, 9 insertions(+), 5 deletions(-) + +diff --git a/test/TEST-01-BASIC/test-init.sh b/test/TEST-01-BASIC/test-init.sh +index f8d6693..5fc02d9 100755 +--- a/test/TEST-01-BASIC/test-init.sh ++++ b/test/TEST-01-BASIC/test-init.sh +@@ -1,10 +1,11 @@ + #!/bin/sh ++>/dev/watchdog + export PATH=/sbin:/bin:/usr/sbin:/usr/bin + strstr() { [ "${1#*$2*}" != "$1" ]; } + CMDLINE=$(while read line; do echo $line;done < /proc/cmdline) + plymouth --quit + exec >/dev/console 2>&1 +-echo "dracut-root-block-success" >/dev/sda1 ++echo "dracut-root-block-success" >/dev/sdb + export TERM=linux + export PS1='initramfs-test:\w\$ ' + [ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab +diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh +index 46e75c7..6c39d7b 100755 +--- a/test/TEST-01-BASIC/test.sh ++++ b/test/TEST-01-BASIC/test.sh +@@ -7,13 +7,16 @@ KVERSION=${KVERSION-$(uname -r)} + #DEBUGFAIL="rd.shell rd.break" + + test_run() { ++ dd if=/dev/zero of=$TESTDIR/result bs=1M count=1 + $testdir/run-qemu \ + -hda $TESTDIR/root.ext3 \ ++ -hdb $TESTDIR/result \ + -m 256M -nographic \ + -net none -kernel /boot/vmlinuz-$KVERSION \ ++ -watchdog ib700 -watchdog-action poweroff \ + -append "root=LABEL=dracut rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \ +- -initrd $TESTDIR/initramfs.testing +- grep -m 1 -q dracut-root-block-success $TESTDIR/root.ext3 || return 1 ++ -initrd $TESTDIR/initramfs.testing || return 1 ++ grep -m 1 -q dracut-root-block-success $TESTDIR/result || return 1 + } + + test_setup() { +@@ -81,8 +84,8 @@ test_setup() { + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \ +- -a "debug" \ +- -d "piix ide-gd_mod ata_piix ext3 sd_mod" \ ++ -a "debug watchdog" \ ++ -d "piix ide-gd_mod ata_piix ext3 sd_mod ib700wdt" \ + -f $TESTDIR/initramfs.testing $KVERSION || return 1 + + # -o "plymouth network md dmraid multipath fips caps crypt btrfs resume dmsquash-live dm" diff --git a/0035-TEST-20-NFS-add-watchdog.patch b/0035-TEST-20-NFS-add-watchdog.patch new file mode 100644 index 0000000..7fcabae --- /dev/null +++ b/0035-TEST-20-NFS-add-watchdog.patch @@ -0,0 +1,62 @@ +From 483b1e3aa83c5bd56b2f2c75144b0a8c276d5bec Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 18 Jun 2012 19:13:09 +0200 +Subject: [PATCH] TEST-20-NFS: add watchdog + +--- + test/TEST-20-NFS/server-init.sh | 2 +- + test/TEST-20-NFS/test.sh | 10 ++++++---- + 2 files changed, 7 insertions(+), 5 deletions(-) + +diff --git a/test/TEST-20-NFS/server-init.sh b/test/TEST-20-NFS/server-init.sh +index 26a2abd..a60a013 100755 +--- a/test/TEST-20-NFS/server-init.sh ++++ b/test/TEST-20-NFS/server-init.sh +@@ -31,6 +31,6 @@ dhcpd -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases + #sh -i + # Wait forever for the VM to die + echo "Serving NFS mounts" +-while sleep 60; do sleep 60; done ++while sleep 30; do >/dev/watchdog; done + mount -n -o remount,ro / + poweroff -f +diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh +index a6bde0e..ea65c2a 100755 +--- a/test/TEST-20-NFS/test.sh ++++ b/test/TEST-20-NFS/test.sh +@@ -18,6 +18,7 @@ run_server() { + -net nic,macaddr=52:54:00:12:34:56,model=e1000 \ + -net socket,listen=127.0.0.1:12320 \ + -serial $SERIAL \ ++ -watchdog ib700 -watchdog-action poweroff \ + -kernel /boot/vmlinuz-$KVERSION \ + -append "root=/dev/sda rw quiet console=ttyS0,115200n81 selinux=0" \ + -initrd $TESTDIR/initramfs.server \ +@@ -53,6 +54,7 @@ client_test() { + -net nic,macaddr=$mac,model=e1000 \ + -net socket,connect=127.0.0.1:12320 \ + -kernel /boot/vmlinuz-$KVERSION \ ++ -watchdog ib700 -watchdog-action poweroff \ + -append "$cmdline $DEBUGFAIL rd.debug rd.retry=10 rd.info quiet ro console=ttyS0,115200n81 selinux=0" \ + -initrd $TESTDIR/initramfs.testing + +@@ -307,15 +309,15 @@ test_setup() { + + # Make server's dracut image + $basedir/dracut.sh -l -i $TESTDIR/overlay / \ +- -m "dash udev-rules base rootfs-block debug kernel-modules" \ +- -d "piix ide-gd_mod ata_piix ext3 sd_mod e1000" \ ++ -m "dash udev-rules base rootfs-block debug kernel-modules watchdog" \ ++ -d "piix ide-gd_mod ata_piix ext3 sd_mod e1000 ib700wdt" \ + -f $TESTDIR/initramfs.server $KVERSION || return 1 + + # Make client's dracut image + $basedir/dracut.sh -l -i $TESTDIR/overlay / \ + -o "plymouth" \ +- -a "debug" \ +- -d "piix ide-gd_mod ata_piix sd_mod e1000 nfs sunrpc" \ ++ -a "debug watchdog" \ ++ -d "piix ide-gd_mod ata_piix sd_mod e1000 nfs sunrpc ib700wdt" \ + -f $TESTDIR/initramfs.testing $KVERSION || return 1 + } + diff --git a/0036-TEST-50-MULTINIC-add-watchdog.patch b/0036-TEST-50-MULTINIC-add-watchdog.patch new file mode 100644 index 0000000..b18a288 --- /dev/null +++ b/0036-TEST-50-MULTINIC-add-watchdog.patch @@ -0,0 +1,84 @@ +From 2dbd71b77a72a88cd4b8ccd50a40de3b7bfd1dd0 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 18 Jun 2012 19:22:35 +0200 +Subject: [PATCH] TEST-50-MULTINIC: add watchdog + +--- + test/TEST-50-MULTINIC/server-init.sh | 2 +- + test/TEST-50-MULTINIC/test.sh | 34 ++++++++++++++++++---------------- + 2 files changed, 19 insertions(+), 17 deletions(-) + +diff --git a/test/TEST-50-MULTINIC/server-init.sh b/test/TEST-50-MULTINIC/server-init.sh +index 39f6a1d..c02d84c 100755 +--- a/test/TEST-50-MULTINIC/server-init.sh ++++ b/test/TEST-50-MULTINIC/server-init.sh +@@ -26,6 +26,6 @@ dhcpd -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases + #sh -i + # Wait forever for the VM to die + echo "Serving NFS mounts" +-while sleep 60; do sleep 60; done ++while sleep 30; do echo >/dev/watchdog; done + mount -n -o remount,ro / + poweroff -f +diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh +index 6efa8ef..1655608 100755 +--- a/test/TEST-50-MULTINIC/test.sh ++++ b/test/TEST-50-MULTINIC/test.sh +@@ -13,12 +13,13 @@ run_server() { + echo "MULTINIC TEST SETUP: Starting DHCP/NFS server" + + $testdir/run-qemu -hda $TESTDIR/server.ext3 -m 512M -nographic \ +- -net nic,macaddr=52:54:00:12:34:56,model=e1000 \ +- -net socket,listen=127.0.0.1:12350 \ +- -serial $SERIAL \ +- -kernel /boot/vmlinuz-$KVERSION \ +- -append "selinux=0 root=/dev/sda rd.debug rd.info rw quiet console=ttyS0,115200n81" \ +- -initrd $TESTDIR/initramfs.server -pidfile $TESTDIR/server.pid -daemonize || return 1 ++ -net nic,macaddr=52:54:00:12:34:56,model=e1000 \ ++ -net socket,listen=127.0.0.1:12350 \ ++ -serial $SERIAL \ ++ -watchdog ib700 -watchdog-action poweroff \ ++ -kernel /boot/vmlinuz-$KVERSION \ ++ -append "selinux=0 root=/dev/sda rd.debug rd.info rw quiet console=ttyS0,115200n81" \ ++ -initrd $TESTDIR/initramfs.server -pidfile $TESTDIR/server.pid -daemonize || return 1 + sudo chmod 644 $TESTDIR/server.pid || return 1 + + # Cleanup the terminal if we have one +@@ -50,9 +51,10 @@ client_test() { + -net nic,macaddr=52:54:00:12:34:$mac3,model=e1000 \ + -net socket,connect=127.0.0.1:12350 \ + -hdc /dev/null \ +- -kernel /boot/vmlinuz-$KVERSION \ +- -append "$cmdline $DEBUGFAIL rd.retry=5 rd.debug rd.info ro quiet console=ttyS0,115200n81 selinux=0 rd.copystate" \ +- -initrd $TESTDIR/initramfs.testing ++ -watchdog ib700 -watchdog-action poweroff \ ++ -kernel /boot/vmlinuz-$KVERSION \ ++ -append "$cmdline $DEBUGFAIL rd.retry=5 rd.debug rd.info ro quiet console=ttyS0,115200n81 selinux=0 rd.copystate rd.chroot init=/sbin/init" \ ++ -initrd $TESTDIR/initramfs.testing + + if [[ $? -ne 0 ]] || ! grep -m 1 -q OK $TESTDIR/client.img; then + echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" +@@ -261,16 +263,16 @@ test_setup() { + + # Make server's dracut image + $basedir/dracut.sh -l -i $TESTDIR/overlay / \ +- -m "dash udev-rules base rootfs-block debug kernel-modules" \ +- -d "piix ide-gd_mod ata_piix ext3 sd_mod e1000" \ +- -f $TESTDIR/initramfs.server $KVERSION || return 1 ++ -m "dash udev-rules base rootfs-block debug kernel-modules watchdog" \ ++ -d "piix ide-gd_mod ata_piix ext3 sd_mod e1000 ib700wdt" \ ++ -f $TESTDIR/initramfs.server $KVERSION || return 1 + + # Make client's dracut image + $basedir/dracut.sh -l -i $TESTDIR/overlay / \ +- -o "plymouth" \ +- -a "debug" \ +- -d "piix sd_mod sr_mod ata_piix ide-gd_mod e1000 nfs sunrpc" \ +- -f $TESTDIR/initramfs.testing $KVERSION || return 1 ++ -o "plymouth" \ ++ -a "debug watchdog" \ ++ -d "piix sd_mod sr_mod ata_piix ide-gd_mod e1000 nfs sunrpc ib700wdt" \ ++ -f $TESTDIR/initramfs.testing $KVERSION || return 1 + } + + kill_server() { diff --git a/0037-TEST-20-NFS-libnss-cleanup.patch b/0037-TEST-20-NFS-libnss-cleanup.patch new file mode 100644 index 0000000..5c3fe29 --- /dev/null +++ b/0037-TEST-20-NFS-libnss-cleanup.patch @@ -0,0 +1,138 @@ +From 9f88b0370dc9433b87686f67c1156f2080b35a1d Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 18 Jun 2012 19:23:25 +0200 +Subject: [PATCH] TEST-20-NFS: libnss cleanup + +--- + test/TEST-20-NFS/test.sh | 75 +++++++++++++++++++++++++++++++++------------- + 1 file changed, 55 insertions(+), 20 deletions(-) + +diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh +index ea65c2a..faa2bb3 100755 +--- a/test/TEST-20-NFS/test.sh ++++ b/test/TEST-20-NFS/test.sh +@@ -211,10 +211,37 @@ test_setup() { + mkdir $TESTDIR/mnt + sudo mount -o loop $TESTDIR/server.ext3 $TESTDIR/mnt + +- kernel=$KVERSION +- ( ++ ++ export kernel=$KVERSION ++ export srcmods="/lib/modules/$kernel/" ++ # Detect lib paths ++ ++ . $basedir/dracut-functions.sh ++ if ! [[ $libdirs ]] ; then ++ if strstr "$(ldd /bin/sh)" "/lib64/" &>/dev/null \ ++ && [[ -d /lib64 ]]; then ++ libdirs+=" /lib64" ++ [[ -d /usr/lib64 ]] && libdirs+=" /usr/lib64" ++ else ++ libdirs+=" /lib" ++ [[ -d /usr/lib ]] && libdirs+=" /usr/lib" ++ fi ++ fi ++ ++ ( + initdir=$TESTDIR/mnt +- . $basedir/dracut-functions.sh ++ ++ for _f in modules.builtin.bin modules.builtin; do ++ [[ $srcmods/$_f ]] && break ++ done || { ++ dfatal "No modules.builtin.bin and modules.builtin found!" ++ return 1 ++ } ++ ++ for _f in modules.builtin.bin modules.builtin modules.order; do ++ [[ $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f" ++ done ++ + dracut_install sh ls shutdown poweroff stty cat ps ln ip \ + dmesg mkdir cp ping exportfs \ + modprobe rpc.nfsd rpc.mountd showmount tcpdump \ +@@ -235,26 +262,28 @@ test_setup() { + inst ./dhcpd.conf /etc/dhcpd.conf + dracut_install /etc/nsswitch.conf /etc/rpc /etc/protocols + dracut_install rpc.idmapd /etc/idmapd.conf +- if ldd $(type -P rpc.idmapd) |grep -q lib64; then +- LIBDIR="/lib64" +- else +- LIBDIR="/lib" +- fi + +- dracut_install $(ls {/usr,}$LIBDIR/libnfsidmap*.so* 2>/dev/null ) +- dracut_install $(ls {/usr,}$LIBDIR/libnss*.so 2>/dev/null) ++ inst_libdir_file 'libnfsidmap_nsswitch.so*' ++ inst_libdir_file 'libnfsidmap/*.so*' ++ inst_libdir_file 'libnfsidmap*.so*' ++ ++ _nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \ ++ | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|') ++ _nsslibs=${_nsslibs#|} ++ _nsslibs=${_nsslibs%|} ++ ++ inst_libdir_file -n "$_nsslibs" 'libnss*.so*' ++ + ( + cd "$initdir"; +- mkdir -p dev sys proc etc var/run tmp var/lib/{dhcpd,rpcbind} ++ mkdir -p dev sys proc run etc var/run tmp var/lib/{dhcpd,rpcbind} + mkdir -p var/lib/nfs/{v4recovery,rpc_pipefs} + chmod 777 var/lib/rpcbind var/lib/nfs + ) + inst /etc/nsswitch.conf /etc/nsswitch.conf ++ + inst /etc/passwd /etc/passwd + inst /etc/group /etc/group +- for i in /lib*/libnss_files**;do +- inst_library $i +- done + + /sbin/depmod -a -b "$initdir" $kernel + cp -a /etc/ld.so.conf* $initdir/etc +@@ -266,7 +295,6 @@ test_setup() { + mkdir -p $initdir + + ( +- . $basedir/dracut-functions.sh + dracut_install sh shutdown poweroff stty cat ps ln ip \ + mount dmesg mkdir cp ping grep + for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do +@@ -276,15 +304,23 @@ test_setup() { + inst ./client-init.sh /sbin/init + ( + cd "$initdir" +- mkdir -p dev sys proc etc ++ mkdir -p dev sys proc etc run + mkdir -p var/lib/nfs/rpc_pipefs + ) + inst /etc/nsswitch.conf /etc/nsswitch.conf + inst /etc/passwd /etc/passwd + inst /etc/group /etc/group +- for i in /lib*/libnss_files*;do +- inst_library $i +- done ++ ++ inst_libdir_file 'libnfsidmap_nsswitch.so*' ++ inst_libdir_file 'libnfsidmap/*.so*' ++ inst_libdir_file 'libnfsidmap*.so*' ++ ++ _nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \ ++ | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|') ++ _nsslibs=${_nsslibs#|} ++ _nsslibs=${_nsslibs%|} ++ ++ inst_libdir_file -n "$_nsslibs" 'libnss*.so*' + + cp -a /etc/ld.so.conf* $initdir/etc + sudo ldconfig -r "$initdir" +@@ -301,7 +337,6 @@ test_setup() { + ( + initdir=$TESTDIR/overlay + mkdir $TESTDIR/overlay +- . $basedir/dracut-functions.sh + dracut_install poweroff shutdown + inst_hook emergency 000 ./hard-off.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules diff --git a/0038-TEST-50-MULTINIC-libnss-cleanup.patch b/0038-TEST-50-MULTINIC-libnss-cleanup.patch new file mode 100644 index 0000000..607d63e --- /dev/null +++ b/0038-TEST-50-MULTINIC-libnss-cleanup.patch @@ -0,0 +1,351 @@ +From d6862983155c31896ac46dc9d43f4086850a0d44 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 18 Jun 2012 19:28:44 +0200 +Subject: [PATCH] TEST-50-MULTINIC: libnss cleanup + +--- + test/TEST-50-MULTINIC/test.sh | 235 +++++++++++++++++++---------------------- + 1 file changed, 110 insertions(+), 125 deletions(-) + +diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh +index 1655608..5c7ca6c 100755 +--- a/test/TEST-50-MULTINIC/test.sh ++++ b/test/TEST-50-MULTINIC/test.sh +@@ -1,4 +1,6 @@ + #!/bin/bash ++# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- ++# ex: ts=8 sw=4 sts=4 et filetype=sh + TEST_DESCRIPTION="root filesystem on NFS with multiple nics" + + KVERSION=${KVERSION-$(uname -r)} +@@ -41,15 +43,15 @@ client_test() { + + # Need this so kvm-qemu will boot (needs non-/dev/zero local disk) + if ! dd if=/dev/zero of=$TESTDIR/client.img bs=1M count=1; then +- echo "Unable to make client sda image" 1>&2 +- return 1 ++ echo "Unable to make client sda image" 1>&2 ++ return 1 + fi + + $testdir/run-qemu -hda $TESTDIR/client.img -m 512M -nographic \ +- -net nic,macaddr=52:54:00:12:34:$mac1,model=e1000 \ +- -net nic,macaddr=52:54:00:12:34:$mac2,model=e1000 \ +- -net nic,macaddr=52:54:00:12:34:$mac3,model=e1000 \ +- -net socket,connect=127.0.0.1:12350 \ ++ -net nic,macaddr=52:54:00:12:34:$mac1,model=e1000 \ ++ -net nic,macaddr=52:54:00:12:34:$mac2,model=e1000 \ ++ -net nic,macaddr=52:54:00:12:34:$mac3,model=e1000 \ ++ -net socket,connect=127.0.0.1:12350 \ + -hdc /dev/null \ + -watchdog ib700 -watchdog-action poweroff \ + -kernel /boot/vmlinuz-$KVERSION \ +@@ -57,17 +59,17 @@ client_test() { + -initrd $TESTDIR/initramfs.testing + + if [[ $? -ne 0 ]] || ! grep -m 1 -q OK $TESTDIR/client.img; then +- echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" +- return 1 ++ echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" ++ return 1 + fi + + + for i in $check ; do +- echo $i +- if ! grep -m 1 -q $i $TESTDIR/client.img; then +- echo "CLIENT TEST END: $test_name [FAILED - BAD IF]" +- return 1 +- fi ++ echo $i ++ if ! grep -m 1 -q $i $TESTDIR/client.img; then ++ echo "CLIENT TEST END: $test_name [FAILED - BAD IF]" ++ return 1 ++ fi + done + + echo "CLIENT TEST END: $test_name [OK]" +@@ -77,8 +79,8 @@ client_test() { + + test_run() { + if ! run_server; then +- echo "Failed to start server" 1>&2 +- return 1 ++ echo "Failed to start server" 1>&2 ++ return 1 + fi + test_client || { kill_server; return 1; } + } +@@ -90,33 +92,33 @@ test_client() { + + # PXE Style BOOTIF= + client_test "MULTINIC root=nfs BOOTIF=" \ +- 00 01 02 \ +- "root=nfs:192.168.50.1:/nfs/client BOOTIF=52-54-00-12-34-00" \ +- "eth0" || return 1 ++ 00 01 02 \ ++ "root=nfs:192.168.50.1:/nfs/client BOOTIF=52-54-00-12-34-00" \ ++ "eth0" || return 1 + + # PXE Style BOOTIF= with dhcp root-path + client_test "MULTINIC root=dhcp BOOTIF=" \ +- 00 01 02 \ +- "root=dhcp BOOTIF=52-54-00-12-34-02" \ +- "eth2" || return 1 ++ 00 01 02 \ ++ "root=dhcp BOOTIF=52-54-00-12-34-02" \ ++ "eth2" || return 1 + + # Multinic case, where only one nic works + client_test "MULTINIC root=nfs ip=dhcp" \ +- FF 00 FE \ +- "root=nfs:192.168.50.1:/nfs/client ip=dhcp" \ +- "eth1" || return 1 ++ FF 00 FE \ ++ "root=nfs:192.168.50.1:/nfs/client ip=dhcp" \ ++ "eth1" || return 1 + + # Require two interfaces + client_test "MULTINIC root=nfs ip=eth1:dhcp ip=eth2:dhcp bootdev=eth1" \ +- 00 01 02 \ +- "root=nfs:192.168.50.1:/nfs/client ip=eth1:dhcp ip=eth2:dhcp bootdev=eth1" \ +- "eth1 eth2" || return 1 ++ 00 01 02 \ ++ "root=nfs:192.168.50.1:/nfs/client ip=eth1:dhcp ip=eth2:dhcp bootdev=eth1" \ ++ "eth1 eth2" || return 1 + + # Require three interfaces with dhcp root-path + client_test "MULTINIC root=dhcp ip=eth0:dhcp ip=eth1:dhcp ip=eth2:dhcp bootdev=eth2" \ +- 00 01 02 \ +- "root=dhcp ip=eth0:dhcp ip=eth1:dhcp ip=eth2:dhcp bootdev=eth2" \ +- "eth0 eth1 eth2" || return 1 ++ 00 01 02 \ ++ "root=dhcp ip=eth0:dhcp ip=eth1:dhcp ip=eth2:dhcp bootdev=eth2" \ ++ "eth0 eth1 eth2" || return 1 + + kill_server + return 0 +@@ -129,86 +131,70 @@ test_setup() { + mkdir $TESTDIR/mnt + sudo mount -o loop $TESTDIR/server.ext3 $TESTDIR/mnt + +- export kernel=$KVERSION +- export srcmods="/lib/modules/$kernel/" +- # Detect lib paths +- + . $basedir/dracut-functions.sh +- if ! [[ $libdirs ]] ; then +- if strstr "$(ldd /bin/sh)" "/lib64/" &>/dev/null \ +- && [[ -d /lib64 ]]; then +- libdirs+=" /lib64" +- [[ -d /usr/lib64 ]] && libdirs+=" /usr/lib64" +- else +- libdirs+=" /lib" +- [[ -d /usr/lib ]] && libdirs+=" /usr/lib" +- fi +- fi + + ( +- initdir=$TESTDIR/mnt +- +- for _f in modules.builtin.bin modules.builtin; do +- [[ $srcmods/$_f ]] && break +- done || { +- dfatal "No modules.builtin.bin and modules.builtin found!" +- return 1 +- } ++ initdir=$TESTDIR/mnt ++ ++ ( ++ cd "$initdir"; ++ mkdir -p dev sys proc run etc var/run tmp var/lib/{dhcpd,rpcbind} ++ mkdir -p var/lib/nfs/{v4recovery,rpc_pipefs} ++ chmod 777 var/lib/rpcbind var/lib/nfs ++ ) ++ ++ for _f in modules.builtin.bin modules.builtin; do ++ [[ $srcmods/$_f ]] && break ++ done || { ++ dfatal "No modules.builtin.bin and modules.builtin found!" ++ return 1 ++ } + + for _f in modules.builtin.bin modules.builtin modules.order; do +- [[ $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f" +- done ++ [[ $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f" ++ done + +- dracut_install sh ls shutdown poweroff stty cat ps ln ip \ +- dmesg mkdir cp ping exportfs \ +- modprobe rpc.nfsd rpc.mountd showmount tcpdump \ +- /etc/services sleep mount chmod ++ dracut_install sh ls shutdown poweroff stty cat ps ln ip \ ++ dmesg mkdir cp ping exportfs \ ++ modprobe rpc.nfsd rpc.mountd showmount tcpdump \ ++ /etc/services sleep mount chmod + for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do +- [ -f ${_terminfodir}/l/linux ] && break +- done +- dracut_install -o ${_terminfodir}/l/linux +- type -P portmap >/dev/null && dracut_install portmap +- type -P rpcbind >/dev/null && dracut_install rpcbind +- [ -f /etc/netconfig ] && dracut_install /etc/netconfig +- type -P dhcpd >/dev/null && dracut_install dhcpd +- [ -x /usr/sbin/dhcpd3 ] && inst /usr/sbin/dhcpd3 /usr/sbin/dhcpd +- instmods nfsd sunrpc ipv6 lockd +- inst ./server-init.sh /sbin/init +- inst ./hosts /etc/hosts +- inst ./exports /etc/exports +- inst ./dhcpd.conf /etc/dhcpd.conf +- dracut_install /etc/nsswitch.conf /etc/rpc /etc/protocols +- dracut_install rpc.idmapd /etc/idmapd.conf +- +- inst_libdir_file 'libnfsidmap_nsswitch.so*' +- inst_libdir_file 'libnfsidmap/*.so*' +- inst_libdir_file 'libnfsidmap*.so*' ++ [ -f ${_terminfodir}/l/linux ] && break ++ done ++ dracut_install -o ${_terminfodir}/l/linux ++ type -P portmap >/dev/null && dracut_install portmap ++ type -P rpcbind >/dev/null && dracut_install rpcbind ++ [ -f /etc/netconfig ] && dracut_install /etc/netconfig ++ type -P dhcpd >/dev/null && dracut_install dhcpd ++ [ -x /usr/sbin/dhcpd3 ] && inst /usr/sbin/dhcpd3 /usr/sbin/dhcpd ++ instmods nfsd sunrpc ipv6 lockd ++ inst ./server-init.sh /sbin/init ++ inst ./hosts /etc/hosts ++ inst ./exports /etc/exports ++ inst ./dhcpd.conf /etc/dhcpd.conf ++ dracut_install /etc/nsswitch.conf /etc/rpc /etc/protocols ++ ++ dracut_install rpc.idmapd /etc/idmapd.conf ++ ++ inst_libdir_file 'libnfsidmap_nsswitch.so*' ++ inst_libdir_file 'libnfsidmap/*.so*' ++ inst_libdir_file 'libnfsidmap*.so*' + + _nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \ +- | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|') ++ | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|') + _nsslibs=${_nsslibs#|} + _nsslibs=${_nsslibs%|} + +- inst_libdir_file -n "$_nsslibs" 'libnss*.so*' ++ inst_libdir_file -n "$_nsslibs" 'libnss*.so*' + +- ( +- cd "$initdir"; +- mkdir -p dev sys proc etc var/run tmp var/lib/{dhcpd,rpcbind} +- mkdir -p var/lib/nfs/{v4recovery,rpc_pipefs} +- chmod 777 var/lib/rpcbind var/lib/nfs +- ) ++ inst /etc/nsswitch.conf /etc/nsswitch.conf ++ inst /etc/passwd /etc/passwd ++ inst /etc/group /etc/group + +- inst /etc/nsswitch.conf /etc/nsswitch.conf +- inst /etc/passwd /etc/passwd +- inst /etc/group /etc/group +- for i in /lib*/libnss_files**;do +- inst_library $i +- done ++ /sbin/depmod -a -b "$initdir" $kernel + +- /sbin/depmod -a -b "$initdir" $kernel +- +- cp -a /etc/ld.so.conf* $initdir/etc +- sudo ldconfig -r "$initdir" ++ cp -a /etc/ld.so.conf* $initdir/etc ++ sudo ldconfig -r "$initdir" + ) + + # Make client root inside server root +@@ -216,49 +202,48 @@ test_setup() { + mkdir -p $initdir + + ( +- dracut_install sh shutdown poweroff stty cat ps ln ip \ ++ dracut_install sh shutdown poweroff stty cat ps ln ip \ + mount dmesg mkdir cp ping grep ls + for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do +- [ -f ${_terminfodir}/l/linux ] && break +- done +- dracut_install -o ${_terminfodir}/l/linux +- inst ./client-init.sh /sbin/init +- ( +- cd "$initdir" +- mkdir -p dev sys proc etc run +- mkdir -p var/lib/nfs/rpc_pipefs +- ) +- inst /etc/nsswitch.conf /etc/nsswitch.conf +- inst /etc/passwd /etc/passwd +- inst /etc/group /etc/group +- +- inst_libdir_file 'libnfsidmap_nsswitch.so*' +- inst_libdir_file 'libnfsidmap/*.so*' +- inst_libdir_file 'libnfsidmap*.so*' ++ [ -f ${_terminfodir}/l/linux ] && break ++ done ++ dracut_install -o ${_terminfodir}/l/linux ++ inst ./client-init.sh /sbin/init ++ ( ++ cd "$initdir" ++ mkdir -p dev sys proc etc run ++ mkdir -p var/lib/nfs/rpc_pipefs ++ ) ++ inst /etc/nsswitch.conf /etc/nsswitch.conf ++ inst /etc/passwd /etc/passwd ++ inst /etc/group /etc/group ++ ++ dracut_install rpc.idmapd /etc/idmapd.conf ++ inst_libdir_file 'libnfsidmap_nsswitch.so*' ++ inst_libdir_file 'libnfsidmap/*.so*' ++ inst_libdir_file 'libnfsidmap*.so*' + + _nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \ +- | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|') ++ | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|') + _nsslibs=${_nsslibs#|} + _nsslibs=${_nsslibs%|} + +- inst_libdir_file -n "$_nsslibs" 'libnss*.so*' ++ inst_libdir_file -n "$_nsslibs" 'libnss*.so*' + +- cp -a /etc/ld.so.conf* $initdir/etc +- sudo ldconfig -r "$initdir" ++ cp -a /etc/ld.so.conf* $initdir/etc ++ sudo ldconfig -r "$initdir" + ) + +- chroot $initdir +- + sudo umount $TESTDIR/mnt + rm -fr $TESTDIR/mnt + + # Make an overlay with needed tools for the test harness + ( +- initdir=$TESTDIR/overlay +- mkdir $TESTDIR/overlay +- dracut_install poweroff shutdown +- inst_hook emergency 000 ./hard-off.sh +- inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ++ initdir=$TESTDIR/overlay ++ mkdir $TESTDIR/overlay ++ dracut_install poweroff shutdown ++ inst_hook emergency 000 ./hard-off.sh ++ inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + ) + + # Make server's dracut image +@@ -277,8 +262,8 @@ test_setup() { + + kill_server() { + if [[ -s $TESTDIR/server.pid ]]; then +- sudo kill -TERM $(cat $TESTDIR/server.pid) +- rm -f $TESTDIR/server.pid ++ sudo kill -TERM $(cat $TESTDIR/server.pid) ++ rm -f $TESTDIR/server.pid + fi + } + diff --git a/0039-disable-TEST-16-DMSQUASH-for-now.patch b/0039-disable-TEST-16-DMSQUASH-for-now.patch new file mode 100644 index 0000000..ebefab6 --- /dev/null +++ b/0039-disable-TEST-16-DMSQUASH-for-now.patch @@ -0,0 +1,22 @@ +From f48f9341a5a5b7f4e14d4419ce7f969e665d9c42 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 18 Jun 2012 19:20:39 +0200 +Subject: [PATCH] disable TEST-16-DMSQUASH for now + +--- + test/TEST-16-DMSQUASH/test.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh +index 9a10058..3816c18 100755 +--- a/test/TEST-16-DMSQUASH/test.sh ++++ b/test/TEST-16-DMSQUASH/test.sh +@@ -11,7 +11,7 @@ test_check() { + echo "python-imgcreate not installed" + return 1 + fi +- return 0 ++ return 1 + } + + test_run() { diff --git a/dracut.spec b/dracut.spec index e1d9bca..b497276 100644 --- a/dracut.spec +++ b/dracut.spec @@ -10,7 +10,7 @@ Name: dracut Version: 019 -Release: 16.git20120611%{?dist} +Release: 40.git20120618%{?dist} Summary: Initramfs generator using udev %if 0%{?fedora} || 0%{?rhel} @@ -39,6 +39,30 @@ Patch12: 0012-dracut.sh-mkdir-of-libdirs-at-then-end.patch Patch13: 0013-dm-check-for-presence-of-dmsetup.patch Patch14: 0014-mdraid-md-shutdown.sh-check-for-presence-of-mdadm.patch Patch15: 0015-network-ifup.sh-default-to-dhcp-for-BOOTIF.patch +Patch16: 0016-dracut.sh-mkdir-initdir-lib-dracut.patch +Patch17: 0017-fix-ifup-for-static-ipv6.patch +Patch18: 0018-ifcfg-fix-output-for-ipv6-static-addressing.patch +Patch19: 0019-add-PARTUUID-as-root-PARTUUID-partition-uuid-paramet.patch +Patch20: 0020-Debian-multiarch-support.patch +Patch21: 0021-dracut-functions.sh-fixup-inst_libdir_file-again.patch +Patch22: 0022-dracut.sh-output-unknown-argument.patch +Patch23: 0023-dracut.sh-unset-some-variables.patch +Patch24: 0024-nfs-extend-libnss-wildcard.patch +Patch25: 0025-TEST-50-MULTINIC-install-correct-nss-libs.patch +Patch26: 0026-Revert-network-ifup.sh-default-to-dhcp-for-BOOTIF.patch +Patch27: 0027-Revert-network-ifup.sh-do-not-default-to-dhcp-for-in.patch +Patch28: 0028-resolve-conflict-between-cms-network-rules-and-defau.patch +Patch29: 0029-fixed-instmods-return-code-and-set-pipefail-globally.patch +Patch30: 0030-Set-some-global-variables-in-dracut-functions.sh.patch +Patch31: 0031-iscsi-module-setup.sh-only-install-s390-driver-on-s3.patch +Patch32: 0032-plymouth-fixed-inst_libdir_file-call.patch +Patch33: 0033-add-04watchdog-dracut-module.patch +Patch34: 0034-TEST-01-BASIC-add-watchdog.patch +Patch35: 0035-TEST-20-NFS-add-watchdog.patch +Patch36: 0036-TEST-50-MULTINIC-add-watchdog.patch +Patch37: 0037-TEST-20-NFS-libnss-cleanup.patch +Patch38: 0038-TEST-50-MULTINIC-libnss-cleanup.patch +Patch39: 0039-disable-TEST-16-DMSQUASH-for-now.patch BuildArch: noarch @@ -270,6 +294,7 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man5/dracut.conf.5* %{dracutlibdir}/modules.d/00bootchart %{dracutlibdir}/modules.d/00dash +%{dracutlibdir}/modules.d/04watchdog %{dracutlibdir}/modules.d/05busybox %{dracutlibdir}/modules.d/10i18n %{dracutlibdir}/modules.d/30convertfs @@ -358,6 +383,9 @@ rm -rf $RPM_BUILD_ROOT %dir /var/lib/dracut/overlay %changelog +* Mon Jun 18 2012 Harald Hoyer 019-40.git20120618 +- new upstream version + * Mon Jun 11 2012 Harald Hoyer 019-16.git20120611 - new upstream version