diff --git a/0027-95fcoe-Store-current-configuration-in-dracut-cmdline.patch b/0027-95fcoe-Store-current-configuration-in-dracut-cmdline.patch new file mode 100644 index 0000000..97128b6 --- /dev/null +++ b/0027-95fcoe-Store-current-configuration-in-dracut-cmdline.patch @@ -0,0 +1,80 @@ +From 2e833b82a848b91b3fe186112e47dd288e39fbc0 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Tue, 13 May 2014 09:05:38 +0200 +Subject: 95fcoe: Store current configuration in dracut cmdline + +When running with --hostonly-cmdline we should be storing +the current configuration in /etc/cmdline.d so that dracut +will be configure the system automatically. + +References: bnc#877288 + +Signed-off-by: Hannes Reinecke +--- + modules.d/95fcoe/module-setup.sh | 43 ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 43 insertions(+) + +diff --git a/modules.d/95fcoe/module-setup.sh b/modules.d/95fcoe/module-setup.sh +index 9a52c00..ef4a38f 100755 +--- a/modules.d/95fcoe/module-setup.sh ++++ b/modules.d/95fcoe/module-setup.sh +@@ -2,6 +2,45 @@ + # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- + # ex: ts=8 sw=4 sts=4 et filetype=sh + ++get_vlan_parent() { ++ local link=$1 ++ ++ [ -d $link ] || return ++ read iflink < $link/iflink ++ for if in /sys/class/net/* ; do ++ read idx < $if/ifindex ++ if [ $idx -eq $iflink ] ; then ++ echo ${if##*/} ++ fi ++ done ++} ++ ++# called by dracut ++cmdline() { ++ ++ for c in /sys/bus/fcoe/devices/ctlr_* ; do ++ [ -L $c ] || continue ++ read enabled < $c/enabled ++ [ $enabled -eq 0 ] && continue ++ d=$(cd -P $c; echo $PWD) ++ i=${d%/*} ++ read mac < ${i}/address ++ s=$(dcbtool gc ${i##*/} dcb | sed -n 's/^DCB State:\t*\(.*\)/\1/p') ++ if [ -z "$s" ] ; then ++ p=$(get_vlan_parent ${i}) ++ if [ "$p" ] ; then ++ s=$(dcbtool gc ${p} dcb | sed -n 's/^DCB State:\t*\(.*\)/\1/p') ++ fi ++ fi ++ if [ "$s" = "on" ] ; then ++ dcb="dcb" ++ else ++ dcb="nodcb" ++ fi ++ echo "fcoe=${mac}:${dcb}" ++ done ++} ++ + # called by dracut + check() { + require_binaries dcbtool fipvlan lldpad ip readlink || return 1 +@@ -25,6 +64,10 @@ install() { + + mkdir -m 0755 -p "$initdir/var/lib/lldpad" + ++ if [[ $hostonly_cmdline == "yes" ]] ; then ++ cmdline >> "${initdir}/etc/cmdline.d/95fcoe.conf" ++ echo >> "${initdir}/etc/cmdline.d/95fcoe.conf" ++ fi + inst "$moddir/fcoe-up.sh" "/sbin/fcoe-up" + inst "$moddir/fcoe-edd.sh" "/sbin/fcoe-edd" + inst "$moddir/fcoe-genrules.sh" "/sbin/fcoe-genrules.sh" +-- +1.8.5.2 + diff --git a/0028-95fcoe-update-fcoe-interface-check.patch b/0028-95fcoe-update-fcoe-interface-check.patch new file mode 100644 index 0000000..d734c09 --- /dev/null +++ b/0028-95fcoe-update-fcoe-interface-check.patch @@ -0,0 +1,38 @@ +From d0548034aab7e57778ee649e555d576810019cb8 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Tue, 13 May 2014 11:01:29 +0200 +Subject: 95fcoe: update fcoe interface check + +The 'create' sysfs entry has been removed for newer fcoe modules, +so just check if the module directory exists. + +References: bnc#877288 + +Signed-off-by: Hannes Reinecke +--- + modules.d/95fcoe/parse-fcoe.sh | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/modules.d/95fcoe/parse-fcoe.sh b/modules.d/95fcoe/parse-fcoe.sh +index dc40c82..8e08303 100755 +--- a/modules.d/95fcoe/parse-fcoe.sh ++++ b/modules.d/95fcoe/parse-fcoe.sh +@@ -22,14 +22,11 @@ + + + # BRCM: Later, should check whether bnx2x is loaded first before loading bnx2fc so do not load bnx2fc when there are no Broadcom adapters +-[ -e /sys/module/fcoe/parameters/create ] || modprobe -a fcoe || die "FCoE requested but kernel/initrd does not support FCoE" ++[ -d /sys/module/fcoe ] || modprobe -a fcoe || die "FCoE requested but kernel/initrd does not support FCoE" + + modprobe bnx2fc >/dev/null 2>&1 + udevadm settle --timeout=30 + +-# FCoE actually supported? +-[ -e /sys/module/fcoe/parameters/create ] || modprobe fcoe || die "FCoE requested but kernel/initrd does not support FCoE" +- + parse_fcoe_opts() { + local IFS=: + set $fcoe +-- +1.8.5.2 + diff --git a/0029-95fcoe-start-lldpad-separately.patch b/0029-95fcoe-start-lldpad-separately.patch new file mode 100644 index 0000000..ac15539 --- /dev/null +++ b/0029-95fcoe-start-lldpad-separately.patch @@ -0,0 +1,120 @@ +From f7c7657cafc12cf9ab03c6ff84c05b09c8f9bdd1 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Wed, 14 May 2014 08:04:22 +0200 +Subject: 95fcoe: start lldpad separately + +lldpad is a system-wide process, which must be started only once. +So we should be separate it from fcoe-up, as it might be called +several times. + +Signed-off-by: Hannes Reinecke +--- + modules.d/95fcoe/fcoe-up.sh | 8 -------- + modules.d/95fcoe/lldpad.sh | 15 +++++++++++++++ + modules.d/95fcoe/module-setup.sh | 1 + + 3 files changed, 16 insertions(+), 8 deletions(-) + create mode 100644 modules.d/95fcoe/lldpad.sh + +Index: dracut-037/modules.d/95fcoe/fcoe-up.sh +=================================================================== +--- dracut-037.orig/modules.d/95fcoe/fcoe-up.sh ++++ dracut-037/modules.d/95fcoe/fcoe-up.sh +@@ -24,10 +24,6 @@ netdriver=$(readlink -f /sys/class/net/$ + netdriver=${netdriver##*/} + + if [ "$dcb" = "dcb" ]; then +- # Note lldpad will stay running after switchroot, the system initscripts +- # are to kill it and start a new lldpad to take over. Data is transfered +- # between the 2 using a shm segment +- lldpad -d + # wait for lldpad to be ready + i=0 + while [ $i -lt 60 ]; do +@@ -37,10 +33,6 @@ if [ "$dcb" = "dcb" ]; then + i=$(($i+1)) + done + +- # on some systems lldpad needs some time +- # sleep until we find a better solution +- sleep 30 +- + while [ $i -lt 60 ]; do + dcbtool sc "$netif" dcb on && break + info "Retrying to turn dcb on" +Index: dracut-037/modules.d/95fcoe/lldpad.sh +=================================================================== +--- /dev/null ++++ dracut-037/modules.d/95fcoe/lldpad.sh +@@ -0,0 +1,15 @@ ++#!/bin/bash ++ ++# Note lldpad will stay running after switchroot, the system initscripts ++# are to kill it and start a new lldpad to take over. Data is transfered ++# between the 2 using a shm segment ++lldpad -d ++# wait for lldpad to be ready ++i=0 ++while [ $i -lt 60 ]; do ++ lldptool -p && break ++ info "Waiting for lldpad to be ready" ++ sleep 1 ++ i=$(($i+1)) ++done ++ +Index: dracut-037/modules.d/95fcoe/module-setup.sh +=================================================================== +--- dracut-037.orig/modules.d/95fcoe/module-setup.sh ++++ dracut-037/modules.d/95fcoe/module-setup.sh +@@ -71,6 +71,7 @@ install() { + inst "$moddir/fcoe-up.sh" "/sbin/fcoe-up" + inst "$moddir/fcoe-edd.sh" "/sbin/fcoe-edd" + inst "$moddir/fcoe-genrules.sh" "/sbin/fcoe-genrules.sh" ++ inst_hook pre-trigger 03 "$moddir/lldpad.sh" + inst_hook cmdline 99 "$moddir/parse-fcoe.sh" + dracut_need_initqueue + } +Index: dracut-037/mkinitrd-suse.8.asc +=================================================================== +--- dracut-037.orig/mkinitrd-suse.8.asc ++++ dracut-037/mkinitrd-suse.8.asc +@@ -61,11 +61,6 @@ OPTIONS + **-I** _:: + Configure the specified interface statically. + +-**-a** _:: +- Attach compiled ACPI DSDT (Differentiated System Description Table) +- to initrd. This replaces the DSDT of the BIOS. Defaults to the +- _ACPI_DSDT_ variable in */etc/sysconfig/kernel*. +- + **-M** _:: + System.map file to use. + +@@ -87,9 +82,6 @@ OPTIONS + Disable logging to _/var/log/YaST2/mkinitrd.log_. This is useful for + testing if you don’t want to clutter the system log. + +-**--force**:: +- overwrite existing initramfs file. +- + **--help**:: + print a help message and exit. + +Index: dracut-037/mkinitrd-suse.8 +=================================================================== +--- dracut-037.orig/mkinitrd-suse.8 ++++ dracut-037/mkinitrd-suse.8 +@@ -117,14 +117,6 @@ Run dhcp on the specified interface (for + Configure the specified interface statically\&. + .RE + .PP +-\fB\-a\fR\ \&_ +-.RS 4 +-Attach compiled ACPI DSDT (Differentiated System Description Table) to initrd\&. This replaces the DSDT of the BIOS\&. Defaults to the +-\fIACPI_DSDT\fR +-variable in +-\fB/etc/sysconfig/kernel\fR\&. +-.RE +-.PP + \fB\-M\fR\ \&_ + .RS 4 + System\&.map file to use\&. diff --git a/0030-dracut-mkinitd_cleanup_force_host_only_var.patch b/0030-dracut-mkinitd_cleanup_force_host_only_var.patch new file mode 100644 index 0000000..a78543e --- /dev/null +++ b/0030-dracut-mkinitd_cleanup_force_host_only_var.patch @@ -0,0 +1,46 @@ +--- a/mkinitrd-suse.sh 2014-05-15 15:54:28.000000000 +0200 ++++ b/mkinitrd-suse.sh 2014-05-15 15:57:38.609899222 +0200 +@@ -23,7 +23,6 @@ + boot_dir="/boot" + quiet=0 + host_only=1 +-force=0 + logfile=/var/log/YaST2/mkinitrd.log + dracut_cmd=dracut + +@@ -203,8 +202,6 @@ + for initrd_image in $initrd_images;do + targets="$targets $initrd_image" + done +- host_only=1 +- force=1 + } + + while (($# > 0)); do +@@ -217,8 +214,6 @@ + for kernel_image in $kernel_images;do + kernels="$kernels ${kernel_image#*-}" + done +- host_only=1 +- force=1 + ;; + -i) read_arg initrd_images "$@" || shift $? + for initrd_image in $initrd_images;do +@@ -274,7 +269,6 @@ + --version|-R) + echo "mkinitrd: dracut compatibility wrapper" + exit 0;; +- --force) force=1;; + --quiet|-q) quiet=1;; + *) if [[ ! $targets ]]; then + targets=$1 +@@ -302,7 +296,8 @@ + else + dracut_args="${dracut_args} --no-hostonly --no-hostonly-cmdline" + fi +-[[ $force == 1 ]] && dracut_args="${dracut_args} --force" ++dracut_args="${dracut_args} --force" ++ + [[ $dracut_cmdline ]] && dracut_args="${dracut_args} --kernel-cmdline ${dracut_cmdline}" + [ -z "$(type -p update-bootloader)" ] && skip_update_bootloader=1 + diff --git a/dracut.changes b/dracut.changes index 9b1b389..b1bd24a 100644 --- a/dracut.changes +++ b/dracut.changes @@ -1,3 +1,23 @@ +------------------------------------------------------------------- +Thu May 15 14:07:44 UTC 2014 - trenn@suse.de + +- By Hannes Reinecke : + - Fixup FCoE booting (bnc#877288) + * Add 0027-95fcoe-Store-current-configuration-in-dracut-cmdline.patch + * Add 0028-95fcoe-update-fcoe-interface-check.patch + * Add 0029-95fcoe-start-lldpad-separately.patch +- Cleanup host_only variable using in mkinitrd +- Remove --force parameter from mkinitrd, we always force anyway + * Add 0030-dracut-mkinitd_cleanup_force_host_only_var.patch +- Remove acpi parameter from mkinitrd, this is done differently nowadays +- Adjust manpage accordingly + +------------------------------------------------------------------- +Wed May 14 12:42:37 UTC 2014 - meissner@suse.com + +- also do the service magic in %post/%postun, otherwise + purge-kernels will not get enabled. + ------------------------------------------------------------------- Wed May 7 15:25:37 UTC 2014 - trenn@suse.de diff --git a/dracut.spec b/dracut.spec index feb7cdc..52f7a7d 100644 --- a/dracut.spec +++ b/dracut.spec @@ -61,6 +61,11 @@ Patch36: 0023-mkinitrd-suse.sh-Use-hostonly-and-hostonly-cmdline-c.patch Patch37: 0024-95iscsi-Set-correct-iscsi_started-value-for-iSCSI-fi.patch Patch38: 0025-dracut_continue_adding_modules_also_on_error.patch Patch39: 0026-force_to_add_and_load_kernel_modules_other_than_via_boot_param.patch +Patch40: 0027-95fcoe-Store-current-configuration-in-dracut-cmdline.patch +Patch41: 0028-95fcoe-update-fcoe-interface-check.patch +Patch42: 0029-95fcoe-start-lldpad-separately.patch +Patch43: 0030-dracut-mkinitd_cleanup_force_host_only_var.patch + BuildRequires: asciidoc BuildRequires: bash BuildRequires: docbook-xsl-stylesheets @@ -136,6 +141,10 @@ and its cryptography during startup. %patch37 -p1 %patch38 -p1 %patch39 -p1 +%patch40 -p1 +%patch41 -p1 +%patch42 -p1 +%patch43 -p1 %build %configure\ @@ -211,9 +220,15 @@ ln -s %{dracutlibdir}/modules.d/45ifcfg/write-ifcfg-redhat.sh %{buildroot}/%{dra %pre %service_add_pre purge-kernels.service +%post +%service_add_post purge-kernels.service + %preun %service_del_preun purge-kernels.service +%postun +%service_del_postun purge-kernels.service + %files fips %defattr(-,root,root,0755) %doc COPYING