public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/s390utils] f44: zfcp: migrate to consolidated persistent device config with zdev (#1937046,#1937048)
@ 2026-08-05  9:17 Steffen Maier
  0 siblings, 0 replies; only message in thread
From: Steffen Maier @ 2026-08-05  9:17 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/s390utils
            Branch : f44
            Commit : 91f46d3bfcab50fb31c605da0e3af796b74d41c6
            Author : Steffen Maier <maier@linux.ibm.com>
            Date   : 2026-05-26T12:57:23+02:00
            Stats  : +51/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/s390utils/c/91f46d3bfcab50fb31c605da0e3af796b74d41c6?branch=f44

            Log:
            zfcp: migrate to consolidated persistent device config with zdev (#1937046,#1937048)

Implements the zfcp part of referenced bugs.

This also fixes real customer problems with Live Guest Relocation under
z/VM SSI, where the destination has vHBAs with different device bus-IDs.
56-zfcp.rules only triggers on initialization of the zfcp device driver.
Even though users had persistently configured vHBAs (with full zfcp paths)
in /etc/zfcp.conf, it could not automatically activate the vHBAs on the
destination after relocation and thus lost all paths.
Zdev persistent config udev rules selectively trigger on hotplug of
vHBA devices (and of FC remote ports).

The new script zfcpconfmigrate.sh needs to be called at an appropriate time
during distribution upgrade. If /etc/zfcp.conf exists, it automatically
migrates /etc/zfcp.conf to zdev persistent config and moves the old
zfcp.conf to a backup file. To prevent overwriting potentially existing
backups of the old persistent configuration, simply use a timestamp so we
don't overwrite old migration backups.

Signed-off-by: Steffen Maier <maier@linux.ibm.com>

---
diff --git a/s390utils.spec b/s390utils.spec
index b360b8a..25d8e3e 100644
--- a/s390utils.spec
+++ b/s390utils.spec
@@ -64,6 +64,8 @@ Source21:       https://fedorapeople.org/cgit/sharkcz/public_git/utils.git/tree/
 Source23:       20-zipl-kernel.install
 Source24:       52-zipl-rescue.install
 Source25:       91-zipl.install
+Source26:       https://fedorapeople.org/cgit/sharkcz/public_git/utils.git/tree/zfcpconfmigrate.sh
+
 
 %if %{with signzipl}
 %define pesign_name redhatsecureboot302
@@ -212,6 +214,7 @@ mv %{buildroot}%{_datadir}/s390-tools/netboot/mk-s390image.1 %{buildroot}%{_mand
 mkdir -p %{buildroot}{/boot,%{_udevrulesdir},%{_sysconfdir}/{profile.d,sysconfig},%{_prefix}/lib/modules-load.d}
 install -p -m 644 zipl/boot/tape0.bin %{buildroot}/boot/tape0
 install -p -m 755 %{SOURCE5} %{buildroot}%{_sbindir}
+install -p -m 755 %{SOURCE26} %{buildroot}%{_sbindir}
 install -p -m 755 %{SOURCE13} %{buildroot}%{_sbindir}
 install -p -m 755 %{SOURCE21} %{buildroot}%{_sbindir}
 install -p -m 644 %{SOURCE7} %{buildroot}%{_udevrulesdir}/56-zfcp.rules
@@ -403,6 +406,7 @@ This package provides minimal set of tools needed to system to boot.
 %{_sbindir}/dasdconf.sh
 %{_sbindir}/normalize_dasd_arg
 %{_sbindir}/zfcpconf.sh
+%{_sbindir}/zfcpconfmigrate.sh
 %{_sbindir}/device_cio_free
 %{_sbindir}/dasd_cio_free
 %{_sbindir}/zfcp_cio_free

diff --git a/zfcpconfmigrate.sh b/zfcpconfmigrate.sh
new file mode 100644
index 0000000..2a3d850
--- /dev/null
+++ b/zfcpconfmigrate.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+# SPDX-License-Identifier: MIT
+# Copyright IBM Corp. 2023
+
+# This is just a wrapper to migrate old /etc/zfcp.conf to the new
+# consolidated persistent configuration of s390 devices with chzdev.
+
+CONFIG=/etc/zfcp.conf
+PATH=/bin:/sbin
+
+DATE=$(date --iso-8601=seconds)
+PREFIX="${CONFIG}.${DATE}.migrated-to-chzdev"
+
+if [ -f "$CONFIG" ]; then
+    # show migration output to users and log it into file
+    exec > >(tee "${PREFIX}.log") 2>&1
+    sed 'y/ABCDEF/abcdef/' < $CONFIG | while read -r line; do
+       case $line in
+	   \#*) ;;
+	   *)
+	       [ -z "$line" ] && continue
+	       # shellcheck disable=SC2086
+	       set -- $line
+	       if [ $# -eq 1 ]; then
+		   DEVICE=${1##*0x}
+		   chzdev --enable --persistent zfcp-host "$DEVICE" --yes --no-root-update --force --no-settle
+		   continue
+	       fi
+	       if [ $# -eq 5 ]; then
+		   DEVICE=$1
+		   #SCSIID=$2
+		   WWPN=$3
+		   #SCSILUN=$4
+		   FCPLUN=$5
+	       elif [ $# -eq 3 ]; then
+		   DEVICE=${1##*0x}
+		   WWPN=$2
+		   FCPLUN=$3
+	       fi
+	       chzdev --enable --persistent zfcp-lun "$DEVICE:$WWPN:$FCPLUN" --yes --no-root-update --force --no-settle
+	       ;;
+       esac
+   done
+   mv "$CONFIG" "$PREFIX"
+   echo "zfcpconfmigrate.sh: Information: Your persistent zfcp device configuration file $CONFIG was migrated to the new consolidated mechanism. From now on, please use lszdev and chzdev from s390utils instead. To finally complete the migration, please run: kdumpctl rebuild; systemctl restart kdump; dracut -f; zipl"
+fi

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-05  9:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-05  9:17 [rpms/s390utils] f44: zfcp: migrate to consolidated persistent device config with zdev (#1937046,#1937048) Steffen Maier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox