commit
d96c8356db
@ -0,0 +1 @@
|
||||
SOURCES/s390-tools-2.25.0.tar.gz
|
@ -0,0 +1 @@
|
||||
e8e0d3f651179fd14dc4a40d53a1e4ef6edaae7d SOURCES/s390-tools-2.25.0.tar.gz
|
@ -0,0 +1,185 @@
|
||||
#!/bin/bash
|
||||
|
||||
if ! [[ $KERNEL_INSTALL_MACHINE_ID ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
[[ -f /etc/sysconfig/kernel ]] && . /etc/sysconfig/kernel
|
||||
|
||||
COMMAND="$1"
|
||||
KERNEL_VERSION="$2"
|
||||
BOOT_DIR_ABS="$3"
|
||||
KERNEL_IMAGE="$4"
|
||||
|
||||
KERNEL_DIR="${KERNEL_IMAGE%/*}"
|
||||
|
||||
MACHINE_ID=$KERNEL_INSTALL_MACHINE_ID
|
||||
|
||||
BLS_DIR="/boot/loader/entries"
|
||||
ZIPLCFG="/etc/zipl.conf"
|
||||
CMDLINE_LINUX_DEBUG=" systemd.log_level=debug systemd.log_target=kmsg"
|
||||
LINUX_DEBUG_VERSION_POSTFIX="_with_debugging"
|
||||
LINUX_DEBUG_TITLE_POSTFIX=" with debugging"
|
||||
|
||||
mkbls() {
|
||||
local kernelver=$1 && shift
|
||||
local datetime=$1 && shift
|
||||
local kernelopts=$1 && shift
|
||||
|
||||
local debugname=""
|
||||
local flavor=""
|
||||
|
||||
if [[ "$kernelver" == *\+* ]] ; then
|
||||
local flavor=-"${kernelver##*+}"
|
||||
if [[ "${flavor}" == "-debug" ]]; then
|
||||
local debugname=" with debugging"
|
||||
local debugid="-debug"
|
||||
fi
|
||||
fi
|
||||
|
||||
cat <<EOF
|
||||
title ${NAME} (${kernelver}) ${VERSION}${debugname}
|
||||
version ${kernelver}${debugid}
|
||||
linux /boot/vmlinuz-${kernelver}
|
||||
initrd /boot/initramfs-${kernelver}.img
|
||||
options ${kernelopts}
|
||||
id ${ID}-${datetime}-${kernelver}${debugid}
|
||||
grub_users \$grub_users
|
||||
grub_arg --unrestricted
|
||||
grub_class kernel${flavor}
|
||||
EOF
|
||||
}
|
||||
|
||||
[[ "$KERNEL_VERSION" == *\+* ]] && flavor=-"${KERNEL_VERSION##*+}"
|
||||
case "$COMMAND" in
|
||||
add)
|
||||
if [[ "${KERNEL_DIR}" != "/boot" ]]; then
|
||||
for i in \
|
||||
"$KERNEL_IMAGE" \
|
||||
"$KERNEL_DIR"/System.map \
|
||||
"$KERNEL_DIR"/config \
|
||||
"$KERNEL_DIR"/zImage.stub
|
||||
do
|
||||
[[ -e "$i" ]] || continue
|
||||
cp -aT "$i" "/boot/${i##*/}-${KERNEL_VERSION}"
|
||||
command -v restorecon &>/dev/null && \
|
||||
restorecon -R "/boot/${i##*/}-${KERNEL_VERSION}"
|
||||
done
|
||||
# hmac is .vmlinuz-<version>.hmac so needs a special treatment
|
||||
i="$KERNEL_DIR/.${KERNEL_IMAGE##*/}.hmac"
|
||||
if [[ -e "$i" ]]; then
|
||||
cp -a "$i" "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac"
|
||||
command -v restorecon &>/dev/null && \
|
||||
restorecon "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ! -f /sbin/new-kernel-pkg || -d "${BLS_DIR}" ]]; then
|
||||
declare -a BOOT_OPTIONS
|
||||
if [[ -f /etc/kernel/cmdline ]]; then
|
||||
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
|
||||
fi
|
||||
|
||||
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
|
||||
read -r -d '' -a line < /proc/cmdline
|
||||
for i in "${line[@]}"; do
|
||||
[[ "${i#initrd=*}" != "$i" || "${i#BOOT_IMAGE=*}" != "$i" ]] && continue
|
||||
BOOT_OPTIONS+=("$i")
|
||||
done
|
||||
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"
|
||||
BLS_TARGET="${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf"
|
||||
if [[ -f "${KERNEL_DIR}/bls.conf" ]]; then
|
||||
cp -aT "${KERNEL_DIR}/bls.conf" "${BLS_TARGET}" || exit $?
|
||||
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#^options.*#options ${BOOT_OPTIONS[*]}#g" "${BLS_TARGET}"
|
||||
else
|
||||
mkbls "${KERNEL_VERSION}" \
|
||||
"$(date -u +%Y%m%d%H%M%S -d "$(stat -c '%y' "${KERNEL_DIR}")")" \
|
||||
"${BOOT_OPTIONS[*]}" >"${BLS_TARGET}"
|
||||
fi
|
||||
|
||||
if [[ "$KERNEL_VERSION" == *\+* ]] && [ "x$DEFAULTDEBUG" != "xyes" ]; then
|
||||
UPDATEDEFAULT="no"
|
||||
fi
|
||||
|
||||
if [[ "x$UPDATEDEFAULT" = "xyes" ]]; then
|
||||
TITLE="$(grep '^title[ \t]' "${BLS_TARGET}" | sed -e 's/^title[ \t]*//')"
|
||||
NEWDEFAULT="${TITLE}"
|
||||
fi
|
||||
|
||||
if [ "x${MAKEDEBUG}" = "xyes" ]; then
|
||||
BLS_DEBUG="$(echo ${BLS_TARGET} | sed -e "s/${KERNEL_VERSION}/${KERNEL_VERSION}~debug/")"
|
||||
cp -aT "${BLS_TARGET}" "${BLS_DEBUG}"
|
||||
TITLE="$(grep '^title[ \t]' "${BLS_DEBUG}" | sed -e 's/^title[ \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/")"
|
||||
sed -i -e "s/^title.*/title ${TITLE}${LINUX_DEBUG_TITLE_POSTFIX}/" "${BLS_DEBUG}"
|
||||
sed -i -e "s/^version.*/version ${VERSION}${LINUX_DEBUG_VERSION_POSTFIX}/" "${BLS_DEBUG}"
|
||||
sed -i -e "s/^id.*/${BLSID}/" "${BLS_DEBUG}"
|
||||
sed -i -e "s#^options.*#options ${BOOT_OPTIONS[*]}${CMDLINE_LINUX_DEBUG}#" "${BLS_DEBUG}"
|
||||
if [ -n "$NEWDEFAULT" -a "x$DEFAULTDEBUG" = "xyes" ]; then
|
||||
TITLE="$(grep '^title[ \t]' "${BLS_DEBUG}" | sed -e 's/^title[ \t]*//')"
|
||||
NEWDEFAULT="${TITLE}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$NEWDEFAULT" ] && [ -f "${ZIPLCFG}" ]; then
|
||||
if grep -q "^default=" "${ZIPLCFG}"; then
|
||||
sed -i -e "s,^default=.*,default=${NEWDEFAULT}," "${ZIPLCFG}"
|
||||
else
|
||||
echo "default=${NEWDEFAULT}" >> "${ZIPLCFG}"
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
||||
/sbin/new-kernel-pkg --package "kernel${flavor}" --install "$KERNEL_VERSION" || exit $?
|
||||
/sbin/new-kernel-pkg --package "kernel${flavor}" --mkinitrd --dracut --depmod --update "$KERNEL_VERSION" || exit $?
|
||||
/sbin/new-kernel-pkg --package "kernel${flavor}" --rpmposttrans "$KERNEL_VERSION" || exit $?
|
||||
# If grubby is used there's no need to run other installation plugins
|
||||
exit 77
|
||||
;;
|
||||
remove)
|
||||
if [[ ! -f /sbin/new-kernel-pkg || -d "${BLS_DIR}" ]]; then
|
||||
ARCH="$(uname -m)"
|
||||
BLS_TARGET="${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf"
|
||||
BLS_DEBUG="$(echo ${BLS_TARGET} | sed -e "s/${KERNEL_VERSION}/${KERNEL_VERSION}~debug/")"
|
||||
|
||||
if [ -f "${BLS_TARGET}" ] && [ -f "${ZIPLCFG}" ]; then
|
||||
TITLE="$(grep '^title[ \t]' "${BLS_TARGET}" | sed -e 's/^title[ \t]*//')"
|
||||
sed -i -e "/^default=${TITLE}/d" "${ZIPLCFG}"
|
||||
fi
|
||||
|
||||
if [[ -f "${BLS_DEBUG}" ]]; then
|
||||
TITLE="$(grep '^title[ \t]' "${BLS_DEBUG}" | sed -e 's/^title[ \t]*//')"
|
||||
sed -i -e "/^default=${TITLE}/d" "${ZIPLCFG}"
|
||||
fi
|
||||
|
||||
rm -f "${BLS_TARGET}" "${BLS_DEBUG}"
|
||||
|
||||
for i in vmlinuz System.map config zImage.stub dtb; do
|
||||
rm -rf "/boot/${i}-${KERNEL_VERSION}"
|
||||
done
|
||||
# hmac is .vmlinuz-<version>.hmac so needs a special treatment
|
||||
rm -f "/boot/.vmlinuz-${KERNEL_VERSION}.hmac"
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
||||
/sbin/new-kernel-pkg --package "kernel${flavor+-$flavor}" --rminitrd --rmmoddep --remove "$KERNEL_VERSION" || exit $?
|
||||
# If grubby is used there's no need to run other installation plugins
|
||||
exit 77
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
|
||||
[[ -f /etc/os-release ]] && . /etc/os-release
|
||||
[[ -f /etc/sysconfig/kernel ]] && . /etc/sysconfig/kernel
|
||||
|
||||
COMMAND="$1"
|
||||
KERNEL_VERSION="$2"
|
||||
BOOT_DIR_ABS="$3"
|
||||
KERNEL_IMAGE="$4"
|
||||
|
||||
MACHINE_ID=$KERNEL_INSTALL_MACHINE_ID
|
||||
|
||||
BLS_DIR="/boot/loader/entries"
|
||||
|
||||
[[ "$KERNEL_VERSION" == *\+* ]] && flavor=-"${KERNEL_VERSION##*+}"
|
||||
case "$COMMAND" in
|
||||
add)
|
||||
if [[ ! -f /sbin/new-kernel-pkg || -d "${BLS_DIR}" ]]; then
|
||||
declare -a BOOT_OPTIONS
|
||||
if [[ -f /etc/kernel/cmdline ]]; then
|
||||
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
|
||||
fi
|
||||
|
||||
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
|
||||
read -r -d '' -a line < /proc/cmdline
|
||||
for i in "${line[@]}"; do
|
||||
[[ "${i#initrd=*}" != "$i" ]] && continue
|
||||
BOOT_OPTIONS+=("$i")
|
||||
done
|
||||
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"
|
||||
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,^initrd.*,initrd /boot/initramfs-0-rescue-${MACHINE_ID}.img,g" "${BLS_RESCUE}"
|
||||
sed -i -e "s#^options.*#options ${BOOT_OPTIONS[*]}#g" "${BLS_RESCUE}"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ ! -f /etc/zipl.conf ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
COMMAND="$1"
|
||||
|
||||
case "$COMMAND" in
|
||||
add|remove)
|
||||
zipl > /dev/null
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
@ -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"
|
@ -0,0 +1,200 @@
|
||||
#! /bin/sh
|
||||
|
||||
[ -z "$DEVPATH" ] && exit 0
|
||||
[ "$SUBSYSTEM" != "ccw" ] && exit 0
|
||||
|
||||
[ -e /etc/ccw.conf ] && MODE="dracut" || MODE="normal"
|
||||
OLD_IFS="$IFS"
|
||||
|
||||
get_config_line_by_subchannel()
|
||||
{
|
||||
local CHANNEL
|
||||
CHANNEL="$1"
|
||||
while read line; do
|
||||
IFS=","
|
||||
set $line
|
||||
IFS="$OLD_IFS"
|
||||
for i in $@; do
|
||||
if [ "$CHANNEL" = "$i" ]; then
|
||||
echo $line
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
done < /etc/ccw.conf
|
||||
return 1
|
||||
}
|
||||
|
||||
# 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_config_by_subchannel ()
|
||||
{
|
||||
LANG=C grep -E -i -l \
|
||||
"^[[:space:]]*SUBCHANNELS=['\"]?([0-9]\.[0-9]\.[a-f0-9]+,){0,2}${1}(,[0-9]\.[0-9]\.[a-f0-9]+){0,2}['\"]?([[:space:]]+#|[[:space:]]*$)" \
|
||||
/etc/sysconfig/network-scripts/ifcfg-* \
|
||||
| LC_ALL=C sed -e "$__sed_discard_ignored_files"
|
||||
}
|
||||
|
||||
get_config_by_subchannel_nm ()
|
||||
{
|
||||
LANG=C grep -E -i -l \
|
||||
"^s390-subchannels=([0-9]\.[0-9]\.[a-f0-9]+;){0,2}${1};([0-9]\.[0-9]\.[a-f0-9]+;){0,2}$" \
|
||||
/etc/NetworkManager/system-connections/*.nmconnection \
|
||||
| LC_ALL=C sed -e "$__sed_discard_ignored_files"
|
||||
}
|
||||
|
||||
CHANNEL=${DEVPATH##*/}
|
||||
|
||||
if [ $MODE = "dracut" ]; then
|
||||
CONFIG_LINE=$(get_config_line_by_subchannel $CHANNEL)
|
||||
|
||||
[ $? -ne 0 -o -z "$CONFIG_LINE" ] && break
|
||||
|
||||
IFS=","
|
||||
set $CONFIG_LINE
|
||||
IFS="$OLD_IFS"
|
||||
NETTYPE=$1
|
||||
shift
|
||||
SUBCHANNELS="$1"
|
||||
OPTIONS=""
|
||||
shift
|
||||
while [ $# -gt 0 ]; do
|
||||
case $1 in
|
||||
*=*) OPTIONS="$OPTIONS $1";;
|
||||
[0-9]*) SUBCHANNELS="$SUBCHANNELS,$1";;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
elif [ $MODE = "normal" ]; then
|
||||
NOLOCALE="yes"
|
||||
|
||||
CONFIG_FILE=$(get_config_by_subchannel $CHANNEL)
|
||||
|
||||
if [ -n "$CONFIG_FILE" ]; then
|
||||
. $CONFIG_FILE
|
||||
else
|
||||
CONFIG_FILE=$(get_config_by_subchannel_nm $CHANNEL)
|
||||
if [ -n "$CONFIG_FILE" ]; then
|
||||
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/,$//")
|
||||
LAYER2=$(sed -nr "/^\[ethernet-s390-options\]/ { :l /^layer2[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" $CONFIG_FILE)
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "Unknown mode=$MODE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# now we have extracted these variables from the config files:
|
||||
# SUBCHANNELS
|
||||
# OPTIONS
|
||||
|
||||
# put LAYER2 option into its own variable
|
||||
set $OPTIONS
|
||||
OPTIONS=""
|
||||
while [ $# -gt 0 ]; do
|
||||
case $1 in
|
||||
layer2=*) LAYER2=${1##layer2=};;
|
||||
*=*) OPTIONS="$OPTIONS $1";;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# 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" ] && exit 0
|
||||
if [ "$NETTYPE" = "ctc" ]; then
|
||||
DIR="/sys/bus/ccwgroup/drivers/ctcm"
|
||||
else
|
||||
DIR="/sys/bus/ccwgroup/drivers/$NETTYPE"
|
||||
fi
|
||||
|
||||
i=0
|
||||
while [ $i -lt 20 ]; do
|
||||
[ -e $DIR ] && break
|
||||
sleep 0.1
|
||||
i=$(($i+1))
|
||||
done
|
||||
|
||||
# driver missing or not loaded
|
||||
[ ! -e $DIR ] && exit 0
|
||||
|
||||
IFS=","
|
||||
set $SUBCHANNELS
|
||||
IFS="$OLD_IFS"
|
||||
CHANNEL1=$1
|
||||
CHANNEL2=$2
|
||||
SYSDIR="$DIR/$CHANNEL1"
|
||||
|
||||
[ -e $SYSDIR ] && exit 0
|
||||
|
||||
# check if the interface is already online
|
||||
if [ -e $SYSDIR/online ]; then
|
||||
read on <$SYSDIR/online
|
||||
[ "$on" = "1" ] && exit 0
|
||||
fi
|
||||
|
||||
DRIVER=$(readlink $DEVPATH/driver)
|
||||
DRIVER=${DRIVER##*/}
|
||||
if [ "$DRIVER" = "lcs" -a "$NETTYPE" = "ctc" ]; then
|
||||
echo "$CHANNEL" > /sys/bus/ccw/drivers/lcs/unbind
|
||||
echo "$CHANNEL" > /sys/bus/ccw/drivers/ctcm/bind
|
||||
echo "$CHANNEL2" > /sys/bus/ccw/drivers/lcs/unbind
|
||||
echo "$CHANNEL2" > /sys/bus/ccw/drivers/ctcm/bind
|
||||
fi
|
||||
if [ "$DRIVER" = "ctcm" -a "$NETTYPE" = "lcs" ]; then
|
||||
echo "$CHANNEL" > /sys/bus/ccw/drivers/ctcm/unbind
|
||||
echo "$CHANNEL" > /sys/bus/ccw/drivers/lcs/bind
|
||||
echo "$CHANNEL2" > /sys/bus/ccw/drivers/ctcm/unbind
|
||||
echo "$CHANNEL2" > /sys/bus/ccw/drivers/lcs/bind
|
||||
fi
|
||||
|
||||
if [ ! -e $SYSDIR ]; then
|
||||
echo "$SUBCHANNELS" > $DIR/group
|
||||
i=0
|
||||
while [ $i -lt 20 ]; do
|
||||
[ -e $SYSDIR ] && break
|
||||
sleep 0.1
|
||||
i=$(($i+1))
|
||||
done
|
||||
|
||||
[ ! -e $SYSDIR ] && exit 1
|
||||
fi
|
||||
|
||||
# check if the interface is already online
|
||||
if [ -e $SYSDIR/online ]; then
|
||||
read on <$SYSDIR/online
|
||||
[ "$on" = "1" ] && exit 0
|
||||
fi
|
||||
|
||||
# first set layer2, other options may depend on it
|
||||
[ -n "$LAYER2" ] && echo $LAYER2 > $SYSDIR/layer2
|
||||
|
||||
if [ -n "$OPTIONS" ]; then
|
||||
for i in $OPTIONS; do
|
||||
OPT=${i%%=*}
|
||||
VAL=${i##*=}
|
||||
if [ -e "$SYSDIR/$OPT" ]; then
|
||||
echo "$VAL" > "$SYSDIR/$OPT" || \
|
||||
echo "Could not set value \"$VAL\" for OPTION \"$OPT\" with SUBCHANNELS \"$SUBCHANNELS\""
|
||||
else
|
||||
echo "OPTION \"$OPT\" does not exist for SUBCHANNELS \"$SUBCHANNELS\""
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
[ -e $SYSDIR/online ] && echo 1 > $SYSDIR/online
|
@ -0,0 +1,16 @@
|
||||
ACTION=="add", SUBSYSTEM=="drivers", KERNEL=="dasd-eckd", RUN+="/sbin/dasdconf.sh"
|
||||
ACTION=="add", SUBSYSTEM=="drivers", KERNEL=="dasd-fba", RUN+="/sbin/dasdconf.sh"
|
||||
|
||||
# This list should be autogenerated with "modinfo dasd_{eckd,fba}_mod"
|
||||
ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t1750m*dt3380dm*", RUN+="/sbin/dasdconf.sh"
|
||||
ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t1750m*dt3390dm*", RUN+="/sbin/dasdconf.sh"
|
||||
ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t2107m*dt3380dm*", RUN+="/sbin/dasdconf.sh"
|
||||
ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t2107m*dt3390dm*", RUN+="/sbin/dasdconf.sh"
|
||||
ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t9343m*dt9345dm*", RUN+="/sbin/dasdconf.sh"
|
||||
ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t2105m*dt3380dm*", RUN+="/sbin/dasdconf.sh"
|
||||
ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t3990m*dt3380dm*", RUN+="/sbin/dasdconf.sh"
|
||||
ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t3880m*dt3390dm*", RUN+="/sbin/dasdconf.sh"
|
||||
ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t2105m*dt3390dm*", RUN+="/sbin/dasdconf.sh"
|
||||
ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t3990m*dt3390dm*", RUN+="/sbin/dasdconf.sh"
|
||||
ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t3880m*dt3370dm*", RUN+="/sbin/dasdconf.sh"
|
||||
ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t6310m*dt9336dm*", RUN+="/sbin/dasdconf.sh"
|
@ -0,0 +1,94 @@
|
||||
#!/bin/sh
|
||||
|
||||
# config file syntax:
|
||||
# deviceno sysfs_opts...
|
||||
#
|
||||
# Examples:
|
||||
# 0.0.0203 readonly=1 failfast=1
|
||||
# 0.0.0204
|
||||
# 0.0.0205 erplog=1
|
||||
|
||||
[ -z "$DEVPATH" ] && exit 0
|
||||
[ "$ACTION" != "add" ] && exit 0
|
||||
|
||||
CHANNEL=${DEVPATH##*/}
|
||||
|
||||
CONFIG=/etc/dasd.conf
|
||||
PATH=/sbin:/bin
|
||||
export PATH
|
||||
|
||||
warn() {
|
||||
[ -e /dev/kmsg ] && echo "<4>dasdconf.sh Warning: $@" > /dev/kmsg
|
||||
echo "dasdconf.sh Warning: $@" >&2
|
||||
}
|
||||
|
||||
if [ -f "$CONFIG" ]; then
|
||||
if [ ! -d /sys/bus/ccw/drivers/dasd-eckd ] && [ ! -d /sys/bus/ccw/drivers/dasd-fba ]; then
|
||||
#warn "No dasd-eckd or dasd-eckd loaded"
|
||||
exit 0
|
||||
fi
|
||||
sed 'y/ABCDEF/abcdef/' < $CONFIG | while read line; do
|
||||
case $line in
|
||||
\#*) ;;
|
||||
*)
|
||||
[ -z "$line" ] && continue
|
||||
set $line
|
||||
|
||||
# if we are in single add mode, only add the new CHANNEL
|
||||
[ "$SUBSYSTEM" = "ccw" ] && [ "$1" != "$CHANNEL" ] && continue
|
||||
|
||||
DEVICE=$1
|
||||
SYSFSPATH=
|
||||
|
||||
if [ -r "/sys/bus/ccw/drivers/dasd-eckd/$DEVICE" ]; then
|
||||
SYSFSPATH="/sys/bus/ccw/drivers/dasd-eckd/$DEVICE"
|
||||
elif [ -r "/sys/bus/ccw/drivers/dasd-fba/$DEVICE" ]; then
|
||||
SYSFSPATH="/sys/bus/ccw/drivers/dasd-fba/$DEVICE"
|
||||
else
|
||||
# if we are in single add mode, this is a failure!
|
||||
[ "$SUBSYSTEM" = "ccw" ] && warn "Could not find $DEVICE in sysfs"
|
||||
continue
|
||||
fi
|
||||
|
||||
# skip already onlined devices
|
||||
if [ "$(cat $SYSFSPATH/online)" = "1" ]; then
|
||||
if [ "$SUBSYSTEM" = "ccw" ]; then
|
||||
# if we are in single add mode, we should not touch the device
|
||||
warn "$DEVICE is already online, not configuring"
|
||||
exit 0
|
||||
fi
|
||||
continue
|
||||
fi
|
||||
|
||||
shift
|
||||
while [ -n "$1" ]; do
|
||||
(
|
||||
attribute="$1"
|
||||
IFS="="
|
||||
set $attribute
|
||||
|
||||
if [ "$1" = "use_diag" ]; then
|
||||
# this module better only returns after
|
||||
# all sysfs entries have the "use_diag" file
|
||||
modprobe dasd_diag_mod
|
||||
fi
|
||||
|
||||
if [ -r "$SYSFSPATH/$1" ]; then
|
||||
echo $2 > $SYSFSPATH/$1 || warn "Could not set $1=$2 for $DEVICE"
|
||||
else
|
||||
warn "$1 does not exist for $DEVICE"
|
||||
fi
|
||||
)
|
||||
shift
|
||||
done
|
||||
|
||||
# Now, put the device online
|
||||
echo 1 > $SYSFSPATH/online || echo "Could not activate $DEVICE"
|
||||
|
||||
# if we are in single add mode, we are done
|
||||
[ "$SUBSYSTEM" = "ccw" ] && exit 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
exit 0
|
@ -0,0 +1,321 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright 2009, 2010 Red Hat, Inc.
|
||||
# License: GPLv2
|
||||
# Author: Dan Horák <dhorak@redhat.com>
|
||||
#
|
||||
# unblock devices listed in various config files and wait until they are ready
|
||||
#
|
||||
# it uses dasd and zfcp config file
|
||||
# config file syntax:
|
||||
# deviceno options
|
||||
# or
|
||||
# deviceno WWPN FCPLUN
|
||||
#
|
||||
# also processes the system ccw config file and network interface configurations
|
||||
#
|
||||
# requires: echo, sleep, modprobe, grep, printf, sed.
|
||||
#
|
||||
# it is used in
|
||||
# anaconda
|
||||
# dracut generated initramfs
|
||||
# normal system startup driven by upstart
|
||||
#
|
||||
|
||||
DASDCONFIG=/etc/dasd.conf
|
||||
ZFCPCONFIG=/etc/zfcp.conf
|
||||
ZNETCONFIG=/etc/ccw.conf
|
||||
BLACKLIST=/proc/cio_ignore
|
||||
CIO_SETTLE=/proc/cio_settle
|
||||
VERBOSE=
|
||||
PATH=/bin:/sbin
|
||||
DEVICE= # list of devices given on command line
|
||||
ALL_DEVICES= # list of all unblocked devices
|
||||
WAITING_TIMEOUT=60 # maximum time to wait for all devices to appear
|
||||
WAITING_TOTAL=0 # actual time spent waiting for devices
|
||||
|
||||
usage()
|
||||
{
|
||||
echo "Usage: $CMD [-h|--help] [-V|--verbose] [-d|--device <deviceid>]"
|
||||
echo " -h|--help print this message"
|
||||
echo " -V|--verbose be verbose"
|
||||
echo " -d|--device <deviceid> unblock and wait for specified device"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# accepts single device, comma-separated lists and dash separated ranges and their combinations
|
||||
# the comma separated list is split so we minimize the effect of unsuccessful freeing
|
||||
free_device()
|
||||
{
|
||||
local DEV DEV_LIST
|
||||
|
||||
[ -z "$1" ] && return
|
||||
|
||||
DEV_LIST=$(echo "$1" | sed 'y/ABCDEF/abcdef/' | sed 's/,/ /g')
|
||||
|
||||
for DEV in $DEV_LIST; do
|
||||
[ $VERBOSE ] && echo "Freeing device(s) $DEV"
|
||||
if ! echo "free $DEV" > $BLACKLIST 2> /dev/null ; then
|
||||
echo "Error: can't free device(s) $DEV"
|
||||
else
|
||||
if [ -z $ALL_DEVICES ]; then
|
||||
ALL_DEVICES="$DEV"
|
||||
else
|
||||
ALL_DEVICES="$ALL_DEVICES,$DEV"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# wait until a device appears on the ccw bus
|
||||
wait_on_single_device()
|
||||
{
|
||||
local DEVICE_ONLINE DEV
|
||||
|
||||
[ -z "$1" ] && return
|
||||
|
||||
DEV="$1"
|
||||
DEVICE_ONLINE="/sys/bus/ccw/devices/$DEV/online"
|
||||
|
||||
[ $VERBOSE ] && echo "Waiting on device $DEV"
|
||||
[ -f "$DEVICE_ONLINE" ] && return
|
||||
|
||||
for t in 1 2 3 4 5
|
||||
do
|
||||
if [ $WAITING_TOTAL -ge $WAITING_TIMEOUT ]; then
|
||||
[ $VERBOSE ] && echo "Waiting timeout of $WAITING_TIMEOUT seconds reached"
|
||||
break
|
||||
fi
|
||||
WAITING_TOTAL=$(($WAITING_TOTAL + $t))
|
||||
[ $VERBOSE ] && echo "Waiting additional $t second(s) and $WAITING_TOTAL second(s) in total"
|
||||
sleep $t
|
||||
[ -f "$DEVICE_ONLINE" ] && return
|
||||
done
|
||||
echo "Error: device $DEV still not ready"
|
||||
}
|
||||
|
||||
# wait until recently unblocked devices are ready
|
||||
# at this point we know the content of ALL_DEVICES is syntacticly correct
|
||||
wait_on_devices()
|
||||
{
|
||||
if [ -w $CIO_SETTLE ]; then
|
||||
[ $VERBOSE ] && echo "Waiting until all pending CIO requests are processed"
|
||||
echo 1 > $CIO_SETTLE
|
||||
return
|
||||
fi
|
||||
|
||||
OLD_IFS=$IFS
|
||||
IFS=","
|
||||
set $ALL_DEVICES
|
||||
for DEV in $*
|
||||
do
|
||||
IFS="."
|
||||
|
||||
# get the lower bound for range or get the single device
|
||||
LOWER=${DEV%%-*}
|
||||
set $LOWER
|
||||
if [ $# -eq 1 ]; then
|
||||
L0=0
|
||||
L1=0
|
||||
L2=$(printf "%d" "0x$1")
|
||||
else
|
||||
L0=$(printf "%d" "0x$1")
|
||||
L1=$(printf "%d" "0x$2")
|
||||
L2=$(printf "%d" "0x$3")
|
||||
fi
|
||||
|
||||
# get the upper bound for range or get the single device
|
||||
UPPER=${DEV##*-}
|
||||
set $UPPER
|
||||
if [ $# -eq 1 ]; then
|
||||
U0=0
|
||||
U1=0
|
||||
U2=$(printf "%d" "0x$1")
|
||||
else
|
||||
U0=$(printf "%d" "0x$1")
|
||||
U1=$(printf "%d" "0x$2")
|
||||
U2=$(printf "%d" "0x$3")
|
||||
fi
|
||||
|
||||
IFS=$OLD_IFS
|
||||
|
||||
# iterate thru all devices
|
||||
i=$L0
|
||||
while [ $i -le $U0 ]; do
|
||||
[ $i -eq $L0 ] && LJ=$L1 || LJ=0
|
||||
[ $i -eq $U0 ] && UJ=$U1 || UJ=3
|
||||
|
||||
j=$LJ
|
||||
while [ $j -le $UJ ]; do
|
||||
[ $i -eq $L0 -a $j -eq $L1 ] && LK=$L2 || LK=0
|
||||
[ $i -eq $U0 -a $j -eq $U1 ] && UK=$U2 || UK=65535
|
||||
|
||||
k=$LK
|
||||
while [ $k -le $UK ]; do
|
||||
wait_on_single_device "$(printf %x.%x.%04x $i $j $k)"
|
||||
k=$(($k + 1))
|
||||
done
|
||||
j=$(($j + 1))
|
||||
done
|
||||
i=$(($i + 1))
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
process_config_file()
|
||||
{
|
||||
local CONFIG
|
||||
|
||||
[ -z "$1" ] && return
|
||||
|
||||
CONFIG="$1"
|
||||
if [ -f "$CONFIG" ]; then
|
||||
while read line; do
|
||||
case $line in
|
||||
\#*) ;;
|
||||
*)
|
||||
[ -z "$line" ] && continue
|
||||
set $line
|
||||
free_device $1
|
||||
;;
|
||||
esac
|
||||
done < "$CONFIG"
|
||||
fi
|
||||
}
|
||||
|
||||
# check how we were called
|
||||
CMD=${0##*/}
|
||||
DIR=${0%/*}
|
||||
ARGS=$@
|
||||
case $CMD in
|
||||
"dasd_cio_free")
|
||||
MODE_DASD="yes"
|
||||
;;
|
||||
"zfcp_cio_free")
|
||||
MODE_ZFCP="yes"
|
||||
;;
|
||||
"znet_cio_free")
|
||||
MODE_ZNET="yes"
|
||||
;;
|
||||
"device_cio_free")
|
||||
MODE_DASD="yes"
|
||||
MODE_ZFCP="yes"
|
||||
MODE_ZNET="yes"
|
||||
;;
|
||||
*)
|
||||
echo "Error: unknown alias '$CMD'."
|
||||
echo "Supported aliases are dasd_cio_free, zfcp_cio_free and znet_cio_free."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# process command line options
|
||||
while [ $# -gt 0 ]; do
|
||||
case $1 in
|
||||
-V|--verbose)
|
||||
VERBOSE=yes
|
||||
;;
|
||||
-h|--help)
|
||||
usage
|
||||
;;
|
||||
-d|--device)
|
||||
shift
|
||||
if [ "$1" ]; then
|
||||
if [ "$DEVICE" ]; then
|
||||
DEVICE="$DEVICE,$1"
|
||||
else
|
||||
DEVICE=$1
|
||||
fi
|
||||
else
|
||||
echo "Error: no device given"
|
||||
usage
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Error: unknown option $1"
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ ! -f $BLACKLIST ]; then
|
||||
echo "Error: $BLACKLIST kernel interface doesn't exist"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [ "$DEVICE" ]; then
|
||||
[ $VERBOSE ] && echo "Freeing specific devices"
|
||||
free_device $DEVICE
|
||||
wait_on_devices
|
||||
udevadm settle
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ $VERBOSE ]; then
|
||||
echo -n "Freeing devices:"
|
||||
[ $MODE_DASD ] && echo -n " dasd"
|
||||
[ $MODE_ZFCP ] && echo -n " zfcp"
|
||||
[ $MODE_ZNET ] && echo -n " znet"
|
||||
echo
|
||||
fi
|
||||
|
||||
[ $MODE_DASD ] && process_config_file $DASDCONFIG
|
||||
[ $MODE_ZFCP ] && process_config_file $ZFCPCONFIG
|
||||
|
||||
if [ $MODE_DASD ]; then
|
||||
# process the device list defined as option for the dasd module
|
||||
DEVICES=$(modprobe --showconfig | LANG=C grep "options[[:space:]]\+dasd_mod" | \
|
||||
sed -e 's/.*[[:space:]]dasd=\([^[:space:]]*\).*/\1/' -e 's/([^)]*)//g' \
|
||||
-e 's/nopav\|nofcx\|autodetect\|probeonly//g' -e 's/,,/,/g' -e 's/^,//' -e 's/,$//')
|
||||
|
||||
for DEVRANGE in $(echo $DEVICES | sed 's/,/ /g'); do
|
||||
free_device $DEVRANGE
|
||||
done
|
||||
fi
|
||||
|
||||
if [ $MODE_ZNET ]; then
|
||||
# process the config file
|
||||
if [ -f "$ZNETCONFIG" ]; then
|
||||
while read line; do
|
||||
case $line in
|
||||
\#*) ;;
|
||||
*)
|
||||
[ -z "$line" ] && continue
|
||||
# grep 2 or 3 channels from each "<nettype>,<subchannels>,<options>" line
|
||||
DEVICES=$(echo $line | LANG=C grep -E -i -o "([0-9]\.[0-9]\.[a-f0-9]+,){1,2}([0-9]\.[0-9]\.[a-f0-9]+)")
|
||||
free_device $DEVICES
|
||||
;;
|
||||
esac
|
||||
done < "$ZNETCONFIG"
|
||||
fi
|
||||
# process channels from network interface configurations
|
||||
if [ -z "$__sed_discard_ignored_files" ]; then
|
||||
if [ -f /etc/init.d/functions ]; then
|
||||
. /etc/init.d/functions
|
||||
else
|
||||
# default value copied from initscripts 9.03.10
|
||||
__sed_discard_ignored_files='/\(~\|\.bak\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d'
|
||||
fi
|
||||
fi
|
||||
for line in $(LANG=C grep -E -i -h \
|
||||
"^[[:space:]]*SUBCHANNELS=['\"]?([0-9]\.[0-9]\.[a-f0-9]+,){1,2}([0-9]\.[0-9]\.[a-f0-9]+)['\"]?([[:space:]]+#|[[:space:]]*$)" \
|
||||
$( (ls /etc/sysconfig/network-scripts/ifcfg-* 2> /dev/null || echo "__no_config_file") | \
|
||||
LC_ALL=C sed -e "$__sed_discard_ignored_files") 2> /dev/null)
|
||||
do
|
||||
eval "$line"
|
||||
free_device $SUBCHANNELS
|
||||
done
|
||||
for line in $(LANG=C grep -E -i -h \
|
||||
"^s390-subchannels=([0-9]\.[0-9]\.[a-f0-9]+;){2,3}$" \
|
||||
$( (ls /etc/NetworkManager/system-connections/*.nmconnection 2> /dev/null || echo "__no_config_file") | \
|
||||
LC_ALL=C sed -e "$__sed_discard_ignored_files") 2> /dev/null)
|
||||
do
|
||||
SUBCHANNELS="$(echo $line | sed -e "s/s390-subchannels=//" -e "s/;/,/g")"
|
||||
free_device $SUBCHANNELS
|
||||
done
|
||||
fi
|
||||
|
||||
[ -z "$ALL_DEVICES" ] && exit 0
|
||||
|
||||
wait_on_devices
|
@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Free all devices on startup
|
||||
DefaultDependencies=no
|
||||
Before=sysinit.target systemd-udev-trigger.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/usr/sbin/device_cio_free
|
||||
|
||||
[Install]
|
||||
WantedBy=sysinit.target
|
@ -0,0 +1,120 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright 2012 Red Hat, Inc.
|
||||
# License: GPLv2
|
||||
# Author: Jesse Keating <jkeating@redhat.com>
|
||||
#
|
||||
# Normalize DASD data into valid dasd.conf format
|
||||
#
|
||||
# Standard input should be the DASD argument
|
||||
# Standard otuput is the properly formatted content
|
||||
#
|
||||
# it is used in
|
||||
# dracut generated initramfs
|
||||
#
|
||||
# Much of this code was salvaged from linuxrc.s390 from Anaconda:
|
||||
#
|
||||
# License GPLv2+
|
||||
#
|
||||
# Copyright (C) 2000-2004 by
|
||||
# Bernhard Rosenkraenzer <bero@redhat.com>
|
||||
# Oliver Paukstadt <opaukstadt@millenux.com>
|
||||
# Karsten Hopp <karsten@redhat.de>
|
||||
# Florian La Roche <laroche@redhat.com>
|
||||
# Nils Philippsen <nils@redhat.de>
|
||||
# Helge Deller <hdeller@redhat.de>
|
||||
# David Sainty <dsainty@redhat.com>
|
||||
# Copyright (C) IBM Corp. 2008,2009
|
||||
# Author: Steffen Maier <maier@de.ibm.com>
|
||||
|
||||
|
||||
function canonicalize_devno()
|
||||
{
|
||||
case ${#1} in
|
||||
3) echo "0.0.0${1}" ;;
|
||||
4) echo "0.0.${1}" ;;
|
||||
*) echo "${1}" ;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
|
||||
read DASD
|
||||
# See if we've gotten a format like <dev>,feature or <dev>,<dev>,<dev>
|
||||
[[ "$DASD" =~ (\,*=[[:digit:]]) ]]
|
||||
case $? in
|
||||
# case of 0 is features, just turn the comma into a space
|
||||
0) echo $DASD |sed 's/,/ /g';;
|
||||
*) # We've got no features, do things normally
|
||||
for dasditem in $(echo $DASD |sed 's/,/ /g')
|
||||
do
|
||||
unset range features lo hi attrs devno lodevno hidevno devbusid sys
|
||||
case $dasditem in
|
||||
autodetect|probeonly|nopav|nofcx|"") continue ;; # these don't gen a config
|
||||
*)
|
||||
IFS='('
|
||||
read range features <<< "$dasditem"
|
||||
unset IFS
|
||||
lo=${range%%-*}
|
||||
[[ "$lo" =~ (^[[:xdigit:]]+\.[0-3]\.[[:xdigit:]]{4}$)|(^[[:xdigit:]]{3,4}$) ]]
|
||||
case $? in
|
||||
0) # string matched the pattern
|
||||
lo=$(canonicalize_devno $lo) ;;
|
||||
1) # string did not match the pattern
|
||||
echo $"Incorrect format for lower bound of DASD range $range: $lo" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
2) echo "l.$LINENO: syntax error in regex of match operator =~, code needs to be fixed" 1>&2 ;;
|
||||
*) echo "l.$LINENO: unexpected return code of regex match operator =~, code needs to be fixed" 1>&2 ;;
|
||||
esac
|
||||
if [ "${range//*-*/}" = "" ]; then
|
||||
hi=${range##*-}
|
||||
[[ "$hi" =~ (^[[:xdigit:]]+\.[0-3]\.[[:xdigit:]]{4}$)|(^[[:xdigit:]]{3,4}$) ]]
|
||||
case $? in
|
||||
0) # string matched the pattern
|
||||
hi=$(canonicalize_devno $hi)
|
||||
if [ "${lo%.*}" != "${hi%.*}" ]; then
|
||||
echo $"Prefixes of DASD range $range do not match: ${lo%.*} != ${hi%.*}" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
1) # string did not match the pattern
|
||||
echo $"Incorrect format for upper bound of DASD range $range: $hi" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
2) echo "l.$LINENO: syntax error in regex of match operator =~, code needs to be fixed" 1>&2 ;;
|
||||
*) echo "l.$LINENO: unexpected return code of regex match operator =~, code needs to be fixed" 1>&2 ;;
|
||||
esac
|
||||
fi
|
||||
if [ "${features//*)/}" != "" ]; then
|
||||
echo $"Missing closing parenthesis at features of DASD range $range: ($features" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
if [ -n "$features" ]; then
|
||||
attrs=""
|
||||
features="${features%)}"
|
||||
for feature in $(echo $features |sed 's/:/\n/g'); do
|
||||
case $feature in
|
||||
ro) attrs=$attrs" readonly" ;;
|
||||
diag) attrs=$attrs" use_diag" ;;
|
||||
erplog|failfast) attrs=$attrs" "$feature ;;
|
||||
*) echo $"Unknown DASD feature for device range $range: $feature" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
[ -z "$hi" ] && hi=$lo
|
||||
lodevno=$((0x${lo##*.}))
|
||||
hidevno=$((0x${hi##*.}))
|
||||
for ((devno=$lodevno; $devno <= $hidevno; ++devno)); do
|
||||
devbusid=$(printf "%s.%04x" ${lo%.*} $devno)
|
||||
echo -n "$devbusid"
|
||||
for attr in $attrs; do
|
||||
echo -n " $attr=1"
|
||||
done
|
||||
echo
|
||||
done
|
||||
esac
|
||||
done
|
||||
;;
|
||||
esac
|
@ -0,0 +1,348 @@
|
||||
From a17c57bf2b7b6d64a509cb5fb02fe46849bc550c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
|
||||
Date: Mon, 20 Jun 2022 17:43:05 +0200
|
||||
Subject: [PATCH 1/2] Revert "zipl/src: Implement sorting bls entries by
|
||||
versions"
|
||||
|
||||
This reverts commit a0dba6bfdb50ff373fa710ffe2a307cc0748f18b.
|
||||
---
|
||||
zipl/src/scan.c | 139 ++----------------------------------------------
|
||||
1 file changed, 3 insertions(+), 136 deletions(-)
|
||||
|
||||
diff --git a/zipl/src/scan.c b/zipl/src/scan.c
|
||||
index 0cea1d4..9352f76 100644
|
||||
--- a/zipl/src/scan.c
|
||||
+++ b/zipl/src/scan.c
|
||||
@@ -10,7 +10,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
-static const char *VERSION_KEYWORD = "version";
|
||||
|
||||
/* Need ISOC99 function isblank() in ctype.h */
|
||||
#ifndef __USE_ISOC99
|
||||
@@ -646,7 +645,7 @@ scan_file(const char* filename, struct scan_token** token)
|
||||
|
||||
|
||||
static int
|
||||
-bls_filter_by_names(const struct dirent *ent)
|
||||
+bls_filter(const struct dirent *ent)
|
||||
{
|
||||
int offset = strlen(ent->d_name) - strlen(".conf");
|
||||
|
||||
@@ -656,111 +655,13 @@ bls_filter_by_names(const struct dirent *ent)
|
||||
return strncmp(ent->d_name + offset, ".conf", strlen(".conf")) == 0;
|
||||
}
|
||||
|
||||
-struct version {
|
||||
- char *line; /* pointer to a line with version keyword */
|
||||
- int offset; /* offset of version value in the line */
|
||||
-};
|
||||
-
|
||||
-/*
|
||||
- * Locate version in bls file represented by ENT
|
||||
- */
|
||||
-static void get_version(const struct dirent *ent, struct version *v)
|
||||
-{
|
||||
- char *line = NULL;
|
||||
- size_t len = 0;
|
||||
- char *d_name;
|
||||
- FILE *stream;
|
||||
- ssize_t read;
|
||||
-
|
||||
- memset(v, 0, sizeof(*v));
|
||||
- d_name = misc_make_path((char *)blsdir, (char *)ent->d_name);
|
||||
- if (!d_name)
|
||||
- return;
|
||||
-
|
||||
- stream = fopen(d_name, "r");
|
||||
- free(d_name);
|
||||
- if (!stream)
|
||||
- return;
|
||||
-
|
||||
- while ((read = getline(&line, &len, stream)) != -1) {
|
||||
- if (line[read - 1] == '\n') {
|
||||
- line[read - 1] = '\0';
|
||||
- read--;
|
||||
- }
|
||||
- if ((size_t)read <= strlen(VERSION_KEYWORD) + 1)
|
||||
- continue;
|
||||
- if (strcmp(VERSION_KEYWORD, line) > 0)
|
||||
- continue;
|
||||
- if (!isblank(line[strlen(VERSION_KEYWORD)]))
|
||||
- continue;
|
||||
- /* skip blanks */
|
||||
- v->offset = strlen(VERSION_KEYWORD) + 1;
|
||||
- while (v->offset < read - 1 && isblank(line[v->offset]))
|
||||
- v->offset++;
|
||||
- if (isblank(line[v->offset]))
|
||||
- /*
|
||||
- * all characters after the keyword
|
||||
- * are blanks. Invalid version
|
||||
- */
|
||||
- continue;
|
||||
- v->line = line;
|
||||
- fclose(stream);
|
||||
- return;
|
||||
- }
|
||||
- free(line);
|
||||
- fclose(stream);
|
||||
-}
|
||||
-
|
||||
-static void put_version(struct version *v)
|
||||
-{
|
||||
- free(v->line);
|
||||
-}
|
||||
-
|
||||
-/**
|
||||
- * Check version in bls file represented by ENT.
|
||||
- * Return 1 if version is valid. Otherwise return 0
|
||||
- */
|
||||
-static int bls_filter_by_versions(const struct dirent *ent)
|
||||
-{
|
||||
- struct version v;
|
||||
-
|
||||
- if (bls_filter_by_names(ent) == 0)
|
||||
- return 0;
|
||||
-
|
||||
- get_version(ent, &v);
|
||||
- if (v.line) {
|
||||
- put_version(&v);
|
||||
- return 1;
|
||||
- }
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
|
||||
static int
|
||||
-bls_sort_by_names(const struct dirent **ent_a, const struct dirent **ent_b)
|
||||
+bls_sort(const struct dirent **ent_a, const struct dirent **ent_b)
|
||||
{
|
||||
return strverscmp((*ent_a)->d_name, (*ent_b)->d_name);
|
||||
}
|
||||
|
||||
-static int
|
||||
-bls_sort_by_versions(const struct dirent **ent_a, const struct dirent **ent_b)
|
||||
-{
|
||||
- struct version v1, v2;
|
||||
- int ret;
|
||||
-
|
||||
- get_version(*ent_a, &v1);
|
||||
- get_version(*ent_b, &v2);
|
||||
- /*
|
||||
- * Both versions are valid.
|
||||
- * It is guaranteed by bls_filter_by_versions()
|
||||
- */
|
||||
- ret = strverscmp(v1.line + v1.offset, v2.line + v2.offset);
|
||||
-
|
||||
- put_version(&v1);
|
||||
- put_version(&v2);
|
||||
-
|
||||
- return ret;
|
||||
-}
|
||||
|
||||
static int
|
||||
scan_append_section_heading(struct scan_token* scan, int* index, char* name);
|
||||
@@ -1110,40 +1011,6 @@ scan_count_target_keywords(char* keyword[])
|
||||
return num;
|
||||
}
|
||||
|
||||
-static int bls_scandir(struct dirent ***bls_entries)
|
||||
-{
|
||||
- struct dirent **entries1;
|
||||
- struct dirent **entries2;
|
||||
- int n1, n2;
|
||||
-
|
||||
- /* arrange by names */
|
||||
- n1 = scandir(blsdir, &entries1,
|
||||
- bls_filter_by_names, bls_sort_by_names);
|
||||
- if (n1 <= 0)
|
||||
- return n1;
|
||||
- /* arrange by versions */
|
||||
- n2 = scandir(blsdir, &entries2,
|
||||
- bls_filter_by_versions, bls_sort_by_versions);
|
||||
-
|
||||
- if (n2 <= 0 || n2 < n1) {
|
||||
- /*
|
||||
- * failed to sort by versions,
|
||||
- * fall back to sorting by filenames
|
||||
- */
|
||||
- *bls_entries = entries1;
|
||||
- while (n2--)
|
||||
- free(entries2[n2]);
|
||||
- free(entries2);
|
||||
- return n1;
|
||||
- }
|
||||
- /* use arrangement by versions */
|
||||
- *bls_entries = entries2;
|
||||
- while (n1--)
|
||||
- free(entries1[n1]);
|
||||
- free(entries1);
|
||||
- return n2;
|
||||
-}
|
||||
-
|
||||
int
|
||||
scan_check_target_data(char* keyword[], int* line)
|
||||
{
|
||||
@@ -1464,7 +1331,7 @@ int scan_bls(struct scan_token **token, int scan_size)
|
||||
if (!(stat(blsdir, &sb) == 0 && S_ISDIR(sb.st_mode)))
|
||||
return 0;
|
||||
|
||||
- n = bls_scandir(&bls_entries);
|
||||
+ n = scandir(blsdir, &bls_entries, bls_filter, bls_sort);
|
||||
if (n <= 0)
|
||||
return n;
|
||||
|
||||
--
|
||||
2.37.3
|
||||
|
||||
|
||||
From 7a51cfc15b870d90bffe1e24a1da922663ffe1d7 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Jones <pjones@redhat.com>
|
||||
Date: Mon, 20 Jun 2022 17:46:59 +0200
|
||||
Subject: [PATCH 2/2] blscfg: sort like rpm nvr, not like a single version
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||||
Signed-off-by: Dan Horák <dan@danny.cz>
|
||||
---
|
||||
zipl/src/Makefile | 1 +
|
||||
zipl/src/scan.c | 96 ++++++++++++++++++++++++++++++++++++++++++++++-
|
||||
2 files changed, 95 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/zipl/src/Makefile b/zipl/src/Makefile
|
||||
index 64eabe4..7043005 100644
|
||||
--- a/zipl/src/Makefile
|
||||
+++ b/zipl/src/Makefile
|
||||
@@ -9,6 +9,7 @@ ALL_LDFLAGS += -Wl,-z,noexecstack $(NO_PIE_LDFLAGS)
|
||||
|
||||
libs = $(rootdir)/libutil/libutil.a \
|
||||
$(rootdir)/libvtoc/libvtoc.a \
|
||||
+ -lrpmio -lrpm
|
||||
|
||||
objects = misc.o error.o scan.o job.o boot.o bootmap.o fs-map.o disk.o \
|
||||
bootmap_header.o envblk.o install.o zipl.o $(rootdir)/zipl/boot/data.o
|
||||
diff --git a/zipl/src/scan.c b/zipl/src/scan.c
|
||||
index 9352f76..3327e2d 100644
|
||||
--- a/zipl/src/scan.c
|
||||
+++ b/zipl/src/scan.c
|
||||
@@ -35,6 +35,8 @@
|
||||
|
||||
#include "lib/util_base.h"
|
||||
|
||||
+#include <rpm/rpmlib.h>
|
||||
+
|
||||
#include "boot.h"
|
||||
#include "error.h"
|
||||
#include "misc.h"
|
||||
@@ -655,13 +657,103 @@ bls_filter(const struct dirent *ent)
|
||||
return strncmp(ent->d_name + offset, ".conf", strlen(".conf")) == 0;
|
||||
}
|
||||
|
||||
+/* returns name/version/release */
|
||||
+/* NULL string pointer returned if nothing found */
|
||||
+static void
|
||||
+split_package_string (char *package_string, char **name,
|
||||
+ char **version, char **release)
|
||||
+{
|
||||
+ char *package_version, *package_release;
|
||||
+
|
||||
+ /* Release */
|
||||
+ package_release = strrchr (package_string, '-');
|
||||
+
|
||||
+ if (package_release != NULL)
|
||||
+ *package_release++ = '\0';
|
||||
+
|
||||
+ *release = package_release;
|
||||
+
|
||||
+ /* Version */
|
||||
+ package_version = strrchr(package_string, '-');
|
||||
+
|
||||
+ if (package_version != NULL)
|
||||
+ *package_version++ = '\0';
|
||||
+
|
||||
+ *version = package_version;
|
||||
+ /* Name */
|
||||
+ *name = package_string;
|
||||
+
|
||||
+ /* Bubble up non-null values from release to name */
|
||||
+ if (name != NULL && *name == NULL) {
|
||||
+ *name = (*version == NULL ? *release : *version);
|
||||
+ *version = *release;
|
||||
+ *release = NULL;
|
||||
+ }
|
||||
+ if (*version == NULL) {
|
||||
+ *version = *release;
|
||||
+ *release = NULL;
|
||||
+ }
|
||||
+}
|
||||
|
||||
static int
|
||||
-bls_sort(const struct dirent **ent_a, const struct dirent **ent_b)
|
||||
+split_cmp(char *nvr0, char *nvr1, int has_name)
|
||||
+{
|
||||
+ int ret = 0;
|
||||
+ char *name0, *version0, *release0;
|
||||
+ char *name1, *version1, *release1;
|
||||
+
|
||||
+ split_package_string(nvr0, has_name ? &name0 : NULL, &version0, &release0);
|
||||
+ split_package_string(nvr1, has_name ? &name1 : NULL, &version1, &release1);
|
||||
+
|
||||
+ if (has_name) {
|
||||
+ ret = rpmvercmp(name0 == NULL ? "" : name0,
|
||||
+ name1 == NULL ? "" : name1);
|
||||
+ if (ret != 0)
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ ret = rpmvercmp(version0 == NULL ? "" : version0,
|
||||
+ version1 == NULL ? "" : version1);
|
||||
+ if (ret != 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ ret = rpmvercmp(release0 == NULL ? "" : release0,
|
||||
+ release1 == NULL ? "" : release1);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+/* return 1: filename0 is newer than filename1 */
|
||||
+/* 0: filename0 and filename1 are the same version */
|
||||
+/* -1: filename1 is newer than filename0 */
|
||||
+static int bls_cmp(const char *filename0, const char *filename1)
|
||||
{
|
||||
- return strverscmp((*ent_a)->d_name, (*ent_b)->d_name);
|
||||
+ char *id0, *id1;
|
||||
+ int l, r;
|
||||
+
|
||||
+ id0 = strdup(filename0);
|
||||
+ id1 = strdup(filename1);
|
||||
+
|
||||
+ l = strlen(id0);
|
||||
+ if (l > 5 && strcmp(id0 + l - 5, ".conf"))
|
||||
+ id0[l-5] = '\0';
|
||||
+
|
||||
+ l = strlen(id1);
|
||||
+ if (l > 5 && strcmp(id1 + l - 5, ".conf"))
|
||||
+ id1[l-5] = '\0';
|
||||
+
|
||||
+ r = split_cmp(id0, id1, 1);
|
||||
+
|
||||
+ free(id0);
|
||||
+ free(id1);
|
||||
+
|
||||
+ return r;
|
||||
}
|
||||
|
||||
+static int
|
||||
+bls_sort(const struct dirent **ent_a, const struct dirent **ent_b)
|
||||
+{
|
||||
+ return bls_cmp((*ent_a)->d_name, (*ent_b)->d_name);
|
||||
+}
|
||||
|
||||
static int
|
||||
scan_append_section_heading(struct scan_token* scan, int* index, char* name);
|
||||
--
|
||||
2.37.3
|
||||
|
@ -0,0 +1,84 @@
|
||||
From 2faae5cf51c49e3f166b8526eee276dab2fe7308 Mon Sep 17 00:00:00 2001
|
||||
From: Javier Martinez Canillas <javierm@redhat.com>
|
||||
Date: Wed, 30 May 2018 14:33:25 +0200
|
||||
Subject: [PATCH] zipl-switch-to-blscfg: invert ignore-default and
|
||||
use-version-name options
|
||||
|
||||
These options were added because the zipl maintainers wanted a different
|
||||
default behaviour for the migration script than the one we use. Instead
|
||||
of requiring to always use these options, just invert the logic for us.
|
||||
|
||||
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
|
||||
---
|
||||
scripts/zipl-switch-to-blscfg | 16 +++++++++-------
|
||||
scripts/zipl-switch-to-blscfg.1 | 8 ++++----
|
||||
2 files changed, 13 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/scripts/zipl-switch-to-blscfg b/scripts/zipl-switch-to-blscfg
|
||||
index 871935c783f..d8d5eca5867 100755
|
||||
--- a/scripts/zipl-switch-to-blscfg
|
||||
+++ b/scripts/zipl-switch-to-blscfg
|
||||
@@ -57,14 +57,14 @@ Options:
|
||||
--backup-suffix=SUFFIX suffix used for backup files, defaults to .bak
|
||||
--bls-directory=DIR path to generate BLS files, defaults to /boot/loader/entries
|
||||
--config-file=FILE path to zipl configuration file, defaults to /etc/zipl.conf
|
||||
- --ignore-default ignore the default option from the zipl configuration file
|
||||
- --use-version-name use the section kernel version as the BLS file name
|
||||
+ --leave-default leave the default option from the zipl configuration file
|
||||
+ --use-section-name use the section name as the BLS file name
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
OPTS="$(getopt -o hv --long help,version,backup-suffix:,bls-directory:,config-file:,\
|
||||
-ignore-default,use-version-name -n \'$SCRIPTNAME\' -- "$@")"
|
||||
+leave-default,use-section-name -n \'$SCRIPTNAME\' -- "$@")"
|
||||
eval set -- "$OPTS"
|
||||
|
||||
BACKUP_SUFFIX=.bak
|
||||
@@ -73,6 +73,8 @@ CMDLINE_LINUX_DEBUG=" systemd.log_level=debug systemd.log_target=kmsg"
|
||||
LINUX_DEBUG_VERSION_POSTFIX="_with_debugging"
|
||||
LINUX_DEBUG_TITLE_POSTFIX=" with debugging"
|
||||
CONFIG="/etc/zipl.conf"
|
||||
+ignore_default=true
|
||||
+version_name=true
|
||||
|
||||
while [ ${#} -gt 0 ]; do
|
||||
case "$1" in
|
||||
@@ -96,11 +98,11 @@ while [ ${#} -gt 0 ]; do
|
||||
CONFIG=${2}
|
||||
shift
|
||||
;;
|
||||
- --ignore-default)
|
||||
- ignore_default=true
|
||||
+ --leave-default)
|
||||
+ ignore_default=false
|
||||
;;
|
||||
- --use-version-name)
|
||||
- version_name=true
|
||||
+ --use-section-name)
|
||||
+ version_name=false
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
diff --git a/scripts/zipl-switch-to-blscfg.8 b/scripts/zipl-switch-to-blscfg.8
|
||||
index 6bd14d00d14..71b904ffd1c 100644
|
||||
--- a/scripts/zipl-switch-to-blscfg.8
|
||||
+++ b/scripts/zipl-switch-to-blscfg.8
|
||||
@@ -37,9 +37,9 @@ The DIRECTORY where the BLS fragments will be generated. The directory is create
|
||||
The FILE used for zipl configuration file, defaults to /etc/zipl.conf.
|
||||
|
||||
.TP
|
||||
-\fB\-\-ignore-default\fP
|
||||
-Ignore the default option from the zipl configuration file
|
||||
+\fB\-\-leave-default\fP
|
||||
+Leave the default option from the zipl configuration file
|
||||
|
||||
.TP
|
||||
-\fB\-\-use-version-name\fP
|
||||
-Use the section kernel version as the BLS file name
|
||||
+\fB\-\-use-section-name\fP
|
||||
+Use the section name as the BLS file name
|
||||
--
|
||||
2.17.0
|
||||
|
@ -0,0 +1,35 @@
|
||||
From a9fed51fbf159a98fcd4a9dddf4fef243bb433af Mon Sep 17 00:00:00 2001
|
||||
From: Ingo Franzki <ifranzki@linux.ibm.com>
|
||||
Date: Fri, 20 Jan 2023 11:04:18 +0100
|
||||
Subject: [PATCH] zkey: Support EP11 host library version 4 (#2165812)
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Try to load libep11.so.4 if available, but fallback to older
|
||||
library versions if not.
|
||||
|
||||
Reviewed-by: Jörg Schmidbauer <jschmidb@de.ibm.com>
|
||||
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
|
||||
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
|
||||
(cherry picked from commit 6222c384958729bc4b5bad61ad38967647cc3248)
|
||||
---
|
||||
zkey/ep11.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/zkey/ep11.c b/zkey/ep11.c
|
||||
index 58dc3c5..8359929 100644
|
||||
--- a/zkey/ep11.c
|
||||
+++ b/zkey/ep11.c
|
||||
@@ -35,7 +35,7 @@
|
||||
* Definitions for the EP11 library
|
||||
*/
|
||||
#define EP11_LIBRARY_NAME "libep11.so"
|
||||
-#define EP11_LIBRARY_VERSION 3
|
||||
+#define EP11_LIBRARY_VERSION 4
|
||||
#define EP11_WEB_PAGE "http://www.ibm.com/security/cryptocards"
|
||||
|
||||
/**
|
||||
--
|
||||
2.39.1
|
||||
|
@ -0,0 +1 @@
|
||||
KERNEL=="zfcp", RUN+="/sbin/zfcpconf.sh"
|
@ -0,0 +1,77 @@
|
||||
#!/bin/sh
|
||||
|
||||
# config file syntax:
|
||||
# deviceno WWPN FCPLUN
|
||||
# deviceno # allowed when auto LUN scan is enabled and port is in NPIV mode
|
||||
#
|
||||
# Example:
|
||||
# 0.0.4000 0x5005076300C213e9 0x5022000000000000
|
||||
# 0.0.4001 0x5005076300c213e9 0x5023000000000000
|
||||
# 0.0.5000
|
||||
#
|
||||
#
|
||||
# manual setup:
|
||||
# modprobe zfcp
|
||||
# echo 1 > /sys/bus/ccw/drivers/zfcp/0.0.4000/online
|
||||
# echo LUN > /sys/bus/ccw/drivers/zfcp/0.0.4000/WWPN/unit_add
|
||||
#
|
||||
# Example:
|
||||
# modprobe zfcp
|
||||
# echo 1 > /sys/bus/ccw/drivers/zfcp/0.0.4000/online
|
||||
# echo 0x5022000000000000 > /sys/bus/ccw/drivers/zfcp/0.0.4000/0x5005076300c213e9/unit_add
|
||||
|
||||
CONFIG=/etc/zfcp.conf
|
||||
PATH=/bin:/sbin
|
||||
|
||||
set_online()
|
||||
{
|
||||
DEVICE=$1
|
||||
|
||||
[ `cat /sys/bus/ccw/drivers/zfcp/${DEVICE}/online` = "0" ] \
|
||||
&& echo 1 > /sys/bus/ccw/drivers/zfcp/${DEVICE}/online
|
||||
}
|
||||
|
||||
if [ -f "$CONFIG" ]; then
|
||||
if [ ! -d /sys/bus/ccw/drivers/zfcp ]; then
|
||||
modprobe zfcp
|
||||
fi
|
||||
if [ ! -d /sys/bus/ccw/drivers/zfcp ]; then
|
||||
exit 1
|
||||
fi
|
||||
sed 'y/ABCDEF/abcdef/' < $CONFIG | while read line; do
|
||||
case $line in
|
||||
\#*) ;;
|
||||
*)
|
||||
[ -z "$line" ] && continue
|
||||
set $line
|
||||
if [ $# -eq 1 ]; then
|
||||
DEVICE=${1##*0x}
|
||||
if [ `cat /sys/module/zfcp/parameters/allow_lun_scan` = "Y" ]; then
|
||||
set_online ${DEVICE}
|
||||
grep -q NPIV /sys/bus/ccw/devices/${DEVICE}/host*/fc_host/host*/port_type || \
|
||||
echo "Error: Only device ID (${DEVICE}) given, but port not in NPIV mode"
|
||||
else
|
||||
echo "Error: Only device ID (${DEVICE}) given, but LUN scan is disabled for the zfcp module"
|
||||
fi
|
||||
continue
|
||||
fi
|
||||
if [ $# -eq 5 ]; then
|
||||
DEVICE=$1
|
||||
SCSIID=$2
|
||||
WWPN=$3
|
||||
SCSILUN=$4
|
||||
FCPLUN=$5
|
||||
echo "Warning: Deprecated values in /etc/zfcp.conf, ignoring SCSI ID $SCSIID and SCSI LUN $SCSILUN"
|
||||
elif [ $# -eq 3 ]; then
|
||||
DEVICE=${1##*0x}
|
||||
WWPN=$2
|
||||
FCPLUN=$3
|
||||
fi
|
||||
set_online ${DEVICE}
|
||||
[ ! -d /sys/bus/ccw/drivers/zfcp/${DEVICE}/${WWPN}/${FCPLUN} ] \
|
||||
&& echo $FCPLUN > /sys/bus/ccw/drivers/zfcp/${DEVICE}/${WWPN}/unit_add
|
||||
;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
exit 0
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue