s390-tools/xpram
Nikolay Gueorguiev 6a6c0cb679 * Upgrade s390-tools to version 2.34 (jsc#PED-3223,jsc#PED-9591)
*** v2.34.0
* Changes of existing tools:
  - ap_tools/ap-check: Add support for vfio-ap dynamic configuration
  - dbginfo.sh: Update/Add additional DASD data collection
  - dumpconf: Add new parameter 'SCP_DATA' for SCSI/NVMe/ECKD dump devices
  - libutil: Make formatted meta-data configurable
  - s390-tools: Replace 'which' with built-in 'command -v'
  - zdump/dfi_elf: Support core dumps of vr-kernels
* Bug Fixes:
  - chzdev: Fix warning about failed ATTR writes by udev
  - rust/pv: Try again if first CRL-URI is invalid
  - rust/pvattest: Add short option for --arpk
  - zdump: Fix 'zgetdump -i' ioctl error on s390 formatted dump file
*** v2.33.1
* Bug Fixes:
  - s390-tools: Fix formatting and typos in README.md
  - s390-tools: Fix release string
*** v2.33.0
* Add new tools / libraries:
  - chpstat: New tool for displaying channel path statistics
  - libutil: Add output format helpers(util_fmt: JSON, JSON-SEQ, CSV, text pairs)
* Changes of existing tools / libraries:
  - chzdev: Add --is-owner to identify files created by zdev
  - dasdfmt: Change default mode to always use full-format (Note: affects ESE DASD)
  - libap: Significantly reduce delay time between file lock retries
  - pvattest: Rewrite from C to Rust
  - pvattest: Support additional data & user-data
  - rust/pv: Support for Attestation
* Bug Fixes:
  - chreipl: Improve disk type detection when running under QEMU
  - dbginfo.sh: Use POSIX option with uname
  - s390-tools: Fix missing hyphen escapes in the man page for many tools
  - zipl/src: Fix bugs in disk_get_info() reproducible in corner cases
 *** v2.32.0
* Changes of existing tools:
  - cpumf/lscpumf: add support for machine type 3932
  - genprotimg, pvattest, and pvsecret accept IBM signing key with Armonk as
    subject locality
  - zdump/zipl: Support for List-Directed dump from ECKD DASD
  - zkey: Detect FIPS mode and generate PBKDF for luksFormat according to it
* Bug Fixes:
  - dbginfo.sh: dash compatible copy sequence
  - rust/pv_core: Fix UvDeviceInfo::get() method
  - zipl/src: Fix leak of files if run with a broken configuration
  - zkey: Fix convert command to accept only keys of type CCA-AESDATA
* Revendored vendor.tar.gz
* Removed obsolete patches
  - s390-tools-sles15sp5-01-rust-pv-support-Armonk-in-IBM-signing-key-subject.patch
  - s390-tools-sles15sp6-02-genprotimg-support-Armonk-in-IBM-signing-key-subject.patch
  - s390-tools-sles15sp6-03-libpv-support-Armonk-in-IBM-signing-key-subject.patch
  - s390-tools-sles15sp6-04-pvattest-Fix-root-ca-parsing.patch
  - s390-tools-sles15sp6-genprotimg-makefile.patch

OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=219
2024-08-20 08:44:18 +00:00

182 lines
4.0 KiB
Bash

#! /bin/sh
# Copyright (c) 2004 SUSE LINUX AG Nuernberg, Germany.
#
# Submit feedback to http://www.suse.de/feedback/
#
# System startup script for XPRAM device driver
XPRAM_CONFIG_FILE=/etc/sysconfig/xpram
read_config_file() {
if [ config_read = 1 ]; then
return 0
fi
file=$XPRAM_CONFIG_FILE
if [ -s "$file" ]; then
source $file
config_read=1
else
echo -ne "Cannot read $file: empty or nonexistant! "
# Means not configured:
return 6
fi
}
prepare_xpram() {
if [ -z "$XPRAM_MNTPATH" -o -z "$XPRAM_DEVNODE" ]; then
echo -n "Cannot mkfs/mount XPRAM: Missing parameters! "
exit 6
fi
grep -q $XPRAM_DEVNODE /proc/mounts 2>&1 > /dev/null
if [ $? -eq 0 ] ; then
echo -n "$service: $XPRAM_DEVNODE already mounted! "
return
fi
current_fstype=`vol_id -t $XPRAM_DEVNODE 2> /dev/null`
if [ $? -ne 0 -o "$XPRAM_FORCE" = "yes" ]
then
# Does not contain a valid filesystem/swap space
if [ "$XPRAM_FSTYPE" = swap ]
then
mkswap $XPRAM_DEVNODE
else
mkfs -t "$XPRAM_FSTYPE" -b 4096 "$XPRAM_DEVNODE"
fi
sleep 1 # workaround
current_fstype=$XPRAM_FSTYPE
fi
if [ ! "$current_fstype" = "$XPRAM_FSTYPE" ]
then
echo
echo -n "Warning: current filessystem and configured filesystem are not the same!"
exit 6
fi
if [ "$XPRAM_FSTYPE" = swap ]
then
if [ "$XPRAM_SWAP_PRI" = "" ]
then
swapon $XPRAM_DEVNODE
else
swapon -p $XPRAM_SWAP_PRI $XPRAM_DEVNODE
fi
else
if [ ! -d "$XPRAM_MNTPATH" ]
then
mkdir -p "$XPRAM_MNTPATH"
fi
mount "$XPRAM_DEVNODE" "$XPRAM_MNTPATH"
if [ $? -ne 0 ]
then
echo -n "Mount failed with error code $?"
exit 6
fi
fi
}
# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - generic or unspecified error
# 2 - invalid or excess argument(s)
# 3 - unimplemented feature (e.g. "reload")
# 4 - insufficient privilege
# 5 - program is not installed
# 6 - program is not configured
# 7 - program is not running
#
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signalling is not supported) are
# considered a success.
check_config () {
if [ -z "$XPRAM_MODULE" ]; then
echo -n "$file: parameters XPRAM_MODULE missing! "
exit 6
fi
}
quit_disabled() {
if [ "$XPRAM_START" != "yes" ]; then
# Config file exists but xpram not enabled, do not complain,
# but note with exit status 6 that we are not configured.
echo "xpram not enabled"
exit 0
fi
}
service="xpram"
case "$1" in
start)
# Read in configuration
read_config_file || exit 6
quit_disabled
check_config
echo -n "Creating $service device "
modprobe "$XPRAM_MODULE"
if [ $? -ne 0 ]; then
echo -n "- failed to load $XPRAM_MODULE "
exit 1
else
prepare_xpram
fi
;;
stop)
# Read in configuration
read_config_file || exit 6
# check_enabled
# quit_disabled
echo -n "Removing $service device "
check_config
if [ "$XPRAM_DEVNODE" ]; then
if grep -q $XPRAM_DEVNODE /proc/mounts; then
umount $XPRAM_DEVNODE
fi
if swapon -s | grep -q $XPRAM_DEVNODE; then
swapoff $XPRAM_DEVNODE
fi
fi
if grep -q "$XPRAM_MODULE" /proc/modules; then
rmmod "$XPRAM_MODULE"
else
exit 7
fi
;;
status)
echo -n "Checking $service "
# Status has a slightly different meaning for the status command:
# 0 - service running
# 1 - service dead, but /var/run/ pid file exists
# 3 - service not running
# Read in configuration
read_config_file || exit 3
check_config
lsmod | grep -q $XPRAM_MODULE
if [ $? -eq 0 ]; then
if [ "$XPRAM_DEVNODE" ]; then
if ! grep -q $XPRAM_DEVNODE /proc/mounts && ! swapon -s | grep -q $XPRAM_DEVNODE; then
xpram_result=3
echo -n "loaded, but $XPRAM_DEVNODE not used"
exit 3
fi
fi
else
exit 3
fi
;;
esac