Compare commits
No commits in common. "c8" and "c10s" have entirely different histories.
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
|||||||
|
1
|
||||||
13
.gitignore
vendored
13
.gitignore
vendored
@ -1,4 +1,9 @@
|
|||||||
SOURCES/cmsfs-1.1.8c.tar.gz
|
s390-tools-1.8.2.tar.bz2
|
||||||
SOURCES/s390-tools-2.29.0-rust-vendor.tar.xz
|
cmsfs-1.1.8c.tar.gz
|
||||||
SOURCES/s390-tools-2.29.0.tar.gz
|
lib-zfcp-hbaapi-2.0.tar.gz
|
||||||
SOURCES/src_vipa-2.1.0.tar.gz
|
src_vipa-2.0.4.tar.gz
|
||||||
|
/lib-zfcp-hbaapi-2.1.tar.gz
|
||||||
|
/src_vipa-2.1.0.tar.gz
|
||||||
|
/s390-tools-*.tar.bz2
|
||||||
|
/s390-tools-*.tar.gz
|
||||||
|
/s390-tools-*-rust-vendor.tar.xz
|
||||||
|
|||||||
@ -1,4 +0,0 @@
|
|||||||
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
|
|
||||||
@ -54,21 +54,25 @@ EOF
|
|||||||
case "$COMMAND" in
|
case "$COMMAND" in
|
||||||
add)
|
add)
|
||||||
if [[ "${KERNEL_DIR}" != "/boot" ]]; then
|
if [[ "${KERNEL_DIR}" != "/boot" ]]; then
|
||||||
|
# rename to match the name used in the pseudo-BLS snippet above
|
||||||
|
cp --remove-destination --preserve=timestamps -T "${KERNEL_IMAGE}" "/boot/vmlinuz-${KERNEL_VERSION}"
|
||||||
|
command -v restorecon &>/dev/null && \
|
||||||
|
restorecon -R "/boot/vmlinuz-${KERNEL_VERSION}"
|
||||||
|
|
||||||
for i in \
|
for i in \
|
||||||
"$KERNEL_IMAGE" \
|
|
||||||
"$KERNEL_DIR"/System.map \
|
"$KERNEL_DIR"/System.map \
|
||||||
"$KERNEL_DIR"/config \
|
"$KERNEL_DIR"/config \
|
||||||
"$KERNEL_DIR"/zImage.stub
|
"$KERNEL_DIR"/zImage.stub
|
||||||
do
|
do
|
||||||
[[ -e "$i" ]] || continue
|
[[ -e "$i" ]] || continue
|
||||||
cp -aT "$i" "/boot/${i##*/}-${KERNEL_VERSION}"
|
cp --preserve=timestamps -T "$i" "/boot/${i##*/}-${KERNEL_VERSION}"
|
||||||
command -v restorecon &>/dev/null && \
|
command -v restorecon &>/dev/null && \
|
||||||
restorecon -R "/boot/${i##*/}-${KERNEL_VERSION}"
|
restorecon -R "/boot/${i##*/}-${KERNEL_VERSION}"
|
||||||
done
|
done
|
||||||
# hmac is .vmlinuz-<version>.hmac so needs a special treatment
|
# hmac is .vmlinuz-<version>.hmac so needs a special treatment
|
||||||
i="$KERNEL_DIR/.${KERNEL_IMAGE##*/}.hmac"
|
i="$KERNEL_DIR/.${KERNEL_IMAGE##*/}.hmac"
|
||||||
if [[ -e "$i" ]]; then
|
if [[ -e "$i" ]]; then
|
||||||
cp -a "$i" "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac"
|
cp --preserve=timestamps "$i" "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac"
|
||||||
command -v restorecon &>/dev/null && \
|
command -v restorecon &>/dev/null && \
|
||||||
restorecon "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac"
|
restorecon "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac"
|
||||||
fi
|
fi
|
||||||
@ -88,16 +92,10 @@ case "$COMMAND" in
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
|
|
||||||
echo "Could not determine the kernel command line parameters." >&2
|
|
||||||
echo "Please specify the kernel command line in /etc/kernel/cmdline!" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
[[ -d "$BLS_DIR" ]] || mkdir -m 0700 -p "$BLS_DIR"
|
[[ -d "$BLS_DIR" ]] || mkdir -m 0700 -p "$BLS_DIR"
|
||||||
BLS_TARGET="${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf"
|
BLS_TARGET="${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf"
|
||||||
if [[ -f "${KERNEL_DIR}/bls.conf" ]]; then
|
if [[ -f "${KERNEL_DIR}/bls.conf" ]]; then
|
||||||
cp -aT "${KERNEL_DIR}/bls.conf" "${BLS_TARGET}" || exit $?
|
cp --preserve=timestamps -T "${KERNEL_DIR}/bls.conf" "${BLS_TARGET}" || exit $?
|
||||||
sed -i -e "s,^linux.*,linux /boot/vmlinuz-${KERNEL_VERSION},g" "${BLS_TARGET}"
|
sed -i -e "s,^linux.*,linux /boot/vmlinuz-${KERNEL_VERSION},g" "${BLS_TARGET}"
|
||||||
sed -i -e "s,^initrd.*,initrd /boot/initramfs-${KERNEL_VERSION}.img,g" "${BLS_TARGET}"
|
sed -i -e "s,^initrd.*,initrd /boot/initramfs-${KERNEL_VERSION}.img,g" "${BLS_TARGET}"
|
||||||
sed -i -e "s#^options.*#options ${BOOT_OPTIONS[*]}#g" "${BLS_TARGET}"
|
sed -i -e "s#^options.*#options ${BOOT_OPTIONS[*]}#g" "${BLS_TARGET}"
|
||||||
@ -118,7 +116,7 @@ case "$COMMAND" in
|
|||||||
|
|
||||||
if [ "x${MAKEDEBUG}" = "xyes" ]; then
|
if [ "x${MAKEDEBUG}" = "xyes" ]; then
|
||||||
BLS_DEBUG="$(echo ${BLS_TARGET} | sed -e "s/${KERNEL_VERSION}/${KERNEL_VERSION}~debug/")"
|
BLS_DEBUG="$(echo ${BLS_TARGET} | sed -e "s/${KERNEL_VERSION}/${KERNEL_VERSION}~debug/")"
|
||||||
cp -aT "${BLS_TARGET}" "${BLS_DEBUG}"
|
cp --preserve=timestamps -T "${BLS_TARGET}" "${BLS_DEBUG}"
|
||||||
TITLE="$(grep '^title[ \t]' "${BLS_DEBUG}" | sed -e 's/^title[ \t]*//')"
|
TITLE="$(grep '^title[ \t]' "${BLS_DEBUG}" | sed -e 's/^title[ \t]*//')"
|
||||||
VERSION="$(grep '^version[ \t]' "${BLS_DEBUG}" | sed -e 's/^version[ \t]*//')"
|
VERSION="$(grep '^version[ \t]' "${BLS_DEBUG}" | sed -e 's/^version[ \t]*//')"
|
||||||
BLSID="$(grep '^id[ \t]' "${BLS_DEBUG}" | sed -e "s/${KERNEL_VERSION}/${KERNEL_VERSION}~debug/")"
|
BLSID="$(grep '^id[ \t]' "${BLS_DEBUG}" | sed -e "s/${KERNEL_VERSION}/${KERNEL_VERSION}~debug/")"
|
||||||
@ -29,12 +29,6 @@ case "$COMMAND" in
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
|
|
||||||
echo "Could not determine the kernel command line parameters." >&2
|
|
||||||
echo "Please specify the kernel command line in /etc/kernel/cmdline!" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
BLS_RESCUE="${BLS_DIR}/${MACHINE_ID}-0-rescue.conf"
|
BLS_RESCUE="${BLS_DIR}/${MACHINE_ID}-0-rescue.conf"
|
||||||
if [[ -f "${BLS_RESCUE}" ]] && grep -q '^options.*$kernelopts' "${BLS_RESCUE}"; then
|
if [[ -f "${BLS_RESCUE}" ]] && grep -q '^options.*$kernelopts' "${BLS_RESCUE}"; then
|
||||||
sed -i -e "s,^linux.*,linux /boot/vmlinuz-0-rescue-${MACHINE_ID},g" "${BLS_RESCUE}"
|
sed -i -e "s,^linux.*,linux /boot/vmlinuz-0-rescue-${MACHINE_ID},g" "${BLS_RESCUE}"
|
||||||
@ -1,9 +0,0 @@
|
|||||||
#!/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%/*}"
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
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,12 +0,0 @@
|
|||||||
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]);
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
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"
|
|
||||||
@ -1,31 +0,0 @@
|
|||||||
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
|
|
||||||
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
--- 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++)
|
|
||||||
{
|
|
||||||
File diff suppressed because it is too large
Load Diff
@ -1,12 +0,0 @@
|
|||||||
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
|
|
||||||
|
|
||||||
4
ccw.udev
Normal file
4
ccw.udev
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
ACTION!="add|bind|change", GOTO="ccw_end"
|
||||||
|
SUBSYSTEM!="ccw", GOTO="ccw_end"
|
||||||
|
DRIVER=="ctcm|lcs|qeth", RUN+="ccw_init"
|
||||||
|
LABEL="ccw_end"
|
||||||
@ -1,6 +1,7 @@
|
|||||||
#! /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"
|
||||||
@ -78,6 +79,7 @@ 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
|
||||||
@ -115,6 +117,10 @@ 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
|
||||||
@ -148,8 +154,6 @@ 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
|
||||||
48
dasdconfmigrate.sh
Normal file
48
dasdconfmigrate.sh
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
#!/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
|
||||||
@ -7,7 +7,6 @@ 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
|
||||||
6
gating.yaml
Normal file
6
gating.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
--- !Policy
|
||||||
|
product_versions:
|
||||||
|
- rhel-10
|
||||||
|
decision_context: osci_compose_gate
|
||||||
|
rules:
|
||||||
|
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.beaker-tier1.functional}
|
||||||
14
plans/function.fmf
Normal file
14
plans/function.fmf
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
summary: Run s390utils function tests
|
||||||
|
|
||||||
|
discover:
|
||||||
|
how: fmf
|
||||||
|
test:
|
||||||
|
- "^/tests/zdev-migration"
|
||||||
|
|
||||||
|
execute:
|
||||||
|
how: tmt
|
||||||
|
|
||||||
|
adjust:
|
||||||
|
- when: arch != s390x
|
||||||
|
enabled: false
|
||||||
|
because: The s390utils package here is for the s390x platform only.
|
||||||
14
plans/gating-multiarch.fmf
Normal file
14
plans/gating-multiarch.fmf
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
summary: Run s390utils multiarch gating tests
|
||||||
|
|
||||||
|
discover:
|
||||||
|
how: fmf
|
||||||
|
test:
|
||||||
|
- "^/tests/sanity-multiarch"
|
||||||
|
|
||||||
|
execute:
|
||||||
|
how: tmt
|
||||||
|
|
||||||
|
adjust:
|
||||||
|
- when: arch = s390x
|
||||||
|
enabled: false
|
||||||
|
because: The s390utils package here is for non-s390x platforms only.
|
||||||
14
plans/gating.fmf
Normal file
14
plans/gating.fmf
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
summary: Run s390utils gating tests
|
||||||
|
|
||||||
|
discover:
|
||||||
|
how: fmf
|
||||||
|
test:
|
||||||
|
- "^/tests/sanity"
|
||||||
|
|
||||||
|
execute:
|
||||||
|
how: tmt
|
||||||
|
|
||||||
|
adjust:
|
||||||
|
- when: arch != s390x
|
||||||
|
enabled: false
|
||||||
|
because: The s390utils package here is for the s390x platform only.
|
||||||
0
plans/main.fmf
Normal file
0
plans/main.fmf
Normal file
17
plans/regression.fmf
Normal file
17
plans/regression.fmf
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
summary: Run s390utils regression tests
|
||||||
|
|
||||||
|
discover:
|
||||||
|
how: fmf
|
||||||
|
test:
|
||||||
|
- "^/tests/zipl-empty-param"
|
||||||
|
- "^/tests/zipl-long-param"
|
||||||
|
- "^/tests/zipl-sync"
|
||||||
|
- "^/tests/zkey-initrd"
|
||||||
|
|
||||||
|
execute:
|
||||||
|
how: tmt
|
||||||
|
|
||||||
|
adjust:
|
||||||
|
- when: arch != s390x
|
||||||
|
enabled: false
|
||||||
|
because: The s390utils package here is for the s390x platform only.
|
||||||
9
rpminspect.yaml
Normal file
9
rpminspect.yaml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
pathmigration:
|
||||||
|
excluded_paths:
|
||||||
|
- /lib/s390-tools
|
||||||
|
|
||||||
|
badfuncs:
|
||||||
|
allowed:
|
||||||
|
/usr/sbin/qethqoat:
|
||||||
|
- inet_ntoa
|
||||||
0
s390utils-2.40.0-rhel.patch
Normal file
0
s390utils-2.40.0-rhel.patch
Normal file
1733
s390utils-tape-revert.patch
Normal file
1733
s390utils-tape-revert.patch
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
2
sources
Normal file
2
sources
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
SHA512 (s390-tools-2.42.1.tar.gz) = 719b000ffc507837f579db8c395cd929151c77e36c598e872cef7cd76b6612f7cd5f8eba87de1df69a446a05ba3a6daa385a4bca2dfdb5b2b52e70cb5a7a197b
|
||||||
|
SHA512 (s390-tools-2.42.1-rust-vendor.tar.xz) = 7fbae9b43d956e2a9b71b6a0a0928fca9506a191424d63f6df109ddc0ce4efa9df2d0e245ee231602a139642fe7fc25f13680eec27a4aa914be151a39876b945
|
||||||
16
tests/sanity-multiarch/main.fmf
Normal file
16
tests/sanity-multiarch/main.fmf
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
summary: sanity-multiarch
|
||||||
|
description: |
|
||||||
|
Basic test for multiarch s390utils
|
||||||
|
contact: Daniel Horak <dhorak@redhat.com>
|
||||||
|
component:
|
||||||
|
- s390utils
|
||||||
|
test: ./runtest.sh
|
||||||
|
framework: beakerlib
|
||||||
|
require:
|
||||||
|
- s390utils
|
||||||
|
duration: 5m
|
||||||
|
enabled: true
|
||||||
|
adjust:
|
||||||
|
- when: arch = s390x
|
||||||
|
enabled: false
|
||||||
|
because: This test applies to the multiarch tools.
|
||||||
60
tests/sanity-multiarch/runtest.sh
Executable file
60
tests/sanity-multiarch/runtest.sh
Executable file
@ -0,0 +1,60 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
#
|
||||||
|
# runtest.sh of /CoreOS/s390utils/Sanity/smoke-functionality
|
||||||
|
# Description: Smoke, Sanity and function tests
|
||||||
|
# Author: Dan Horák <sharkcz@redhat.com>
|
||||||
|
#
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
#
|
||||||
|
# Copyright (c) 2025 Red Hat, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundation, either version 2 of
|
||||||
|
# the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be
|
||||||
|
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||||
|
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||||
|
# PURPOSE. See the GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||||
|
#
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
# Include Beaker environment
|
||||||
|
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||||
|
|
||||||
|
PACKAGE="s390utils"
|
||||||
|
|
||||||
|
rlJournalStart
|
||||||
|
rlPhaseStartSetup
|
||||||
|
rlAssertRpm $PACKAGE
|
||||||
|
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||||
|
rlRun "pushd $TmpDir"
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest "General tests"
|
||||||
|
rlRun "genprotimg --version"
|
||||||
|
rlRun "pvattest --version"
|
||||||
|
rlRun "pvimg --version"
|
||||||
|
rlRun "pvsecret --version"
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest "s390utils 2.40.0+ - RHEL 9.8+ and RHEL 10.2+"
|
||||||
|
rlRun "pvverify --version"
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest "s390utils 2.42.0+ - RHEL 9.9+ and RHEL 10.3+"
|
||||||
|
rlRun "pvebc --version"
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartCleanup
|
||||||
|
rlRun "popd"
|
||||||
|
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||||
|
rlPhaseEnd
|
||||||
|
rlJournalPrintText
|
||||||
|
rlJournalEnd
|
||||||
138
tests/sanity/extract-module-sig.pl
Executable file
138
tests/sanity/extract-module-sig.pl
Executable file
@ -0,0 +1,138 @@
|
|||||||
|
#!/usr/bin/env perl
|
||||||
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
|
#
|
||||||
|
# extract-mod-sig <part> <module-file>
|
||||||
|
#
|
||||||
|
# Reads the module file and writes out some or all of the signature
|
||||||
|
# section to stdout. Part is the bit to be written and is one of:
|
||||||
|
#
|
||||||
|
# -0: The unsigned module, no signature data at all
|
||||||
|
# -a: All of the signature data, including magic number
|
||||||
|
# -d: Just the descriptor values as a sequence of numbers
|
||||||
|
# -n: Just the signer's name
|
||||||
|
# -k: Just the key ID
|
||||||
|
# -s: Just the crypto signature or PKCS#7 message
|
||||||
|
#
|
||||||
|
use warnings;
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
die "Format: $0 -[0adnks] module-file >out\n"
|
||||||
|
if ($#ARGV != 1);
|
||||||
|
|
||||||
|
my $part = $ARGV[0];
|
||||||
|
my $modfile = $ARGV[1];
|
||||||
|
|
||||||
|
my $magic_number = "~Module signature appended~\n";
|
||||||
|
|
||||||
|
#
|
||||||
|
# Read the module contents
|
||||||
|
#
|
||||||
|
open FD, "<$modfile" || die $modfile;
|
||||||
|
binmode(FD);
|
||||||
|
my @st = stat(FD);
|
||||||
|
die "$modfile" unless (@st);
|
||||||
|
my $buf = "";
|
||||||
|
my $len = sysread(FD, $buf, $st[7]);
|
||||||
|
die "$modfile" unless (defined($len));
|
||||||
|
die "Short read on $modfile\n" unless ($len == $st[7]);
|
||||||
|
close(FD) || die $modfile;
|
||||||
|
|
||||||
|
print STDERR "Read ", $len, " bytes from module file\n";
|
||||||
|
|
||||||
|
die "The file is too short to have a sig magic number and descriptor\n"
|
||||||
|
if ($len < 12 + length($magic_number));
|
||||||
|
|
||||||
|
#
|
||||||
|
# Check for the magic number and extract the information block
|
||||||
|
#
|
||||||
|
my $p = $len - length($magic_number);
|
||||||
|
my $raw_magic = substr($buf, $p);
|
||||||
|
|
||||||
|
die "Magic number not found at $len\n"
|
||||||
|
if ($raw_magic ne $magic_number);
|
||||||
|
print STDERR "Found magic number at $len\n";
|
||||||
|
|
||||||
|
$p -= 12;
|
||||||
|
my $raw_info = substr($buf, $p, 12);
|
||||||
|
|
||||||
|
my @info = unpack("CCCCCxxxN", $raw_info);
|
||||||
|
my ($algo, $hash, $id_type, $name_len, $kid_len, $sig_len) = @info;
|
||||||
|
|
||||||
|
if ($id_type == 0) {
|
||||||
|
print STDERR "Found PGP key identifier\n";
|
||||||
|
} elsif ($id_type == 1) {
|
||||||
|
print STDERR "Found X.509 cert identifier\n";
|
||||||
|
} elsif ($id_type == 2) {
|
||||||
|
print STDERR "Found PKCS#7/CMS encapsulation\n";
|
||||||
|
} else {
|
||||||
|
print STDERR "Found unsupported identifier type $id_type\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Extract the three pieces of info data
|
||||||
|
#
|
||||||
|
die "Insufficient name+kid+sig data in file\n"
|
||||||
|
unless ($p >= $name_len + $kid_len + $sig_len);
|
||||||
|
|
||||||
|
$p -= $sig_len;
|
||||||
|
my $raw_sig = substr($buf, $p, $sig_len);
|
||||||
|
$p -= $kid_len;
|
||||||
|
my $raw_kid = substr($buf, $p, $kid_len);
|
||||||
|
$p -= $name_len;
|
||||||
|
my $raw_name = substr($buf, $p, $name_len);
|
||||||
|
|
||||||
|
my $module_len = $p;
|
||||||
|
|
||||||
|
if ($sig_len > 0) {
|
||||||
|
print STDERR "Found $sig_len bytes of signature [";
|
||||||
|
my $n = $sig_len > 16 ? 16 : $sig_len;
|
||||||
|
foreach my $i (unpack("C" x $n, substr($raw_sig, 0, $n))) {
|
||||||
|
printf STDERR "%02x", $i;
|
||||||
|
}
|
||||||
|
print STDERR "]\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($kid_len > 0) {
|
||||||
|
print STDERR "Found $kid_len bytes of key identifier [";
|
||||||
|
my $n = $kid_len > 16 ? 16 : $kid_len;
|
||||||
|
foreach my $i (unpack("C" x $n, substr($raw_kid, 0, $n))) {
|
||||||
|
printf STDERR "%02x", $i;
|
||||||
|
}
|
||||||
|
print STDERR "]\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($name_len > 0) {
|
||||||
|
print STDERR "Found $name_len bytes of signer's name [$raw_name]\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Produce the requested output
|
||||||
|
#
|
||||||
|
if ($part eq "-0") {
|
||||||
|
# The unsigned module, no signature data at all
|
||||||
|
binmode(STDOUT);
|
||||||
|
print substr($buf, 0, $module_len);
|
||||||
|
} elsif ($part eq "-a") {
|
||||||
|
# All of the signature data, including magic number
|
||||||
|
binmode(STDOUT);
|
||||||
|
print substr($buf, $module_len);
|
||||||
|
} elsif ($part eq "-d") {
|
||||||
|
# Just the descriptor values as a sequence of numbers
|
||||||
|
print join(" ", @info), "\n";
|
||||||
|
} elsif ($part eq "-n") {
|
||||||
|
# Just the signer's name
|
||||||
|
print STDERR "No signer's name for PKCS#7 message type sig\n"
|
||||||
|
if ($id_type == 2);
|
||||||
|
binmode(STDOUT);
|
||||||
|
print $raw_name;
|
||||||
|
} elsif ($part eq "-k") {
|
||||||
|
# Just the key identifier
|
||||||
|
print STDERR "No key ID for PKCS#7 message type sig\n"
|
||||||
|
if ($id_type == 2);
|
||||||
|
binmode(STDOUT);
|
||||||
|
print $raw_kid;
|
||||||
|
} elsif ($part eq "-s") {
|
||||||
|
# Just the crypto signature or PKCS#7 message
|
||||||
|
binmode(STDOUT);
|
||||||
|
print $raw_sig;
|
||||||
|
}
|
||||||
16
tests/sanity/main.fmf
Normal file
16
tests/sanity/main.fmf
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
summary: sanity
|
||||||
|
description: |
|
||||||
|
Basic test for s390utils
|
||||||
|
contact: Daniel Horak <dhorak@redhat.com>
|
||||||
|
component:
|
||||||
|
- s390utils
|
||||||
|
test: ./runtest.sh
|
||||||
|
framework: beakerlib
|
||||||
|
require:
|
||||||
|
- s390utils-base
|
||||||
|
duration: 5m
|
||||||
|
enabled: true
|
||||||
|
adjust:
|
||||||
|
- when: arch != s390x
|
||||||
|
enabled: false
|
||||||
|
because: This this package is s390x only
|
||||||
189
tests/sanity/runtest.sh
Executable file
189
tests/sanity/runtest.sh
Executable file
@ -0,0 +1,189 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
#
|
||||||
|
# runtest.sh of /CoreOS/s390utils/Sanity/smoke-functionality
|
||||||
|
# Description: Smoke, Sanity and function tests
|
||||||
|
# Author: Dan Horák <sharkcz@redhat.com>
|
||||||
|
#
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
#
|
||||||
|
# Copyright (c) 2019 Red Hat, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundation, either version 2 of
|
||||||
|
# the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be
|
||||||
|
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||||
|
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||||
|
# PURPOSE. See the GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||||
|
#
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
# Include Beaker environment
|
||||||
|
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||||
|
|
||||||
|
PACKAGE="s390utils-base"
|
||||||
|
|
||||||
|
EXTRACT="$PWD/extract-module-sig.pl"
|
||||||
|
STAGE3="/usr/lib/s390-tools/stage3.bin"
|
||||||
|
|
||||||
|
rlJournalStart
|
||||||
|
rlPhaseStartSetup
|
||||||
|
rlAssertRpm $PACKAGE
|
||||||
|
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||||
|
rlRun "pushd $TmpDir"
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest "General tests"
|
||||||
|
rlRun "chccwdev --version"
|
||||||
|
rlRun "chchp --version"
|
||||||
|
rlRun "chcpumf --version"
|
||||||
|
rlRun "chreipl --version"
|
||||||
|
rlRun "chshut --version"
|
||||||
|
rlRun "chzcrypt --version"
|
||||||
|
rlRun "chzdev --version"
|
||||||
|
rlRun "cio_ignore --version"
|
||||||
|
rlRun "dasdfmt --version"
|
||||||
|
rlRun "dasdinfo --version"
|
||||||
|
rlRun "dasdstat --version"
|
||||||
|
rlRun "dasdview --version"
|
||||||
|
rlRun "fdasd --version"
|
||||||
|
rlRun "hyptop --version"
|
||||||
|
rlRun "lschp --version"
|
||||||
|
rlRun "lscpumf --version"
|
||||||
|
rlRun "lscss --version"
|
||||||
|
rlRun "lsdasd --version"
|
||||||
|
rlRun "lsqeth --version"
|
||||||
|
rlRun "lsluns --version"
|
||||||
|
rlRun "lsreipl --version"
|
||||||
|
rlRun "lsscm --version"
|
||||||
|
rlRun "lsshut --version"
|
||||||
|
rlRun "lstape --version"
|
||||||
|
rlRun "lszcrypt --version"
|
||||||
|
rlRun "lszdev --version"
|
||||||
|
rlRun "lszfcp --version"
|
||||||
|
rlRun "mk-s390image -v"
|
||||||
|
rlRun "qetharp --version"
|
||||||
|
rlRun "qethconf --version"
|
||||||
|
rlRun "qethqoat --version"
|
||||||
|
rlRun "tape390_crypt --version"
|
||||||
|
rlRun "tape390_display --version"
|
||||||
|
rlRun "ttyrun --version"
|
||||||
|
rlRun "tunedasd --version"
|
||||||
|
rlRun "vmcp --version"
|
||||||
|
rlRun "vmur --version"
|
||||||
|
rlRun "zcryptctl --version"
|
||||||
|
rlRun "zcryptstats --version"
|
||||||
|
rlRun "zfcpdbf --version"
|
||||||
|
rlRun "zgetdump --version"
|
||||||
|
rlRun "zipl --version"
|
||||||
|
rlRun "znetconf --version"
|
||||||
|
rlRun "zpcictl --version"
|
||||||
|
rlRun "zkey --version"
|
||||||
|
rlRun "zkey-cryptsetup --version"
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest "s390utils 2.15.1+ - RHEL 8.4+ and RHEL 9"
|
||||||
|
rlRun "hsci --version"
|
||||||
|
rlRun "lsstp --version"
|
||||||
|
|
||||||
|
# check for perl-free s390utils-core
|
||||||
|
rlRun "rpm -q --requires s390utils-core | grep -q perl" 1 "Checking Perl deps in s390utils-core"
|
||||||
|
|
||||||
|
# check kernel installation, must not create /boot/<machineid>
|
||||||
|
if [ $UID -eq 0 ]; then
|
||||||
|
if rlCheckRpm kernel-core; then
|
||||||
|
rlLog "Apply machine-id workaround if running from a cloud image"
|
||||||
|
pushd /boot/loader/entries/
|
||||||
|
if [ -f ffffffffffffffffffffffffffffffff-$(uname -r).conf ]; then
|
||||||
|
mv ffffffffffffffffffffffffffffffff-$(uname -r).conf $(cat /etc/machine-id)-$(uname -r).conf
|
||||||
|
rlCheckRpm dracut-config-rescue || dnf install -y dracut-config-rescue
|
||||||
|
kernel-install add "$(uname -r)" "/lib/modules/$(uname -r)/vmlinuz"
|
||||||
|
fi
|
||||||
|
popd
|
||||||
|
rlRun "dnf -y reinstall kernel-core" 0 "Reinstalling the kernel to verify BLS scripts function"
|
||||||
|
rlAssertNotExists /boot/`cat /etc/machine-id`
|
||||||
|
else
|
||||||
|
rlLog "Skipping kernel reinstallation / BLS test, kernel-core not installed, probably running in a container"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
rlLog "Skipping kernel reinstallation / BLS test, needs root permissions"
|
||||||
|
fi
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest "s390utils 2.16.0+ - RHEL 8.5+ and RHEL 9"
|
||||||
|
rlRun "lshwc --version"
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest "s390utils 2.19.0+ - RHEL 8.6+ and RHEL 9"
|
||||||
|
rlRun "hsavmcore --version"
|
||||||
|
rlRun "sclpdbf --version"
|
||||||
|
rlRun "zipl-editenv --version"
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest "s390utils 2.22.0+ - RHEL 8.7+ and RHEL 9.1+"
|
||||||
|
rlRun "pai --version"
|
||||||
|
rlRun "pvattest --version"
|
||||||
|
rlRun "pvextract-hdr -h"
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest "s390utils 2.25.0+ - RHEL 8.8+ and RHEL 9.2+"
|
||||||
|
# no new tools
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest "s390utils 2.27.0+ - RHEL 8.9+ and RHEL 9.3+"
|
||||||
|
# no new tools
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest "s390utils 2.29.0+ - RHEL 8.10+ and RHEL 9.4+"
|
||||||
|
rlRun "pvsecret --version"
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest "s390utils 2.33.1+ - RHEL 9.5+ and RHEL 10"
|
||||||
|
rlRun "chpstat --version"
|
||||||
|
rlRun "lspai --version"
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest "s390utils 2.36.0+ - RHEL 9.6+ and RHEL 10"
|
||||||
|
rlRun "opticsmon --version"
|
||||||
|
rlRun "cpacfinfo --version"
|
||||||
|
rlRun "pvimg --version"
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest "s390utils 2.38.0+ - RHEL 9.7+ and RHEL 10.1+"
|
||||||
|
rlRun "zmemtopo --version"
|
||||||
|
rlRun "zpwr --version"
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest "s390utils 2.40.0+ - RHEL 9.8+ and RHEL 10.2+"
|
||||||
|
rlRun "pvinfo --version"
|
||||||
|
rlRun "pvverify --version"
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest "s390utils 2.42.0+ - RHEL 9.9+ and RHEL 10.3+"
|
||||||
|
rlRun "pvebc --version"
|
||||||
|
# rlRun "pvics --version"
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest "Bootloader signature"
|
||||||
|
rlRun "od -j 16380 -N 4 -A x --endian big -t x4 $STAGE3 | grep -q 7a49504c" 0 "Check SecureBoot trailer presence"
|
||||||
|
# only RHEL has signed bootloader
|
||||||
|
if rlIsRHEL '>=8'; then
|
||||||
|
rlRun "$EXTRACT -s $STAGE3 > stage3.bin.sig" 0 "Check bootloader signature"
|
||||||
|
else
|
||||||
|
rlLog "Skipping bootloader signature check, not on RHEL"
|
||||||
|
fi
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartCleanup
|
||||||
|
rlRun "popd"
|
||||||
|
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||||
|
rlPhaseEnd
|
||||||
|
rlJournalPrintText
|
||||||
|
rlJournalEnd
|
||||||
17
tests/zdev-migration/main.fmf
Normal file
17
tests/zdev-migration/main.fmf
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
summary: zdev-migration
|
||||||
|
description: |
|
||||||
|
Check if the legacy device config can be migrated to the zdev style
|
||||||
|
#link: https://redhat.atlassian.net/browse/RHEL-157238
|
||||||
|
contact: Daniel Horák <dhorak@redhat.com>
|
||||||
|
component:
|
||||||
|
- s390utils
|
||||||
|
test: ./runtest.sh
|
||||||
|
framework: beakerlib
|
||||||
|
require:
|
||||||
|
- s390utils-base
|
||||||
|
duration: 5m
|
||||||
|
enabled: true
|
||||||
|
adjust:
|
||||||
|
- when: arch != s390x
|
||||||
|
enabled: false
|
||||||
|
because: This test applies only to s390x systems.
|
||||||
129
tests/zdev-migration/runtest.sh
Executable file
129
tests/zdev-migration/runtest.sh
Executable file
@ -0,0 +1,129 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
#
|
||||||
|
# Description: Check if the legacy device config can be migrated to
|
||||||
|
# the zdev style
|
||||||
|
# Author: Dan Horák <dhorak@redhat.com>
|
||||||
|
#
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
#
|
||||||
|
# Copyright (c) 2026 Red Hat, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundation, either version 2 of
|
||||||
|
# the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be
|
||||||
|
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||||
|
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||||
|
# PURPOSE. See the GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||||
|
#
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
# Include Beaker environment
|
||||||
|
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||||
|
|
||||||
|
PACKAGE="s390utils-base"
|
||||||
|
|
||||||
|
rulesdir=/etc/udev/rules.d
|
||||||
|
|
||||||
|
rlJournalStart
|
||||||
|
rlPhaseStartSetup
|
||||||
|
rlAssertRpm $PACKAGE
|
||||||
|
|
||||||
|
rlLog "Make backups for live configs"
|
||||||
|
[ -f /etc/dasd.conf ] && cp /etc/dasd.conf /etc/dasd.conf.pre-zdev
|
||||||
|
[ -f /etc/zfcp.conf ] && cp /etc/zfcp.conf /etc/zfcp.conf.pre-zdev
|
||||||
|
for f in /etc/NetworkManager/system-connections/*; do
|
||||||
|
cp $f $f.nm-pre-zdev
|
||||||
|
done
|
||||||
|
[ -f $rulesdir/41-cio-ignore.rules ] && cp $rulesdir/41-cio-ignore.rules $rulesdir/41-cio-ignore.rules.pre-zdev
|
||||||
|
|
||||||
|
rlLog "Create sample configs"
|
||||||
|
echo "0.0.1234" > /etc/dasd.conf
|
||||||
|
echo "0.0.2345 0x10020123456789ab 0x0001000000000000" > /etc/zfcp.conf
|
||||||
|
|
||||||
|
cat > /etc/NetworkManager/system-connections/enc3450.nmconnection << EOF
|
||||||
|
[connection]
|
||||||
|
id=enc3450
|
||||||
|
uuid=a398c979-06b4-4e92-ae53-ab69d46f109d
|
||||||
|
type=ethernet
|
||||||
|
interface-name=enc3450
|
||||||
|
|
||||||
|
[ethernet]
|
||||||
|
s390-nettype=qeth
|
||||||
|
s390-subchannels=0.0.3450;0.0.3451;0.0.3452;
|
||||||
|
|
||||||
|
[ethernet-s390-options]
|
||||||
|
layer2=1
|
||||||
|
portno=2
|
||||||
|
|
||||||
|
[ipv4]
|
||||||
|
method=auto
|
||||||
|
|
||||||
|
[ipv6]
|
||||||
|
addr-gen-mode=eui64
|
||||||
|
method=auto
|
||||||
|
|
||||||
|
[proxy]
|
||||||
|
EOF
|
||||||
|
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest "Check dasd.conf migration"
|
||||||
|
rlRun "dasdconfmigrate.sh"
|
||||||
|
rlAssertExists $rulesdir/41-cio-ignore.rules
|
||||||
|
rlAssertGrep "1234" $rulesdir/41-cio-ignore.rules
|
||||||
|
rlAssertNotExists /etc/dasd.conf
|
||||||
|
rlAssertExists $rulesdir/41-dasd-*-0.0.1234.rules
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest "Check zfcp.conf migration"
|
||||||
|
rlRun "zfcpconfmigrate.sh"
|
||||||
|
rlAssertExists $rulesdir/41-cio-ignore.rules
|
||||||
|
rlAssertGrep "2345" $rulesdir/41-cio-ignore.rules
|
||||||
|
rlAssertNotExists /etc/zfcp.conf
|
||||||
|
rlAssertExists $rulesdir/41-zfcp-host-0.0.2345.rules
|
||||||
|
rlAssertExists $rulesdir/41-zfcp-lun-0.0.2345:0x10020123456789ab:0x0001000000000000.rules
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest "Check network config migration"
|
||||||
|
rlRun "znetconfmigrate.sh"
|
||||||
|
rlAssertExists $rulesdir/41-cio-ignore.rules
|
||||||
|
rlAssertGrep "3450" $rulesdir/41-cio-ignore.rules
|
||||||
|
rlAssertExists /etc/NetworkManager/system-connections/enc3450.nmconnection
|
||||||
|
rlAssertExists $rulesdir/41-qeth-0.0.3450.rules
|
||||||
|
rlAssertGrep "ATTR{\[ccwgroup/0\.0\.3450\]layer2}=\"1\"" $rulesdir/41-qeth-0.0.3450.rules
|
||||||
|
rlAssertGrep "ATTR{\[ccwgroup/0\.0\.3450\]portno}=\"2\"" $rulesdir/41-qeth-0.0.3450.rules
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartCleanup
|
||||||
|
rlLog "Remove migrated configs"
|
||||||
|
rm /etc/dasd.conf.*.migrated-to-chzdev{,.log}
|
||||||
|
rm /etc/zfcp.conf.*.migrated-to-chzdev{,.log}
|
||||||
|
rm /etc/NetworkManager/system-connections/enc3450.nmconnection
|
||||||
|
|
||||||
|
rlLog "Remove migrated rules"
|
||||||
|
rm $rulesdir/41-dasd-*-0.0.1234.rules
|
||||||
|
rm $rulesdir/41-zfcp-*-0.0.2345*.rules
|
||||||
|
rm $rulesdir/41-qeth-0.0.3450.rules
|
||||||
|
if [ -f $rulesdir/41-cio-ignore.rules.pre-zdev ]; then
|
||||||
|
mv $rulesdir/41-cio-ignore.rules.pre-zdev $rulesdir/41-cio-ignore.rules
|
||||||
|
else
|
||||||
|
rm $rulesdir/41-cio-ignore.rules
|
||||||
|
fi
|
||||||
|
|
||||||
|
rlLog "Restore live configs"
|
||||||
|
[ -f /etc/dasd.conf.pre-zdev ] && mv /etc/dasd.conf.pre-zdev /etc/dasd.conf
|
||||||
|
[ -f /etc/zfcp.conf.pre-zdev ] && mv /etc/zfcp.conf.pre-zdev /etc/zfcp.conf
|
||||||
|
for f in /etc/NetworkManager/system-connections/*.nm-pre-zdev; do
|
||||||
|
mv $f $(basename -s .nm-pre-zdev $f)
|
||||||
|
done
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlJournalPrintText
|
||||||
|
rlJournalEnd
|
||||||
17
tests/zipl-empty-params/main.fmf
Normal file
17
tests/zipl-empty-params/main.fmf
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
summary: zipl-empty-params
|
||||||
|
description: |
|
||||||
|
Check if zipl works with empty parameters in zipl.conf
|
||||||
|
link: https://bugzilla.redhat.com/show_bug.cgi?id=2113884
|
||||||
|
contact: Daniel Horák <dhorak@redhat.com>
|
||||||
|
component:
|
||||||
|
- s390utils-core
|
||||||
|
test: ./runtest.sh
|
||||||
|
framework: beakerlib
|
||||||
|
require:
|
||||||
|
- s390utils-core
|
||||||
|
duration: 5m
|
||||||
|
enabled: true
|
||||||
|
adjust:
|
||||||
|
- when: arch != s390x
|
||||||
|
enabled: false
|
||||||
|
because: This test applies only to s390x systems.
|
||||||
56
tests/zipl-empty-params/runtest.sh
Executable file
56
tests/zipl-empty-params/runtest.sh
Executable file
@ -0,0 +1,56 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
#
|
||||||
|
# Description: Check if zipl works with empty parameters in zipl.conf
|
||||||
|
# Author: Dan Horák <dhorak@redhat.com>
|
||||||
|
#
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
#
|
||||||
|
# Copyright (c) 2025 Red Hat, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundation, either version 2 of
|
||||||
|
# the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be
|
||||||
|
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||||
|
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||||
|
# PURPOSE. See the GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||||
|
#
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
# Include Beaker environment
|
||||||
|
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||||
|
|
||||||
|
PACKAGE="s390utils-core"
|
||||||
|
|
||||||
|
rlJournalStart
|
||||||
|
rlPhaseStartSetup
|
||||||
|
rlAssertRpm $PACKAGE
|
||||||
|
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||||
|
rlRun "pushd $TmpDir"
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest "Check if zipl works with empty kernel parameter line"
|
||||||
|
[ -f /etc/zipl.conf ] && cp /etc/zipl.conf . || cp /usr/lib/s390-tools/zipl.conf .
|
||||||
|
version=$(uname -r)
|
||||||
|
cat >> ./zipl.conf << EOF
|
||||||
|
|
||||||
|
[empty]
|
||||||
|
target=/boot
|
||||||
|
image=/boot/vmlinuz-$version
|
||||||
|
ramdisk=/boot/initramfs-$version.img
|
||||||
|
EOF
|
||||||
|
rlRun "zipl -V --dry-run -c ./zipl.conf"
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartCleanup
|
||||||
|
rlRun "popd"
|
||||||
|
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||||
|
rlPhaseEnd
|
||||||
|
rlJournalPrintText
|
||||||
|
rlJournalEnd
|
||||||
18
tests/zipl-long-params/main.fmf
Normal file
18
tests/zipl-long-params/main.fmf
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
summary: zipl-long-params
|
||||||
|
description: |
|
||||||
|
Check for long parameter line support in zipl
|
||||||
|
link: https://issues.redhat.com/browse/RHEL-105492
|
||||||
|
contact: Daniel Horák <dhorak@redhat.com>
|
||||||
|
component:
|
||||||
|
- s390utils
|
||||||
|
test: ./runtest.sh
|
||||||
|
framework: beakerlib
|
||||||
|
require:
|
||||||
|
- s390utils-core
|
||||||
|
- grubby
|
||||||
|
duration: 5m
|
||||||
|
enabled: true
|
||||||
|
adjust:
|
||||||
|
- when: arch != s390x
|
||||||
|
enabled: false
|
||||||
|
because: This test applies only to s390x systems.
|
||||||
56
tests/zipl-long-params/runtest.sh
Executable file
56
tests/zipl-long-params/runtest.sh
Executable file
@ -0,0 +1,56 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
#
|
||||||
|
# Description: Check for long parameter line support in zipl
|
||||||
|
# Author: Dan Horák <dhorak@redhat.com>
|
||||||
|
#
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
#
|
||||||
|
# Copyright (c) 2025 Red Hat, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundation, either version 2 of
|
||||||
|
# the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be
|
||||||
|
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||||
|
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||||
|
# PURPOSE. See the GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||||
|
#
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
# Include Beaker environment
|
||||||
|
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||||
|
|
||||||
|
PACKAGE="s390utils-core"
|
||||||
|
PARAMS=params.txt
|
||||||
|
|
||||||
|
rlJournalStart
|
||||||
|
if [ "$TMT_REBOOT_COUNT" -eq 0 ]; then
|
||||||
|
rlPhaseStartSetup
|
||||||
|
rlAssertRpm $PACKAGE
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest "Check if long kernel parameter line is supported"
|
||||||
|
# add additional parameters for the default kernel, 24x 46B = 1104B, over the original 896B limit
|
||||||
|
( for i in `seq -w 0 23`; do echo -n " param$i=`uuidgen`"; done ) > $PARAMS
|
||||||
|
rlRun 'grubby --args="$(cat $PARAMS)" --update-kernel=DEFAULT'
|
||||||
|
rlRun "zipl -V"
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlRun "tmt-reboot" 0 "Reboot the machine"
|
||||||
|
|
||||||
|
elif [ "$TMT_REBOOT_COUNT" -eq 1 ]; then
|
||||||
|
rlPhaseStartTest "Check if all parameters are present after reboot"
|
||||||
|
rlRun "grep -f $PARAMS /proc/cmdline"
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartCleanup
|
||||||
|
rlPhaseEnd
|
||||||
|
fi
|
||||||
|
rlJournalPrintText
|
||||||
|
rlJournalEnd
|
||||||
18
tests/zipl-sync/main.fmf
Normal file
18
tests/zipl-sync/main.fmf
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
summary: zipl-sync
|
||||||
|
description: |
|
||||||
|
Check if zipl is using syncfs() instead of potentially blocking sync()
|
||||||
|
link: https://redhat.atlassian.net/browse/RHEL-157238
|
||||||
|
contact: Daniel Horák <dhorak@redhat.com>
|
||||||
|
component:
|
||||||
|
- s390utils
|
||||||
|
test: ./runtest.sh
|
||||||
|
framework: beakerlib
|
||||||
|
require:
|
||||||
|
- s390utils-core
|
||||||
|
- strace
|
||||||
|
duration: 5m
|
||||||
|
enabled: true
|
||||||
|
adjust:
|
||||||
|
- when: arch != s390x
|
||||||
|
enabled: false
|
||||||
|
because: This test applies only to s390x systems.
|
||||||
49
tests/zipl-sync/runtest.sh
Executable file
49
tests/zipl-sync/runtest.sh
Executable file
@ -0,0 +1,49 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
#
|
||||||
|
# Description: Check if zipl is using syncfs() instead of potentially
|
||||||
|
# blocking sync()
|
||||||
|
# Author: Dan Horák <dhorak@redhat.com>
|
||||||
|
#
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
#
|
||||||
|
# Copyright (c) 2026 Red Hat, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundation, either version 2 of
|
||||||
|
# the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be
|
||||||
|
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||||
|
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||||
|
# PURPOSE. See the GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||||
|
#
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
# Include Beaker environment
|
||||||
|
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||||
|
|
||||||
|
PACKAGE="s390utils-core strace"
|
||||||
|
|
||||||
|
log=/tmp/zipl.log
|
||||||
|
|
||||||
|
rlJournalStart
|
||||||
|
rlPhaseStartSetup
|
||||||
|
rlAssertRpm $PACKAGE
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest "Check if zipl is using syncfs() instead of potentially blocking sync()"
|
||||||
|
rlRun "strace -o $log zipl -V"
|
||||||
|
rlAssertGrep syncfs $log -w
|
||||||
|
rlAssertNotGrep sync $log -w
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartCleanup
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlJournalPrintText
|
||||||
|
rlJournalEnd
|
||||||
17
tests/zkey-initrd/main.fmf
Normal file
17
tests/zkey-initrd/main.fmf
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
summary: zkey-initrd
|
||||||
|
description: |
|
||||||
|
Check for zkey related kernel modules and tools in initrd
|
||||||
|
link: https://issues.redhat.com/browse/RHEL-96131
|
||||||
|
contact: Daniel Horák <dhorak@redhat.com>
|
||||||
|
component:
|
||||||
|
- s390utils-base
|
||||||
|
test: ./runtest.sh
|
||||||
|
framework: beakerlib
|
||||||
|
require:
|
||||||
|
- s390utils-base
|
||||||
|
duration: 5m
|
||||||
|
enabled: true
|
||||||
|
adjust:
|
||||||
|
- when: arch != s390x
|
||||||
|
enabled: false
|
||||||
|
because: This test applies only to s390x systems.
|
||||||
59
tests/zkey-initrd/runtest.sh
Executable file
59
tests/zkey-initrd/runtest.sh
Executable file
@ -0,0 +1,59 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
#
|
||||||
|
# Description: Check for required kernel modules and tools in initrd
|
||||||
|
# Reference: https://issues.redhat.com/browse/RHEL-96131
|
||||||
|
# Author: Dan Horák <dhorak@redhat.com>
|
||||||
|
#
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
#
|
||||||
|
# Copyright (c) 2025 Red Hat, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundation, either version 2 of
|
||||||
|
# the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be
|
||||||
|
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||||
|
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||||
|
# PURPOSE. See the GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||||
|
#
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
# Include Beaker environment
|
||||||
|
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||||
|
|
||||||
|
PACKAGE="s390utils-base"
|
||||||
|
INITRD=initrd.img
|
||||||
|
LISTING=$INITRD.lst
|
||||||
|
|
||||||
|
rlJournalStart
|
||||||
|
rlPhaseStartSetup
|
||||||
|
rlAssertRpm $PACKAGE
|
||||||
|
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||||
|
rlRun "pushd $TmpDir"
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest "Create initrd and check its content for required kernel modules and tools"
|
||||||
|
rlRun "dracut $INITRD"
|
||||||
|
rlRun "lsinitrd $INITRD > $LISTING"
|
||||||
|
for module in pkey pkey-pckmo pkey-ep11 pkey-cca zcrypt zcrypt_cex4; do
|
||||||
|
rlAssertGrep "kernel/drivers/s390/crypto/${module}\.ko\.xz" $LISTING
|
||||||
|
done
|
||||||
|
for module in paes_s390; do
|
||||||
|
rlAssertGrep "kernel/arch/s390/crypto/${module}\.ko\.xz" $LISTING
|
||||||
|
done
|
||||||
|
for tool in chzcrypt lszcrypt zkey zkey-cryptsetup; do
|
||||||
|
rlAssertGrep "usr/(bin|sbin)/${tool}\$" $LISTING -E
|
||||||
|
done
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartCleanup
|
||||||
|
rlRun "popd"
|
||||||
|
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||||
|
rlPhaseEnd
|
||||||
|
rlJournalEnd
|
||||||
47
zfcpconfmigrate.sh
Normal file
47
zfcpconfmigrate.sh
Normal file
@ -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
|
||||||
103
znetconfmigrate.sh
Normal file
103
znetconfmigrate.sh
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
#! /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