From 45edee9f6954fd0b3905a7c36f2f127466cb44ae0e607e9fd080d54646b2a55e Mon Sep 17 00:00:00 2001 From: Robert Milasan Date: Sat, 5 Jul 2014 21:13:32 +0000 Subject: [PATCH] Accepting request 239538 from home:hreinecke:branches:Base:System - 90btrfs: Install rescue utilities to initrd * Add: 0100-btrfs-add-initrd-rescue-utilities.patch - 40network: create /var/lib/wicked in ifup.sh (bnc#885141) * Add: 0089-40network-create-var-lib-wicked-in-ifup.sh.patch - dracut: caps: Remove whole caps module * Add: 0090-dracut-caps-Remove-whole-caps-module.patch - dracut: biosdevname: Only install if present * Add: 0091-dracut-biosdevname-In-SUSE-biosdevname-package-is-in.patch - dracut: nbd: Only complain of missing binary in hostonly mode if rootfs is on nbd * Add: 0092-dracut-nbd-Only-complain-of-missing-binary-in-hoston.patch - 95iscsi: generate commandline for software iscsi (bnc#880108) * Add: 0093-95iscsi-generate-commandline-for-software-iscsi.patch - Implement shortcut 'ip=:static' for static configuration * Add: 0094-Implement-shortcut-ip-ifname-static-for-static-confi.patch - 95iscsi: use static configuration for software iscsi (bnc#884768) * Add: 0095-95iscsi-use-static-configuration-for-software-iscsi.patch - dracut: Fix error: local: can only be used in a function * Add: 0096-dracut-Fix-error-local-can-only-be-used-in-a-functio.patch - Implement 'rd.timeout' to modify the device timeout (bnc#878770) * Add: 0097-Implement-rd.timeout-to-modify-the-device-timeout.patch - Do not call 'lvm' for non-LVM device-mapper devices * Add: 0098-Do-not-call-lvm-for-non-LVM-device-mapper-devices.patch - 90multipath: Load device_handler modules early during boot (bnc#871617) * Add: 0099-90multipath-Load-device_handler-modules-early-during.patch OBS-URL: https://build.opensuse.org/request/show/239538 OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=168 --- ...ork-create-var-lib-wicked-in-ifup.sh.patch | 31 ++++ ...dracut-caps-Remove-whole-caps-module.patch | 135 ++++++++++++++++++ ...me-In-SUSE-biosdevname-package-is-in.patch | 31 ++++ ...complain-of-missing-binary-in-hoston.patch | 40 ++++++ ...erate-commandline-for-software-iscsi.patch | 123 ++++++++++++++++ ...ut-ip-ifname-static-for-static-confi.patch | 86 +++++++++++ ...tic-configuration-for-software-iscsi.patch | 37 +++++ ...-local-can-only-be-used-in-a-functio.patch | 45 ++++++ ...timeout-to-modify-the-device-timeout.patch | 106 ++++++++++++++ ...vm-for-non-LVM-device-mapper-devices.patch | 37 +++++ ...-device_handler-modules-early-during.patch | 50 +++++++ 0100-Add-btrfs-rescue-utilities.patch | 28 ++++ dracut.changes | 33 +++++ dracut.spec | 24 ++++ 14 files changed, 806 insertions(+) create mode 100644 0089-40network-create-var-lib-wicked-in-ifup.sh.patch create mode 100644 0090-dracut-caps-Remove-whole-caps-module.patch create mode 100644 0091-dracut-biosdevname-In-SUSE-biosdevname-package-is-in.patch create mode 100644 0092-dracut-nbd-Only-complain-of-missing-binary-in-hoston.patch create mode 100644 0093-95iscsi-generate-commandline-for-software-iscsi.patch create mode 100644 0094-Implement-shortcut-ip-ifname-static-for-static-confi.patch create mode 100644 0095-95iscsi-use-static-configuration-for-software-iscsi.patch create mode 100644 0096-dracut-Fix-error-local-can-only-be-used-in-a-functio.patch create mode 100644 0097-Implement-rd.timeout-to-modify-the-device-timeout.patch create mode 100644 0098-Do-not-call-lvm-for-non-LVM-device-mapper-devices.patch create mode 100644 0099-90multipath-Load-device_handler-modules-early-during.patch create mode 100644 0100-Add-btrfs-rescue-utilities.patch diff --git a/0089-40network-create-var-lib-wicked-in-ifup.sh.patch b/0089-40network-create-var-lib-wicked-in-ifup.sh.patch new file mode 100644 index 0000000..58345ba --- /dev/null +++ b/0089-40network-create-var-lib-wicked-in-ifup.sh.patch @@ -0,0 +1,31 @@ +From af384e51a1dff36b5554b05d2b940d0089c84000 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Tue, 1 Jul 2014 08:15:00 +0200 +Subject: 40network: create /var/lib/wicked in ifup.sh + +wicked requires the /var/lib/wicked directory to be present. +This is just a work-around; it should be fixed in wicked itself. + +References: bnc#885141 + +Signed-off-by: Hannes Reinecke +--- + modules.d/40network/ifup.sh | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh +index 494017b..6f279a4 100755 +--- a/modules.d/40network/ifup.sh ++++ b/modules.d/40network/ifup.sh +@@ -20,6 +20,8 @@ netif=$1 + use_bridge='false' + use_vlan='false' + ++[ -d /var/lib/wicked ] || mkdir -p /var/lib/wicked ++ + # enslave this interface to bond? + for i in /tmp/bond.*.info; do + [ -e "$i" ] || continue +-- +1.8.4.5 + diff --git a/0090-dracut-caps-Remove-whole-caps-module.patch b/0090-dracut-caps-Remove-whole-caps-module.patch new file mode 100644 index 0000000..268ea7a --- /dev/null +++ b/0090-dracut-caps-Remove-whole-caps-module.patch @@ -0,0 +1,135 @@ +From dccbc0fc7f1b814ad8a03f380a31bed2c9d86a9b Mon Sep 17 00:00:00 2001 +From: Thomas Renninger +Date: Tue, 1 Jul 2014 13:53:43 +0200 +Subject: dracut: caps: Remove whole caps module + +To get installed it must not have systemd included in initramfs which is +an unsupported scenario for SUSE. +This gets also rid of the error in its check function. + +Signed-off-by: Thomas Renninger +--- + modules.d/02caps/README | 33 --------------------------------- + modules.d/02caps/caps.sh | 36 ------------------------------------ + modules.d/02caps/module-setup.sh | 26 -------------------------- + 3 files changed, 95 deletions(-) + delete mode 100644 modules.d/02caps/README + delete mode 100755 modules.d/02caps/caps.sh + delete mode 100755 modules.d/02caps/module-setup.sh + +diff --git a/modules.d/02caps/README b/modules.d/02caps/README +deleted file mode 100644 +index 34e0f02..0000000 +--- a/modules.d/02caps/README ++++ /dev/null +@@ -1,33 +0,0 @@ +-This adds the following parameters: +-rd.caps=1 +- turn the caps module on/off +-rd.caps.initdrop=cap_sys_module,cap_sys_rawio +- drop the specified comma separated capabilities +-rd.caps.disablemodules=1 +- turn off module loading +-rd.caps.disablekexec=1 +- turn off the kexec functionality +- +-If module loading is turned off, all modules have to be loaded in the +-initramfs, which are used later on. This can be done with +-"rd.driver.pre=" +-rd.driver.pre=autofs4,sunrpc,ipt_REJECT,nf_conntrack_ipv4,.... +- +-Because the kernel command line would get huge with all those drivers, I +-recommend to make use of $initramfs/etc/cmdline. +- +-So, all rd.caps.* and rd.driver.pre arguments are in caps.conf can be +-copied to $initramfs/etc/cmdline with "-i caps.conf /etc/cmdline". +- +-Also all modules have to be loaded in the initramfs via "--add-drivers". +- +-The resulting initramfs creation would look like this: +- +- --add-drivers "autofs4 sunrpc ipt_REJECT nf_conntrack_ipv4 \ +- nf_defrag_ipv4 iptable_filter ip_tables +- ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack +- ip6table_filter ip6_tables dm_mirror dm_region_hash dm_log uinput ppdev +- parport_pc parport ipv6 sg 8139too 8139cp mii i2c_piix4 i2c_core ext3 +- jbd mbcache sd_mod crc_t10dif sr_mod cdrom ata_generic pata_acpi ata_piix +- dm_mod" \ +- /boot/initramfs-caps.img +diff --git a/modules.d/02caps/caps.sh b/modules.d/02caps/caps.sh +deleted file mode 100755 +index 6a8fe5d..0000000 +--- a/modules.d/02caps/caps.sh ++++ /dev/null +@@ -1,36 +0,0 @@ +-#!/bin/bash +-# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +-# ex: ts=8 sw=4 sts=4 et filetype=sh +- +-capsmode=$(getarg rd.caps) +- +-if [ "$capsmode" = "1" ]; then +- CAPS_INIT_DROP=$(getarg rd.caps.initdrop=) +- CAPS_USERMODEHELPER_BSET=$(capsh --drop="$CAPS_INIT_DROP" -- -c 'while read a b ; do [ "$a" = "CapBnd:" ] && echo $((0x${b:$((${#b}-8)):8})) $((0x${b:$((${#b}-16)):8})) && break; done < /proc/self/status') +- CAPS_MODULES_DISABLED=$(getarg rd.caps.disablemodules=) +- CAPS_KEXEC_DISABLED=$(getarg rd.caps.disablekexec=) +- +- info "Loading CAPS_MODULES $CAPS_MODULES" +- for i in $CAPS_MODULES;do modprobe $i 2>&1 >/dev/null | vinfo; done +- +- if [ "$CAPS_MODULES_DISABLED" = "1" -a -e /proc/sys/kernel/modules_disabled ]; then +- info "Disabling module loading." +- echo $CAPS_MODULES_DISABLED > /proc/sys/kernel/modules_disabled +- fi +- +- if [ "$CAPS_KEXEC_DISABLED" = "1" -a -e /proc/sys/kernel/kexec_disabled ]; then +- info "Disabling kexec." +- echo $CAPS_KEXEC_DISABLED > /proc/sys/kernel/kexec_disabled +- fi +- +- info "CAPS_USERMODEHELPER_BSET=$CAPS_USERMODEHELPER_BSET" +- if [ -e /proc/sys/kernel/usermodehelper/bset ]; then +- info "Setting usermode helper bounding set." +- echo $CAPS_USERMODEHELPER_BSET > /proc/sys/kernel/usermodehelper/bset +- echo $CAPS_USERMODEHELPER_BSET > /proc/sys/kernel/usermodehelper/inheritable +- fi +- +- echo "CAPS_INIT_DROP=\"$CAPS_INIT_DROP\"" > /etc/capsdrop +- info "Will drop capabilities $CAPS_INIT_DROP from init." +-fi +- +diff --git a/modules.d/02caps/module-setup.sh b/modules.d/02caps/module-setup.sh +deleted file mode 100755 +index 46e35a0..0000000 +--- a/modules.d/02caps/module-setup.sh ++++ /dev/null +@@ -1,26 +0,0 @@ +-#!/bin/bash +-# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +-# ex: ts=8 sw=4 sts=4 et filetype=sh +- +-# called by dracut +-check() { +- require_binaries capsh +-} +- +-# called by dracut +-depends() { +- return 0 +-} +- +-# called by dracut +-install() { +- if ! dracut_module_included "systemd"; then +- inst_hook pre-pivot 00 "$moddir/caps.sh" +- inst $(type -P capsh 2>/dev/null) /usr/sbin/capsh +- # capsh wants bash and we need bash also +- inst /bin/bash +- else +- dwarning "caps: does not work with systemd in the initramfs" +- fi +-} +- +-- +1.8.4.5 + diff --git a/0091-dracut-biosdevname-In-SUSE-biosdevname-package-is-in.patch b/0091-dracut-biosdevname-In-SUSE-biosdevname-package-is-in.patch new file mode 100644 index 0000000..ac52377 --- /dev/null +++ b/0091-dracut-biosdevname-In-SUSE-biosdevname-package-is-in.patch @@ -0,0 +1,31 @@ +From edfae68d9a9af81cd1ff230b72b9c320d4c58e82 Mon Sep 17 00:00:00 2001 +From: Thomas Renninger +Date: Tue, 1 Jul 2014 13:53:57 +0200 +Subject: dracut: biosdevname: In SUSE biosdevname package is installed on + relevant platforms + +all others should not add biosdevname on purpose. Do not complain about it. + + +Signed-off-by: Thomas Renninger +--- + modules.d/97biosdevname/module-setup.sh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/modules.d/97biosdevname/module-setup.sh b/modules.d/97biosdevname/module-setup.sh +index e285a7f..41ee39f 100755 +--- a/modules.d/97biosdevname/module-setup.sh ++++ b/modules.d/97biosdevname/module-setup.sh +@@ -5,7 +5,8 @@ + # called by dracut + check() { + [[ "$mount_needs" ]] && return 1 +- require_binaries biosdevname || return 1 ++ # Include biosdevname if the binary is installed ++ type -P biosdevname >/dev/null || return 1 + return 0 + } + +-- +1.8.4.5 + diff --git a/0092-dracut-nbd-Only-complain-of-missing-binary-in-hoston.patch b/0092-dracut-nbd-Only-complain-of-missing-binary-in-hoston.patch new file mode 100644 index 0000000..878749f --- /dev/null +++ b/0092-dracut-nbd-Only-complain-of-missing-binary-in-hoston.patch @@ -0,0 +1,40 @@ +From e4e24c1e841f91987561c1970148872214bbaaf8 Mon Sep 17 00:00:00 2001 +From: Thomas Renninger +Date: Tue, 1 Jul 2014 13:54:04 +0200 +Subject: dracut: nbd: Only complain of missing binary in hostonly mode if + rootfs is on nbd + +In not hostonly mode, require_binaries will still complain. +If in hostonly mode and the module is explicitly added via -a nbd, then +install() section will still complain later: +dracut-install: ERROR: installing 'nbd-client' + +Signed-off-by: Thomas Renninger +--- + modules.d/95nbd/module-setup.sh | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/modules.d/95nbd/module-setup.sh b/modules.d/95nbd/module-setup.sh +index e62f290..dc5102e 100755 +--- a/modules.d/95nbd/module-setup.sh ++++ b/modules.d/95nbd/module-setup.sh +@@ -5,8 +5,6 @@ + # called by dracut + check() { + local _rootdev +- # If our prerequisites are not met, fail. +- require_binaries nbd-client || return 1 + + # if an nbd device is not somewhere in the chain of devices root is + # mounted on, fail the hostonly check. +@@ -17,6 +15,7 @@ check() { + [[ -b /dev/block/$_rootdev ]] || return 1 + check_block_and_slaves is_nbd "$_rootdev" || return 255 + } ++ require_binaries nbd-client || return 1 + + return 0 + } +-- +1.8.4.5 + diff --git a/0093-95iscsi-generate-commandline-for-software-iscsi.patch b/0093-95iscsi-generate-commandline-for-software-iscsi.patch new file mode 100644 index 0000000..c421606 --- /dev/null +++ b/0093-95iscsi-generate-commandline-for-software-iscsi.patch @@ -0,0 +1,123 @@ +From a7bac2f8271ff195fa0a5c021f40b7eeb48b3681 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Wed, 2 Jul 2014 10:36:50 +0200 +Subject: 95iscsi: generate commandline for software iscsi + +When installing on an software iscsi root we need to generate +the correct commandline, otherwise the system cannot boot. + +References: bnc#880108 + +Signed-off-by: Hannes Reinecke +--- + modules.d/95iscsi/module-setup.sh | 80 +++++++++++++++++++++++++++++++++++++-- + 1 file changed, 77 insertions(+), 3 deletions(-) + +diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh +index cfa6f39..e9bed24 100755 +--- a/modules.d/95iscsi/module-setup.sh ++++ b/modules.d/95iscsi/module-setup.sh +@@ -43,6 +43,75 @@ install_ibft() { + done + } + ++install_iscsiroot() { ++ local devpath=$1 ++ local scsi_path iscsi_lun session c d conn ++ local iscsi_session iscsi_address iscsi_port iscsi_targetname iscsi_tpgt ++ ++ scsi_path=${devpath%%/block*} ++ [ "$scsi_path" = "$devpath" ] && return 1 ++ iscsi_lun=${scsi_path##*:} ++ [ "$iscsi_lun" = "$scsi_path" ] && return 1 ++ session=${devpath%%/target*} ++ [ "$session" = "$devpath" ] && return 1 ++ iscsi_session=${session##*/} ++ [ "$iscsi_session" = "$session" ] && return 1 ++ ++ for d in ${session}/* ; do ++ case $d in ++ *connection*) ++ c=${d##*/} ++ conn=${d}/iscsi_connection/${c} ++ if [ -d ${conn} ] ; then ++ iscsi_address=$(cat ${conn}/persistent_address) ++ iscsi_port=$(cat ${conn}/persistent_port) ++ fi ++ ;; ++ *session) ++ if [ -d ${d}/${iscsi_session} ] ; then ++ iscsi_initiator=$(cat ${d}/${iscsi_session}/initiatorname) ++ iscsi_targetname=$(cat ${d}/${iscsi_session}/targetname) ++ fi ++ ;; ++ esac ++ done ++ ++ local_address=$(ip -o route get to $iscsi_address | cut -f 1 -d ' ') ++ ifname=$(ip addr show to $local_address | head -1 | sed -n 's/[0-9]*: \(.*\): .*/\1/p') ++ if [ -d /sys/class/net/$ifname/address ] ; then ++ ifmac=$(cat /sys/class/net/$ifname/address) ++ printf 'ifname=%s:%s ' ${ifname} ${ifmac} ++ fi ++ ++ if [ -n "$iscsi_address" -a -n "$iscsi_targetname" ] ; then ++ if [ -n "$iscsi_port" -a "$iscsi_port" -eq 3260 ] ; then ++ iscsi_port= ++ fi ++ if [ -n "$iscsi_lun" -a "$iscsi_lun" -eq 0 ] ; then ++ iscsi_lun= ++ fi ++ echo "rd.iscsi.initiator=${iscsi_initiator} netroot=iscsi:${iscsi_address}::${iscsi_port}:${iscsi_lun}:${iscsi_targetname}" ++ fi ++ return 0 ++} ++ ++ ++install_softiscsi() { ++ [ -d /sys/firmware/ibft ] && return 0 ++ ++ is_softiscsi() { ++ local _dev=$1 ++ local iscsi_dev ++ ++ [[ -L "/sys/dev/block/$_dev" ]] || return ++ iscsi_dev=$(cd -P /sys/dev/block/$_dev; echo $PWD) ++ install_iscsiroot $iscsi_dev ++ } ++ ++ for_each_host_dev_and_slaves is_softiscsi || return 255 ++ return 0 ++} ++ + # called by dracut + check() { + local _rootdev +@@ -121,7 +190,12 @@ installkernel() { + + # called by dracut + cmdline() { +- install_ibft ++ local _iscsiconf=$(install_ibft) ++ if [ "$_iscsiconf" ] ; then ++ echo ${_iscsiconf} ++ else ++ install_softiscsi ++ fi + } + + # called by dracut +@@ -132,8 +206,8 @@ install() { + + # Detect iBFT and perform mandatory steps + if [[ $hostonly_cmdline == "yes" ]] ; then +- local _ibftconf=$(install_ibft) +- [[ $_ibftconf ]] && printf "%s\n" "$_ibftconf" >> "${initdir}/etc/cmdline.d/95iscsi.conf" ++ local _iscsiconf=$(cmdline) ++ [[ $_iscsiconf ]] && printf "%s\n" "$_iscsiconf" >> "${initdir}/etc/cmdline.d/95iscsi.conf" + fi + + inst_hook cmdline 90 "$moddir/parse-iscsiroot.sh" +-- +1.8.4.5 + diff --git a/0094-Implement-shortcut-ip-ifname-static-for-static-confi.patch b/0094-Implement-shortcut-ip-ifname-static-for-static-confi.patch new file mode 100644 index 0000000..b29b68d --- /dev/null +++ b/0094-Implement-shortcut-ip-ifname-static-for-static-confi.patch @@ -0,0 +1,86 @@ +From a345cf3c3d7c15cfca5735c531f825062235c135 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Wed, 2 Jul 2014 11:20:22 +0200 +Subject: Implement shortcut 'ip=:static' for static configuration + +To simplify static configurate we should be pulling in the +existing 'ifcfg' files when running in hostonly mode. +With that we can implement the shortcut 'ip=:static' +to use the existing configuration from the ifcfg file. + +Signed-off-by: Hannes Reinecke +--- + modules.d/40network/ifup.sh | 14 +++++++++++++- + modules.d/40network/module-setup.sh | 4 ++++ + modules.d/40network/parse-ip-opts.sh | 8 +++++++- + 3 files changed, 24 insertions(+), 2 deletions(-) + +diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh +index 6f279a4..f3e07a6 100755 +--- a/modules.d/40network/ifup.sh ++++ b/modules.d/40network/ifup.sh +@@ -399,6 +399,18 @@ for p in $(getargs ip=); do + [ "$use_bridge" != 'true' ] && \ + [ "$use_vlan" != 'true' ] && continue + ++ if [ "$autoconf" = "static" ] && ++ [ -e /etc/sysconfig/network/ifcfg-${netif} ] ; then ++ # Pull in existing static configuration ++ . /etc/sysconfig/network/ifcfg-${netif} ++ ip=${IPADDR} ++ mask=${PREFIXLEN} ++ mtu=${MTU} ++ server=${REMOTE_IPADDR} ++ gw=${GATEWAY} ++ autoconf=${BOOTPROTO} ++ fi ++ + # setup nameserver + namesrv="$dns1 $dns2 $(getargs nameserver)" + for s in $namesrv; do +@@ -411,7 +423,7 @@ for p in $(getargs ip=); do + done > /tmp/net.$netif.override + + case $autoconf in +- dhcp|on|any) ++ dhcp4|dhcp|on|any) + do_dhcp -4 ;; + dhcp6) + load_ipv6 +diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh +index 7e7f087..690ff08 100755 +--- a/modules.d/40network/module-setup.sh ++++ b/modules.d/40network/module-setup.sh +@@ -101,6 +101,10 @@ install() { + + _arch=$(uname -m) + ++ [[ $hostonly ]] && { ++ inst_multiple /etc/sysconfig/network/ifcfg-* ++ } ++ + inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \ + {"tls/$_arch/",tls/,"$_arch/",}"libnss_mdns4_minimal.so.*" + +diff --git a/modules.d/40network/parse-ip-opts.sh b/modules.d/40network/parse-ip-opts.sh +index 7e73574..e48b0f3 100755 +--- a/modules.d/40network/parse-ip-opts.sh ++++ b/modules.d/40network/parse-ip-opts.sh +@@ -64,7 +64,13 @@ for p in $(getargs ip=); do + # Error checking for autoconf in combination with other values + case $autoconf in + error) die "Error parsing option 'ip=$p'";; +- bootp|rarp|both) die "Sorry, ip=$autoconf is currenty unsupported";; ++ bootp|rarp|both) die "Sorry, ip=$autoconf is currently unsupported";; ++ static) ++ if [ ! -e /etc/sysconfig/network/ifcfg-${dev} ] ; then ++ warn "No ifcfg configuration present for interface $dev, skipping" ++ continue ++ fi ++ ;; + none|off) + [ -z "$ip" ] && \ + die "For argument 'ip=$p'\nValue '$autoconf' without static configuration does not make sense" +-- +1.8.4.5 + diff --git a/0095-95iscsi-use-static-configuration-for-software-iscsi.patch b/0095-95iscsi-use-static-configuration-for-software-iscsi.patch new file mode 100644 index 0000000..8109e84 --- /dev/null +++ b/0095-95iscsi-use-static-configuration-for-software-iscsi.patch @@ -0,0 +1,37 @@ +From d62ee7be6309c4f5e3f8b0d3c6e825da03095ed7 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Wed, 2 Jul 2014 11:56:29 +0200 +Subject: 95iscsi: use static configuration for software iscsi + +When using software iscsi we should be using the existing +configuration from the system for the time being. + +References: bnc#884768 + +Signed-off-by: Hannes Reinecke +--- + modules.d/95iscsi/module-setup.sh | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh +index e9bed24..81ffb18 100755 +--- a/modules.d/95iscsi/module-setup.sh ++++ b/modules.d/95iscsi/module-setup.sh +@@ -76,9 +76,11 @@ install_iscsiroot() { + esac + done + +- local_address=$(ip -o route get to $iscsi_address | cut -f 1 -d ' ') +- ifname=$(ip addr show to $local_address | head -1 | sed -n 's/[0-9]*: \(.*\): .*/\1/p') +- if [ -d /sys/class/net/$ifname/address ] ; then ++ local_address=$(ip -o route get to $iscsi_address | sed -n 's/.*src \([0-9a-f.:]*\).*/\1/p') ++ ifname=$(ip -o route get to $iscsi_address | sed -n 's/.*dev \([^ ]*\).*/\1/p') ++ printf 'ip=%s:static ' ${ifname} ++ ++ if [ -e /sys/class/net/$ifname/address ] ; then + ifmac=$(cat /sys/class/net/$ifname/address) + printf 'ifname=%s:%s ' ${ifname} ${ifmac} + fi +-- +1.8.4.5 + diff --git a/0096-dracut-Fix-error-local-can-only-be-used-in-a-functio.patch b/0096-dracut-Fix-error-local-can-only-be-used-in-a-functio.patch new file mode 100644 index 0000000..dca1d7c --- /dev/null +++ b/0096-dracut-Fix-error-local-can-only-be-used-in-a-functio.patch @@ -0,0 +1,45 @@ +From 3dc48f4ee656529936a6021fb0f0885ece2dc26e Mon Sep 17 00:00:00 2001 +From: Thomas Renninger +Date: Thu, 3 Jul 2014 15:16:42 +0200 +Subject: dracut: Fix error: local: can only be used in a function + +Signed-off-by: Thomas Renninger +--- + modules.d/98systemd/dracut-pre-udev.sh | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/modules.d/98systemd/dracut-pre-udev.sh b/modules.d/98systemd/dracut-pre-udev.sh +index 77977d2..68021aa 100755 +--- a/modules.d/98systemd/dracut-pre-udev.sh ++++ b/modules.d/98systemd/dracut-pre-udev.sh +@@ -26,10 +26,12 @@ fi + + for i in $(getargs rd.driver.pre -d rdloaddriver=); do + ( +- local IFS=, ++ _IFS="$IFS" ++ IFS=, + for p in $i; do + modprobe $p 2>&1 | vinfo + done ++ IFS="$_IFS" + ) + done + +@@ -38,10 +40,12 @@ done + + for i in $(getargs rd.driver.blacklist -d rdblacklist=); do + ( +- local IFS=, ++ _IFS="$IFS" ++ IFS=, + for p in $i; do + echo "blacklist $p" >> $_modprobe_d/initramfsblacklist.conf + done ++ IFS="$_IFS" + ) + done + +-- +1.8.4.5 + diff --git a/0097-Implement-rd.timeout-to-modify-the-device-timeout.patch b/0097-Implement-rd.timeout-to-modify-the-device-timeout.patch new file mode 100644 index 0000000..2802ad1 --- /dev/null +++ b/0097-Implement-rd.timeout-to-modify-the-device-timeout.patch @@ -0,0 +1,106 @@ +From 59be707744473b82f2ae6d14a159fbf94834d4b6 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Thu, 3 Jul 2014 11:21:29 +0200 +Subject: Implement 'rd.timeout' to modify the device timeout + +When generating units for devices the administrator might +want to use a different timeout than the default. +So implement a new parameter 'rd.timeout' for this. + +References: bnc#878770 + +Signed-off-by: Hannes Reinecke +--- + dracut.cmdline.7.asc | 7 ++++++- + modules.d/98systemd/rootfs-generator.sh | 7 +++++-- + modules.d/99base/dracut-lib.sh | 6 +++++- + 3 files changed, 16 insertions(+), 4 deletions(-) + +diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc +index 84fe794..2dc795b 100644 +--- a/dracut.cmdline.7.asc ++++ b/dracut.cmdline.7.asc +@@ -117,11 +117,16 @@ Misc + have been loaded. This parameter can be specified multiple times. + + **rd.retry=**____:: +- specify how long dracut should wait for devices to appear. ++ specify how long dracut should retry the initqueue to configure devices. + The default is 30 seconds. After 2/3 of the time, degraded raids are force + started. If you have hardware, which takes a very long time to announce its + drives, you might want to extend this value. + ++**rd.timeout=**____:: ++ specify how long dracut should wait for devices to appear. The ++ default is '0', which means 'forever'. Note that this timeout ++ should be longer than rd.retry to allow for proper configuration. ++ + **rd.noverifyssl**:: + accept self-signed certificates for ssl downloads. + +diff --git a/modules.d/98systemd/rootfs-generator.sh b/modules.d/98systemd/rootfs-generator.sh +index 2c09895..a2b71ff 100755 +--- a/modules.d/98systemd/rootfs-generator.sh ++++ b/modules.d/98systemd/rootfs-generator.sh +@@ -7,8 +7,11 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh + generator_wait_for_dev() + { + local _name ++ local _timeout + + _name="$(str_replace "$1" '/' '\x2f')" ++ _timeout=$(getarg rd.timeout) ++ _timeout=${_timeout:-0} + + [ -e "$hookdir/initqueue/finished/devexists-${_name}.sh" ] && return 0 + +@@ -29,7 +32,7 @@ generator_wait_for_dev() + mkdir -p /run/systemd/generator/${_name}.device.d + { + echo "[Unit]" +- echo "JobTimeoutSec=0" ++ echo "JobTimeoutSec=$_timeout" + } > /run/systemd/generator/${_name}.device.d/timeout.conf + fi + } +@@ -60,6 +63,6 @@ case "$root" in + rootok=1 ;; + esac + +-[ "${root%%:*}" = "block" ] && generator_wait_for_dev "${root#block:}" ++[ "${root%%:*}" = "block" ] && generator_wait_for_dev "${root#block:}" "$RDRETRY" + + exit 0 +diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh +index 33f7678..5a867b8 100755 +--- a/modules.d/99base/dracut-lib.sh ++++ b/modules.d/99base/dracut-lib.sh +@@ -876,12 +876,16 @@ wait_for_dev() + local _name + local _needreload + local _noreload ++ local _timeout + + if [ "$1" = "-n" ]; then + _noreload=1 + shift + fi + ++ _timeout=$(getarg rd.timeout) ++ _timeout=${_timeout:-0} ++ + _name="$(str_replace "$1" '/' '\x2f')" + + [ -e "${PREFIX}$hookdir/initqueue/finished/devexists-${_name}.sh" ] && return 0 +@@ -905,7 +909,7 @@ wait_for_dev() + mkdir -p ${PREFIX}/etc/systemd/system/${_name}.device.d + { + echo "[Unit]" +- echo "JobTimeoutSec=0" ++ echo "JobTimeoutSec=$_timeout" + } > ${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf + _needreload=1 + fi +-- +1.8.4.5 + diff --git a/0098-Do-not-call-lvm-for-non-LVM-device-mapper-devices.patch b/0098-Do-not-call-lvm-for-non-LVM-device-mapper-devices.patch new file mode 100644 index 0000000..e8365e6 --- /dev/null +++ b/0098-Do-not-call-lvm-for-non-LVM-device-mapper-devices.patch @@ -0,0 +1,37 @@ +From 438b80786d2d3f729620bcf73d65732e9e84c52e Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Thu, 3 Jul 2014 14:44:22 +0200 +Subject: Do not call 'lvm' for non-LVM device-mapper devices + +If a device-mapper device is not created by LVM it's pointless +to call any 'lvm' programs got extract details; they'll be +failing anyway. So check the UUID before calling 'lvm'. +This speeds up initrd creation and avoids I/O errors on +multipath devices. + +Signed-off-by: Hannes Reinecke +--- + dracut-functions.sh | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 1e0779a..b6247f5 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -700,10 +700,12 @@ for_each_host_dev_and_slaves() + # but you cannot create the logical volume without the volume group. + # And the volume group might be bigger than the devices the LV needs. + check_vol_slaves() { +- local _lv _vg _pv ++ local _lv _vg _pv _dm + for i in /dev/mapper/*; do + [[ $i == /dev/mapper/control ]] && continue + _lv=$(get_maj_min $i) ++ _dm=/sys/dev/block/$_lv/dm ++ [[ -f $_dm/uuid && $(<$_dm/uuid) =~ LVM-* ]] || continue + if [[ $_lv = $2 ]]; then + _vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null) + # strip space +-- +1.8.4.5 + diff --git a/0099-90multipath-Load-device_handler-modules-early-during.patch b/0099-90multipath-Load-device_handler-modules-early-during.patch new file mode 100644 index 0000000..5bb3dd2 --- /dev/null +++ b/0099-90multipath-Load-device_handler-modules-early-during.patch @@ -0,0 +1,50 @@ +From 760bf001b3941f52451c148f3b3d66a38d4ef457 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Thu, 3 Jul 2014 15:29:59 +0200 +Subject: 90multipath: Load device_handler modules early during boot + +The device handler modules need to be loaded early during boot +to avoid I/O errors being printed to the system log. + +References: bnc#871617 + +Signed-off-by: Hannes Reinecke +--- + modules.d/90multipath/module-setup.sh | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh +index 22ff580..6ac8534 100755 +--- a/modules.d/90multipath/module-setup.sh ++++ b/modules.d/90multipath/module-setup.sh +@@ -30,6 +30,15 @@ depends() { + } + + # called by dracut ++cmdline() { ++ for m in scsi_dh_alua scsi_dh_emc scsi_dh_rdac ; do ++ if module_is_host_only $m ; then ++ printf 'rd.driver.pre=%s ' "$m" ++ fi ++ done ++} ++ ++# called by dracut + installkernel() { + local _ret + local _arch=$(uname -m) +@@ -91,6 +100,11 @@ install() { + inst_libdir_file "libmultipath*" "multipath/*" + inst_libdir_file 'libgcc_s.so*' + ++ if [[ $hostonly_cmdline ]] ; then ++ local _conf=$(cmdline) ++ [[ $_conf ]] && echo "$_conf" >> "${initdir}/etc/cmdline.d/90multipath.conf" ++ fi ++ + if dracut_module_included "systemd"; then + inst_simple "${moddir}/multipathd.service" "${systemdsystemunitdir}/multipathd.service" + mkdir -p "${initdir}${systemdsystemunitdir}/sysinit.target.wants" +-- +1.8.4.5 + diff --git a/0100-Add-btrfs-rescue-utilities.patch b/0100-Add-btrfs-rescue-utilities.patch new file mode 100644 index 0000000..51c4955 --- /dev/null +++ b/0100-Add-btrfs-rescue-utilities.patch @@ -0,0 +1,28 @@ +From b809bebcb9a32330e050fdaac0653379cbe4d01a Mon Sep 17 00:00:00 2001 +From: David Sterba +Date: Fri, 4 Jul 2014 10:22:59 +0200 +Subject: Add btrfs rescue utilities + +Signed-off-by: David Sterba +--- + modules.d/90btrfs/module-setup.sh | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/modules.d/90btrfs/module-setup.sh b/modules.d/90btrfs/module-setup.sh +index 406fd6d..d76e767 100755 +--- a/modules.d/90btrfs/module-setup.sh ++++ b/modules.d/90btrfs/module-setup.sh +@@ -46,7 +46,8 @@ install() { + inst_hook initqueue/timeout 10 "$moddir/btrfs_timeout.sh" + fi + +- inst_multiple -o btrfsck btrfs-zero-log ++ # rescue utilities ++ inst_multiple btrfs-zero-log btrfs-image btrfs-dump-super ++ inst_multiple btrfs-debug-tree mkfs.btrfs btrfstune btrfs-select-super + inst $(command -v btrfs) /sbin/btrfs + } +- +-- +1.8.4.5 + diff --git a/dracut.changes b/dracut.changes index 35830a1..675844a 100644 --- a/dracut.changes +++ b/dracut.changes @@ -1,3 +1,36 @@ +------------------------------------------------------------------- +Thu Jul 3 18:16:11 CEST 2014 - dsterba@suse.cz + +- 90btrfs: Install rescue utilities to initrd + * Add: 0100-btrfs-add-initrd-rescue-utilities.patch + +------------------------------------------------------------------- +Thu Jul 3 15:41:16 CEST 2014 - hare@suse.de + +- 40network: create /var/lib/wicked in ifup.sh (bnc#885141) + * Add: 0089-40network-create-var-lib-wicked-in-ifup.sh.patch +- dracut: caps: Remove whole caps module + * Add: 0090-dracut-caps-Remove-whole-caps-module.patch +- dracut: biosdevname: Only install if present + * Add: 0091-dracut-biosdevname-In-SUSE-biosdevname-package-is-in.patch +- dracut: nbd: Only complain of missing binary in hostonly mode + if rootfs is on nbd + * Add: 0092-dracut-nbd-Only-complain-of-missing-binary-in-hoston.patch +- 95iscsi: generate commandline for software iscsi (bnc#880108) + * Add: 0093-95iscsi-generate-commandline-for-software-iscsi.patch +- Implement shortcut 'ip=:static' for static configuration + * Add: 0094-Implement-shortcut-ip-ifname-static-for-static-confi.patch +- 95iscsi: use static configuration for software iscsi (bnc#884768) + * Add: 0095-95iscsi-use-static-configuration-for-software-iscsi.patch +- dracut: Fix error: local: can only be used in a function + * Add: 0096-dracut-Fix-error-local-can-only-be-used-in-a-functio.patch +- Implement 'rd.timeout' to modify the device timeout (bnc#878770) + * Add: 0097-Implement-rd.timeout-to-modify-the-device-timeout.patch +- Do not call 'lvm' for non-LVM device-mapper devices + * Add: 0098-Do-not-call-lvm-for-non-LVM-device-mapper-devices.patch +- 90multipath: Load device_handler modules early during boot (bnc#871617) + * Add: 0099-90multipath-Load-device_handler-modules-early-during.patch + ------------------------------------------------------------------- Fri Jun 27 15:23:37 CEST 2014 - hare@suse.de diff --git a/dracut.spec b/dracut.spec index 61831d4..827ddba 100644 --- a/dracut.spec +++ b/dracut.spec @@ -109,6 +109,18 @@ Patch85: 0085-95zfcp_rules-print-out-rd.zfcp-commandline-parameter.patch Patch86: 0086-95zfcp_rules-Auto-generate-udev-rule-for-ipl-device.patch Patch87: 0087-95dasd_rules-Auto-generate-udev-rule-for-ipl-device.patch Patch88: 0088-91zipl-Add-new-module-to-update-s390x-configuration.patch +Patch89: 0089-40network-create-var-lib-wicked-in-ifup.sh.patch +Patch90: 0090-dracut-caps-Remove-whole-caps-module.patch +Patch91: 0091-dracut-biosdevname-In-SUSE-biosdevname-package-is-in.patch +Patch92: 0092-dracut-nbd-Only-complain-of-missing-binary-in-hoston.patch +Patch93: 0093-95iscsi-generate-commandline-for-software-iscsi.patch +Patch94: 0094-Implement-shortcut-ip-ifname-static-for-static-confi.patch +Patch95: 0095-95iscsi-use-static-configuration-for-software-iscsi.patch +Patch96: 0096-dracut-Fix-error-local-can-only-be-used-in-a-functio.patch +Patch97: 0097-Implement-rd.timeout-to-modify-the-device-timeout.patch +Patch98: 0098-Do-not-call-lvm-for-non-LVM-device-mapper-devices.patch +Patch99: 0099-90multipath-Load-device_handler-modules-early-during.patch +Patch100: 0100-Add-btrfs-rescue-utilities.patch BuildRequires: asciidoc BuildRequires: bash @@ -238,6 +250,18 @@ and its cryptography during startup. %patch86 -p1 %patch87 -p1 %patch88 -p1 +%patch89 -p1 +%patch90 -p1 +%patch91 -p1 +%patch92 -p1 +%patch93 -p1 +%patch94 -p1 +%patch95 -p1 +%patch96 -p1 +%patch97 -p1 +%patch98 -p1 +%patch99 -p1 +%patch100 -p1 %build %configure\