Accepting request 574764 from home:dmolkentin:branches:Base:System

- 95qeth_rules: Add new module to copy qeth rules (FATE#323440)
  * Adds 0556-95qeth_rules-Add-new-module-to-copy-qeth-rules.patch 
- Avoid executing emergency hook twice
  * Adds 0555-Avoid-executing-emergency-hooks-twice.patch

OBS-URL: https://build.opensuse.org/request/show/574764
OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=337
This commit is contained in:
Daniel Molkentin 2018-02-09 16:21:40 +00:00 committed by Git OBS Bridge
parent 827bedd97e
commit 7eccbe8e9c
3 changed files with 100 additions and 2 deletions

View File

@ -0,0 +1,83 @@
From c4f914a33ac07348245b865dd356c60459d81b42 Mon Sep 17 00:00:00 2001
From: Daniel Molkentin <dmolkentin@suse.com>
Date: Mon, 29 Jan 2018 08:58:31 -0500
Subject: [PATCH] 95qeth_rules: Add new module to copy qeth rules
Only pick rules for interfaces which have a carrier in the running
system. Those interfaces will be assembled by udev to allow booting
from those devices (i.e. iSCSI).
Reference: FATE#323440
---
modules.d/95qeth_rules/module-setup.sh | 59 ++++++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)
create mode 100755 modules.d/95qeth_rules/module-setup.sh
diff --git a/modules.d/95qeth_rules/module-setup.sh b/modules.d/95qeth_rules/module-setup.sh
new file mode 100755
index 00000000..d4d15118
--- /dev/null
+++ b/modules.d/95qeth_rules/module-setup.sh
@@ -0,0 +1,59 @@
+#!/bin/bash
+
+# called by dracut
+check() {
+ local _arch=$(uname -m)
+ local _online=0
+ [ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1
+ require_binaries /usr/lib/udev/collect || return 1
+ dracut_module_included network || return 1
+
+ [[ $hostonly ]] && {
+ for i in /sys/devices/qeth/*/online; do
+ read _online < $i
+ [ $_online -eq 1 ] && return 0
+ done
+ }
+ return 255
+}
+
+# called by dracut
+installkernel() {
+ instmods qeth
+}
+
+# called by dracut
+install() {
+ ccwid() {
+ qeth_path=$(readlink -e -q $1/device)
+ basename "$qeth_path"
+ }
+
+ inst_rules_qeth() {
+ for rule in /etc/udev/rules.d/{4,5}1-qeth-${1}.rules; do
+ # prefer chzdev generated 41- rules
+ if [ -f "$rule" ]; then
+ inst_rules "$rule"
+ break
+ fi
+ done
+ }
+
+ has_carrier() {
+ carrier=0
+ # not readable in qeth interfaces
+ # that have just been assembled, ignore
+ # read error and assume no carrier
+ read carrier 2>/dev/null < "$1/carrier"
+ [ "$carrier" -eq 1 ] && return 0
+ return 1;
+ }
+
+ for dev in /sys/class/net/*; do
+ has_carrier $dev || continue
+ id=$(ccwid $dev)
+ [ -n "$id" ] && inst_rules_qeth $id
+ done
+
+ inst_simple /usr/lib/udev/collect
+}
--
2.13.6

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Fri Feb 9 16:10:21 UTC 2018 - daniel.molkentin@suse.com
- 95qeth_rules: Add new module to copy qeth rules (FATE#323440)
* Adds 0556-95qeth_rules-Add-new-module-to-copy-qeth-rules.patch
- Avoid executing emergency hook twice
* Adds 0555-Avoid-executing-emergency-hooks-twice.patch
-------------------------------------------------------------------
Thu Jan 25 09:19:05 UTC 2018 - daniel.molkentin@suse.com

View File

@ -36,8 +36,10 @@ Source6: dracut-installkernel
Source7: 99-debug.conf
Source8: s390x_persistent_device.conf
# Network, none are upstream yet:
# Network
# Applied upstream as f0094476fd889b27b391e063f456bf8683670bf0
Patch12: 0012-40network-Fix-race-condition-when-wait-for-networks.patch
# None are upstream yet:
Patch13: 0013-40network-always-start-netroot-in-ifup.sh.patch
Patch15: 0015-40network-replace-dhclient-with-wickedd-dhcp-supplic.patch
Patch17: 0017-45ifcfg-use-distro-specific-scripts.patch
@ -145,7 +147,7 @@ Patch158: 0158-Add-SUSE-kernel-module-dependencies-in-etc-modprobe.patch
Patch163: 0163-Install-etc-sysconfig-console-to-see-specific-fonts.patch
# TODO: Verify: Should be obsolete due to fixes in systemd
Patch164: 0164-Fix-initramfs-ver.img-vs-initrd-ver-in-dracut-initra.patch
# Submitted as a check to upstream as 446654703742e6c1d7b1134a7d73b2bf7ce20cda
# Applied upstream as ed2cc8c9b96438be4527dbc9f5814196554abec4
Patch168: 0168-remove_plymouth_logo_file.patch
# Applied upstream as 251afd36b2be35b7b27011b6f90b5ab3bbbbff84
Patch180: 0180-i18n_add_correct_fontmaps.patch
@ -364,6 +366,8 @@ Patch553: 0553-98integrity-support-loading-x509-into-the-trusted-bu.patch
Patch554: 0554-98integrity-support-X.509-only-EVM-configuration.patch
# Applied upstream as 94f61235d760337fdef692fac5ead589e8f3ab0e
Patch555: 0555-Avoid-executing-emergency-hooks-twice.patch
# Patch submitted to upstream as 62ceddfd3e3b9da8bdceb1be72dae55abdf35498
Patch556: 0556-95qeth_rules-Add-new-module-to-copy-qeth-rules.patch
BuildRequires: asciidoc
BuildRequires: bash
@ -641,6 +645,7 @@ chmod a+x modules.d/91zipl/install_zipl_cmdline.sh
%patch553 -p1
%patch554 -p1
%patch555 -p1
%patch556 -p1
%build
%configure\
@ -873,6 +878,7 @@ ln -s %{dracutlibdir}/modules.d/45ifcfg/write-ifcfg-redhat.sh %{buildroot}/%{dra
%{dracutlibdir}/modules.d/95lunmask
%{dracutlibdir}/modules.d/95zfcp
%{dracutlibdir}/modules.d/95zfcp_rules
%{dracutlibdir}/modules.d/95qeth_rules
%{dracutlibdir}/modules.d/95terminfo
%{dracutlibdir}/modules.d/95udev-rules
%{dracutlibdir}/modules.d/95virtfs