Compare commits
No commits in common. "c9s" and "c8" have entirely different histories.
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,2 +1,4 @@
|
|||||||
/s390-tools-*.tar.gz
|
SOURCES/cmsfs-1.1.8c.tar.gz
|
||||||
/s390-tools-*-rust-vendor.tar.xz
|
SOURCES/s390-tools-2.29.0-rust-vendor.tar.xz
|
||||||
|
SOURCES/s390-tools-2.29.0.tar.gz
|
||||||
|
SOURCES/src_vipa-2.1.0.tar.gz
|
||||||
|
|||||||
4
.s390utils.metadata
Normal file
4
.s390utils.metadata
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
9c9a4e89bddb2b4e6e09ef6fc7c2e6f2ad6316de SOURCES/cmsfs-1.1.8c.tar.gz
|
||||||
|
1dcae3e55c2d4d945d0b5c61a12671468aa5f7ef SOURCES/s390-tools-2.29.0-rust-vendor.tar.xz
|
||||||
|
e10ffbde7f3fcf4438fdfdd83051ad68518e7be5 SOURCES/s390-tools-2.29.0.tar.gz
|
||||||
|
8ed8592a0a9370ce8422df9231ccb17f6cf49bed SOURCES/src_vipa-2.1.0.tar.gz
|
||||||
9
SOURCES/00-zipl-prepare.install
Executable file
9
SOURCES/00-zipl-prepare.install
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
COMMAND="$1"
|
||||||
|
KERNEL_VERSION="$2"
|
||||||
|
BOOT_DIR_ABS="$3"
|
||||||
|
KERNEL_IMAGE="$4"
|
||||||
|
|
||||||
|
# Remove it, since for zipl the images are always installed in /boot
|
||||||
|
rm -rf "${BOOT_DIR_ABS%/*}"
|
||||||
13
SOURCES/ccw.udev
Normal file
13
SOURCES/ccw.udev
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
ACTION!="add|change", GOTO="ccw_end"
|
||||||
|
SUBSYSTEM!="ccw", GOTO="ccw_end"
|
||||||
|
ATTRS{cutype}=="1731/01", RUN+="ccw_init"
|
||||||
|
ATTRS{cutype}=="1731/02", RUN+="ccw_init"
|
||||||
|
ATTRS{cutype}=="1731/05", RUN+="ccw_init"
|
||||||
|
ATTRS{cutype}=="1731/06", RUN+="ccw_init"
|
||||||
|
ATTRS{cutype}=="3088/01", RUN+="ccw_init"
|
||||||
|
ATTRS{cutype}=="3088/08", RUN+="ccw_init"
|
||||||
|
ATTRS{cutype}=="3088/60", RUN+="ccw_init"
|
||||||
|
ATTRS{cutype}=="3088/61", RUN+="ccw_init"
|
||||||
|
ATTRS{cutype}=="3088/1e", RUN+="ccw_init"
|
||||||
|
ATTRS{cutype}=="3088/1f", RUN+="ccw_init"
|
||||||
|
LABEL="ccw_end"
|
||||||
@ -1,7 +1,6 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
[ -z "$DEVPATH" ] && exit 0
|
[ -z "$DEVPATH" ] && exit 0
|
||||||
[ -z "$DRIVER" ] && exit 0
|
|
||||||
[ "$SUBSYSTEM" != "ccw" ] && exit 0
|
[ "$SUBSYSTEM" != "ccw" ] && exit 0
|
||||||
|
|
||||||
[ -e /etc/ccw.conf ] && MODE="dracut" || MODE="normal"
|
[ -e /etc/ccw.conf ] && MODE="dracut" || MODE="normal"
|
||||||
@ -79,7 +78,6 @@ elif [ $MODE = "normal" ]; then
|
|||||||
NETTYPE=$(sed -nr "/^\[ethernet\]/ { :l /^s390-nettype[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" $CONFIG_FILE)
|
NETTYPE=$(sed -nr "/^\[ethernet\]/ { :l /^s390-nettype[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" $CONFIG_FILE)
|
||||||
SUBCHANNELS=$(sed -nr "/^\[ethernet\]/ { :l /^s390-subchannels[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" $CONFIG_FILE | sed -e "s/;/,/g" -e "s/,$//")
|
SUBCHANNELS=$(sed -nr "/^\[ethernet\]/ { :l /^s390-subchannels[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" $CONFIG_FILE | sed -e "s/;/,/g" -e "s/,$//")
|
||||||
LAYER2=$(sed -nr "/^\[ethernet-s390-options\]/ { :l /^layer2[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" $CONFIG_FILE)
|
LAYER2=$(sed -nr "/^\[ethernet-s390-options\]/ { :l /^layer2[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" $CONFIG_FILE)
|
||||||
PORTNO=$(sed -nr "/^\[ethernet-s390-options\]/ { :l /^portno[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" $CONFIG_FILE)
|
|
||||||
else
|
else
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -117,10 +115,6 @@ if [ "$NETTYPE" = "ctc" -a -n "$CTCPROT" ]; then
|
|||||||
OPTIONS="$OPTIONS protocol=$CTCPROT"
|
OPTIONS="$OPTIONS protocol=$CTCPROT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$PORTNO" ]; then
|
|
||||||
OPTIONS="$OPTIONS portno=$PORTNO"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# SUBCHANNELS is only set on mainframe ccwgroup devices
|
# SUBCHANNELS is only set on mainframe ccwgroup devices
|
||||||
[ -z "$SUBCHANNELS" -o -z "$NETTYPE" ] && exit 0
|
[ -z "$SUBCHANNELS" -o -z "$NETTYPE" ] && exit 0
|
||||||
if [ "$NETTYPE" = "ctc" ]; then
|
if [ "$NETTYPE" = "ctc" ]; then
|
||||||
@ -154,6 +148,8 @@ if [ -e $SYSDIR/online ]; then
|
|||||||
[ "$on" = "1" ] && exit 0
|
[ "$on" = "1" ] && exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
DRIVER=$(readlink $DEVPATH/driver)
|
||||||
|
DRIVER=${DRIVER##*/}
|
||||||
if [ "$DRIVER" = "lcs" -a "$NETTYPE" = "ctc" ]; then
|
if [ "$DRIVER" = "lcs" -a "$NETTYPE" = "ctc" ]; then
|
||||||
echo "$CHANNEL" > /sys/bus/ccw/drivers/lcs/unbind
|
echo "$CHANNEL" > /sys/bus/ccw/drivers/lcs/unbind
|
||||||
echo "$CHANNEL" > /sys/bus/ccw/drivers/ctcm/bind
|
echo "$CHANNEL" > /sys/bus/ccw/drivers/ctcm/bind
|
||||||
12
SOURCES/cmsfs-1.1.8-args.patch
Normal file
12
SOURCES/cmsfs-1.1.8-args.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
diff -up cmsfs-1.1.8c/cmsfslst.c.orig cmsfs-1.1.8c/cmsfslst.c
|
||||||
|
--- cmsfs-1.1.8c/cmsfslst.c.orig 2020-08-19 09:47:36.459063820 +0000
|
||||||
|
+++ cmsfs-1.1.8c/cmsfslst.c 2020-08-19 09:47:45.619063820 +0000
|
||||||
|
@@ -49,7 +49,7 @@ int main(int argc,unsigned char *argv[])
|
||||||
|
}
|
||||||
|
|
||||||
|
/* sanity check */
|
||||||
|
- if (*devname == 0x00)
|
||||||
|
+ if ((devname == NULL) || (*devname == 0x00))
|
||||||
|
{
|
||||||
|
(void) fprintf(stderr,"Please specify a CMS volume.\n");
|
||||||
|
(void) fprintf(stderr,USAGE,argv[0]);
|
||||||
12
SOURCES/cmsfs-1.1.8-kernel26.patch
Normal file
12
SOURCES/cmsfs-1.1.8-kernel26.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
diff -urN cmsfs-1.1.8/cmsfssed.sh cmsfs-1.1.8_/cmsfssed.sh
|
||||||
|
--- cmsfs-1.1.8/cmsfssed.sh 2003-02-28 17:52:59.000000000 -0500
|
||||||
|
+++ cmsfs-1.1.8_/cmsfssed.sh 2004-05-28 16:36:22.000000000 -0400
|
||||||
|
@@ -85,7 +85,7 @@
|
||||||
|
DRIVER_SOURCE="cmsfs22x.c"
|
||||||
|
MODULES_DIRECTORY="/lib/modules/`uname -r`/fs"
|
||||||
|
;;
|
||||||
|
- 2.4*|2.5*)
|
||||||
|
+ 2.4*|2.5*|2.6*|3.*|4.*)
|
||||||
|
LINUX_RELEASE="2.4"
|
||||||
|
# ln -s cmsfs24x.c cmsfsvfs.c
|
||||||
|
INCLUDES="-I/lib/modules/`uname -r`/build/include"
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
From 25442f958a12b428b7d063b927ac48965dcd8164 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
|
||||||
|
Date: Fri, 28 Jan 2011 16:11:19 +0100
|
||||||
|
Subject: [PATCH] use detected filesystem block size on FBA devices
|
||||||
|
|
||||||
|
If a FBA device is not properly formated, then the CMS file system can
|
||||||
|
have a different block size. The cmsfs tools were able to detect the file
|
||||||
|
system block size, but in fact they still used default 512 instead. And
|
||||||
|
using the default was causing crashes. Now the detected value is used.
|
||||||
|
|
||||||
|
https://bugzilla.redhat.com/show_bug.cgi?id=651012
|
||||||
|
---
|
||||||
|
cmsfsany.c | 2 +-
|
||||||
|
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/cmsfsany.c b/cmsfsany.c
|
||||||
|
index 55bcfdc..18efffb 100644
|
||||||
|
--- a/cmsfsany.c
|
||||||
|
+++ b/cmsfsany.c
|
||||||
|
@@ -102,7 +102,7 @@ int cmsfs_find_label(struct CMSSUPER *vol,struct CMSFSADT *adt)
|
||||||
|
cmsfs_error(cmsfs_ermsg);
|
||||||
|
}
|
||||||
|
vol->flags = CMSFSFBA;
|
||||||
|
- vol->blksz = 512;
|
||||||
|
+ vol->blksz = blksz;
|
||||||
|
return vol->blksz;
|
||||||
|
} }
|
||||||
|
|
||||||
|
--
|
||||||
|
1.7.3.5
|
||||||
|
|
||||||
11
SOURCES/cmsfs-1.1.8-warnings.patch
Normal file
11
SOURCES/cmsfs-1.1.8-warnings.patch
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
--- cmsfs-1.1.8/cmsfsvol.c.warnings 2003-07-18 01:38:57.000000000 +0200
|
||||||
|
+++ cmsfs-1.1.8/cmsfsvol.c 2005-09-06 16:57:15.000000000 +0200
|
||||||
|
@@ -52,7 +52,7 @@
|
||||||
|
|
||||||
|
/* print a header; looks like CMS */
|
||||||
|
(void) printf("LABEL VDEV M STAT CYL TYPE \
|
||||||
|
-BLKSZ FILES BLKS USED-(%) BLKS LEFT BLK TOTAL\n");
|
||||||
|
+BLKSZ FILES BLKS USED-(%%) BLKS LEFT BLK TOTAL\n");
|
||||||
|
|
||||||
|
for ( ; i < argc ; i++)
|
||||||
|
{
|
||||||
@ -7,6 +7,7 @@ Before=sysinit.target systemd-udev-trigger.service
|
|||||||
Type=oneshot
|
Type=oneshot
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
ExecStart=/usr/sbin/device_cio_free
|
ExecStart=/usr/sbin/device_cio_free
|
||||||
|
StandardOutput=syslog
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=sysinit.target
|
WantedBy=sysinit.target
|
||||||
6998
SOURCES/s390utils-2.29.0-rhel.patch
Normal file
6998
SOURCES/s390utils-2.29.0-rhel.patch
Normal file
File diff suppressed because it is too large
Load Diff
12
SOURCES/src_vipa-2.1.0-deprecate.patch
Normal file
12
SOURCES/src_vipa-2.1.0-deprecate.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
diff -up s390-tools-2.2.0/src_vipa-2.1.0/Makefile.orig s390-tools-2.2.0/src_vipa-2.1.0/Makefile
|
||||||
|
--- s390-tools-2.2.0/src_vipa-2.1.0/Makefile.orig 2020-02-21 13:51:23.502305796 +0100
|
||||||
|
+++ s390-tools-2.2.0/src_vipa-2.1.0/Makefile 2020-02-21 13:53:51.353817181 +0100
|
||||||
|
@@ -44,6 +44,8 @@ src_vipa.sh:
|
||||||
|
echo '#!/bin/bash' > src_vipa.sh
|
||||||
|
echo 'export LD_LIBRARY_PATH=$(LIBDIR):$$LD_LIBRARY_PATH' >> src_vipa.sh
|
||||||
|
echo 'export LD_PRELOAD=$(LIBDIR)/src_vipa.so' >> src_vipa.sh
|
||||||
|
+ echo 'echo "WARNING: The src_vipa (flexible source address selection) feature is DEPRECATED"' >> src_vipa.sh
|
||||||
|
+ echo 'echo "WARNING: It will be removed in the future."' >> src_vipa.sh
|
||||||
|
echo 'exec $$@' >> src_vipa.sh
|
||||||
|
chmod 755 src_vipa.sh
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
4
ccw.udev
4
ccw.udev
@ -1,4 +0,0 @@
|
|||||||
ACTION!="add|bind|change", GOTO="ccw_end"
|
|
||||||
SUBSYSTEM!="ccw", GOTO="ccw_end"
|
|
||||||
DRIVER=="ctcm|lcs|qeth", RUN+="ccw_init"
|
|
||||||
LABEL="ccw_end"
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
# Copyright IBM Corp. 2023
|
|
||||||
|
|
||||||
# This is just a wrapper to migrate old /etc/dasd.conf to the new
|
|
||||||
# consolidated persistent configuration of s390 devices with chzdev.
|
|
||||||
|
|
||||||
CONFIG=/etc/dasd.conf
|
|
||||||
PATH=/sbin:/bin
|
|
||||||
export PATH
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
chzdev --enable --active --persistent dasd "$@" --yes --no-root-update --force --no-settle
|
|
||||||
case $? in
|
|
||||||
0)
|
|
||||||
# If device exists and could be actively enabled,
|
|
||||||
# chzdev could infer the actual dasd device type; done.
|
|
||||||
continue
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
# Configure persistently only to allow migration of
|
|
||||||
# configuration for devices that currently do not exist.
|
|
||||||
# Chzdev cannot infer the actual dasd device type for an
|
|
||||||
# absent device. Therefore, create duplicate configurations
|
|
||||||
# for both dasd-eckd and dasd-fba, so either one of them
|
|
||||||
# can enable such device when it appears.
|
|
||||||
chzdev --enable --persistent dasd-eckd "$@" --yes --no-root-update --force --no-settle
|
|
||||||
chzdev --enable --persistent dasd-fba "$@" --yes --no-root-update --force --no-settle
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
mv "$CONFIG" "$CONFIG"."$DATE".migrated-to-chzdev
|
|
||||||
echo "dasdconfmigrate.sh: Information: Your persistent dasd 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
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
--- !Policy
|
|
||||||
product_versions:
|
|
||||||
- rhel-9
|
|
||||||
decision_context: osci_compose_gate
|
|
||||||
rules:
|
|
||||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
---
|
|
||||||
pathmigration:
|
|
||||||
excluded_paths:
|
|
||||||
- /lib/s390-tools
|
|
||||||
|
|
||||||
badfuncs:
|
|
||||||
allowed:
|
|
||||||
/usr/sbin/qethqoat:
|
|
||||||
- inet_ntoa
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
diff --git a/scripts/pvics b/scripts/pvics
|
|
||||||
index 18cdbb6b..8fe21a3b 100755
|
|
||||||
--- a/scripts/pvics
|
|
||||||
+++ b/scripts/pvics
|
|
||||||
@@ -1474,12 +1474,6 @@ main() {
|
|
||||||
local -
|
|
||||||
set -Eu
|
|
||||||
|
|
||||||
- # call cleanup on error
|
|
||||||
- # PIPE is needed to allow out=$(main list -i <image> | grep -m 1 <filter>)
|
|
||||||
- # bash will close the subshell executing the main function as soon as grep has found a match
|
|
||||||
- # cleanup will not be executed anymore
|
|
||||||
- trap 'cleanup 1' ERR EXIT PIPE
|
|
||||||
-
|
|
||||||
# general
|
|
||||||
ACTION=""
|
|
||||||
NBD=""
|
|
||||||
@@ -1518,6 +1512,12 @@ main() {
|
|
||||||
# parse command line
|
|
||||||
cli "$@"
|
|
||||||
|
|
||||||
+ # call cleanup on error
|
|
||||||
+ # PIPE is needed to allow out=$(main list -i <image> | grep -m 1 <filter>)
|
|
||||||
+ # bash will close the subshell executing the main function as soon as grep has found a match
|
|
||||||
+ # cleanup will not be executed anymore
|
|
||||||
+ trap 'cleanup 1' ERR EXIT PIPE
|
|
||||||
+
|
|
||||||
# set up logger
|
|
||||||
setup_logger
|
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
2
sources
2
sources
@ -1,2 +0,0 @@
|
|||||||
SHA512 (s390-tools-2.44.0.tar.gz) = 6f2f7fa45573b1a2515c4ea143ff0877711713724c737f9aaa4f853f6142f215628c10d1827f94cf54a50c1fec757fd3710f3e4b60f6125b0ee952002e43dbf7
|
|
||||||
SHA512 (s390-tools-2.44.0-rust-vendor.tar.xz) = 7c0708a6593d9a2ff307e9e46c63f191532170db43f7f5e4f68c64673dbb7f1dae5663f60236d54b0c67d9bbc3b523aedcdf8747377e63f82f3767586fa3e8c4
|
|
||||||
@ -1,47 +0,0 @@
|
|||||||
#!/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
|
|
||||||
@ -1,103 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
# Largely based on the old ccw_init script.
|
|
||||||
|
|
||||||
# This is just a wrapper to migrate old s390 channel-attached network
|
|
||||||
# device config to the new consolidated persistent configuration with
|
|
||||||
# chzdev.
|
|
||||||
|
|
||||||
DATE=$(date --iso-8601=seconds)
|
|
||||||
|
|
||||||
# borrowed from network-scrips, initscripts along with the get_config_by_subchannel
|
|
||||||
[ -z "$__sed_discard_ignored_files" ] && __sed_discard_ignored_files='/\(~\|\.bak\|\.old\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d'
|
|
||||||
|
|
||||||
get_configs ()
|
|
||||||
{
|
|
||||||
LANG=C grep -E -i -l \
|
|
||||||
"^[[:space:]]*SUBCHANNELS=['\"]?([0-9]\.[0-9]\.[a-f0-9]+)(,[0-9]\.[0-9]\.[a-f0-9]+){1,2}['\"]?([[:space:]]+#|[[:space:]]*$)" \
|
|
||||||
/etc/sysconfig/network-scripts/ifcfg-* \
|
|
||||||
| LC_ALL=C sed -e "$__sed_discard_ignored_files"
|
|
||||||
}
|
|
||||||
|
|
||||||
get_configs_nm ()
|
|
||||||
{
|
|
||||||
LANG=C grep -E -i -l \
|
|
||||||
"^s390-subchannels=([0-9]\.[0-9]\.[a-f0-9]+;){2,3}$" \
|
|
||||||
/etc/NetworkManager/system-connections/*.nmconnection \
|
|
||||||
| LC_ALL=C sed -e "$__sed_discard_ignored_files"
|
|
||||||
}
|
|
||||||
|
|
||||||
migrate ()
|
|
||||||
{
|
|
||||||
# translate variables from the interface config files to OPTIONS
|
|
||||||
if [ -n "$PORTNAME" ]; then
|
|
||||||
if [ "$NETTYPE" = "lcs" ]; then
|
|
||||||
OPTIONS="$OPTIONS portno=$PORTNAME"
|
|
||||||
else
|
|
||||||
OPTIONS="$OPTIONS portname=$PORTNAME"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if [ "$NETTYPE" = "ctc" -a -n "$CTCPROT" ]; then
|
|
||||||
OPTIONS="$OPTIONS protocol=$CTCPROT"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# SUBCHANNELS is only set on mainframe ccwgroup devices
|
|
||||||
[ -z "$SUBCHANNELS" -o -z "$NETTYPE" ] && return
|
|
||||||
|
|
||||||
SUBCHANNELS=$(echo "$SUBCHANNELS" | tr ',' ':')
|
|
||||||
|
|
||||||
# shellcheck disable=SC2086
|
|
||||||
chzdev --enable --persistent "$NETTYPE" "$SUBCHANNELS" $OPTIONS --yes --no-root-update --force --no-settle
|
|
||||||
|
|
||||||
# Leave all s390-specifics in original $CONFIG_FILE because NetworkManager
|
|
||||||
# does something with NETTYPE, PORTNAME, CTCPROT, OPTIONS.
|
|
||||||
# Definitively Leave SUBCHANNELS as it might serve as interface identifier key,
|
|
||||||
# which is not HWADDR.
|
|
||||||
|
|
||||||
echo "znetconfmigrate.sh: Information: Your low-level persistent s390 network device configuration $CONFIG_FILE 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"
|
|
||||||
|
|
||||||
# re-initialize global variables before next possible iteration loop
|
|
||||||
NETTYPE=""
|
|
||||||
SUBCHANNELS=""
|
|
||||||
OPTIONS=""
|
|
||||||
PORTNAME=""
|
|
||||||
CTCPROT=""
|
|
||||||
}
|
|
||||||
|
|
||||||
NOLOCALE="yes"
|
|
||||||
|
|
||||||
CONFIG_FILES=$(get_configs)
|
|
||||||
if [ -n "$CONFIG_FILES" ]; then
|
|
||||||
for CONFIG_FILE in $CONFIG_FILES; do
|
|
||||||
PREFIX="znet.${CONFIG_FILE##*/}.${DATE}.migrated-to-chzdev"
|
|
||||||
# show migration output to users and log it into file
|
|
||||||
exec > >(tee "$PREFIX.log") 2>&1
|
|
||||||
. "$CONFIG_FILE"
|
|
||||||
migrate
|
|
||||||
done
|
|
||||||
else
|
|
||||||
CONFIG_FILES=$(get_configs_nm)
|
|
||||||
for CONFIG_FILE in $CONFIG_FILES; do
|
|
||||||
PREFIX="znet.${CONFIG_FILE##*/}.${DATE}.migrated-to-chzdev"
|
|
||||||
# show migration output to users and log it into file
|
|
||||||
exec > >(tee "$PREFIX.log") 2>&1
|
|
||||||
NETTYPE=$(sed -nr "/^\[ethernet\]/ { :l /^s390-nettype[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" "$CONFIG_FILE")
|
|
||||||
SUBCHANNELS=$(sed -nr "/^\[ethernet\]/ { :l /^s390-subchannels[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" "$CONFIG_FILE" | sed -e "s/;/,/g" -e "s/,$//")
|
|
||||||
OPTIONS=$(sed -nr "
|
|
||||||
/^\[ethernet-s390-options\]/ {
|
|
||||||
n # skip matched line with beginning of section
|
|
||||||
:l # set label
|
|
||||||
/^[^#].*=.*/ { # match non-comment key value line
|
|
||||||
p # print
|
|
||||||
}
|
|
||||||
/^[ ]*\[/ { # match beginning of next section
|
|
||||||
q # quit
|
|
||||||
}
|
|
||||||
n # next
|
|
||||||
b l # branch to label
|
|
||||||
}
|
|
||||||
" "$CONFIG_FILE")
|
|
||||||
migrate
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
Loading…
Reference in New Issue
Block a user