s390-tools/virtsetup.sh
Mark Post 944f52c5bb Accepting request 980529 from home:markkp:branches:Base:System
- Modifed the spec file to install all binaires in /usr/sbin instead of /sbin
  to align with the "usrmerge" initiative in openSUSE. (bsc#1195914) Also
  modified the following files that SUSE provides that need to reflect this
  change:
  *  59-graf.rules
  *  dasd_configure
  *  dasd_reload
  *  detach_disks.sh
  *  iucv_configure
  *  killcdl
  *  mkdump.pl
  *  README.SUSE
  *  s390-tools-sles12-update-by_id-links-on-change-and-add-action.patch
  *  virtsetup.sh
  *  vmlogrdr.service
- Added s390-tools-sles15sp4-libseckey-Adapt-keymgmt_match-implementation-to-Open.patch
  for bsc#1199649. zkey: KMIP plugin fails to connection to KMIP server
  When a zkey key repository is bound to the KMIP plugin, and the
  connection to the KMIP server is to be configired using command 
  'zkey kms configure --kmip-server <server>', it fails to connect
  to the specified KMIP server. 
- Added s390-tools-sles15sp4-genprotimg-boot-disable-Warray-bounds-for-now.patch
  to fix a build failure with gcc12. With gcc12, a "false positive"
  of "array subscript 0 is outside array bounds" is seen in
  genprotimg/boot/stage3a.c (bsc#1200131).

OBS-URL: https://build.opensuse.org/request/show/980529
OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=137
2022-06-02 16:42:42 +00:00

93 lines
2.3 KiB
Bash

#!/bin/sh
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# Perform setup tasks based on what hypervisor is in charge.
#
# Source the sysconfig file
if [ -r /etc/sysconfig/virtsetup ]; then
. /etc/sysconfig/virtsetup
else echo "No /etc/sysconfig/virtsetup file was found."
exit 1
fi
#
# Get our hostname
#
my_hostname="$(hostname)"
#
# Find out the hypervisor we're running on/under.
#
hypervisor="$(/usr/bin/systemd-detect-virt)"
case "${hypervisor}" in
zvm)
if [ ! -c /dev/vmcp ]; then
modprobe vmcp
sleep 1
if [ ! -c /dev/vmcp ]; then
echo "Unable to load the vmcp kernel module."
exit 1
fi
fi
echo "The vmcp device driver is ready."
if [ "${ZVM_DETACH_DISKS}" == "yes" ]; then
echo "Detaching devices to prepare for Live Guest Relocation."
/usr/lib/systemd/scripts/detach_disks.sh
fi
if [ "${ZVM_WARN_ABOUT_POSSIBLE_LGR_PROBLEMS}" == yes ]; then
/usr/sbin/lgr_check
fi
;;
none)
hypervisor="lpar"
if [ "${LPAR_SCLP_HOSTNAME}" == "yes" ]; then
# If the sclp_cpi module is already loaded, we have to unload it
# so we can be sure it has the correct system name specified
# when we reload it again.
if grep -qw sclp_cpi /proc/modules 2>/dev/null; then
rmmod sclp_cpi
sleep 1
fi
if grep -qw sclp_cpi /proc/modules 2>/dev/null; then
echo "Unable to unload the sclp_cpi kernel module."
exit 1
fi
echo "Setting the LPAR name via the sclp_cpi module."
modprobe sclp_cpi system_name="$my_hostname"
if ! grep -qw sclp_cpi /proc/modules 2>/dev/null; then
echo "We were unable to load the sclp_cpi module to set the LPAR name."
exit 2
fi
fi
;;
kvm)
;;
*)
echo "An unknown hypervisor, \"${hypervisor}\" was detected."
echo "Please report this to your support provider."
exit 3
;;
esac
#
# Now let's check for any scripts that other packages may have provided
# to do specific things they need. The scripts must be marked executable
# and have a suffix indicating which hypervisor for which they are to be run.
# Currently that is one of: kvm, lpar, or zvm.
# E.g., 01-test.script.zvm would only be run if the system is a z/VM guest.
#
for script in $(ls /lib/s390-tools/virtsetup/*.${hypervisor} 2>/dev/null)
do if [ -x "${script}" ]; then
echo "Executing ${script}..."
"${script}"
echo "Done."
echo
fi
done
exit 0