Accepting request 1073790 from home:ngueorguiev:branches:Base:System

- Added SUSE scripts
  * module-setup.sh
  * parse-zdev-suse.sh
  * write-udev-live-suse.sh

OBS-URL: https://build.opensuse.org/request/show/1073790
OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=163
This commit is contained in:
Nikolay Gueorguiev 2023-03-22 13:16:35 +00:00 committed by Git OBS Bridge
parent bff974e0d7
commit a50c71baff
5 changed files with 88 additions and 1 deletions

32
module-setup.sh Normal file
View File

@ -0,0 +1,32 @@
#!/bin/bash
# called by dracut
check() {
arch=${DRACUT_ARCH:-$(uname -m)}
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
require_binaries chzdev || return 1
[[ $hostonly ]] || return 0
# or on request
return 255
}
# called by dracut
depends() {
echo bash
return 0
}
# called by dracut
installkernel() {
instmods ctcm lcs qeth qeth_l2 qeth_l3 dasd_diag_mod dasd_eckd_mod dasd_fba_mod
}
# called by dracut
install() {
inst_hook cmdline 41 "$moddir/parse-zdev-suse.sh"
inst_hook cleanup 41 "$moddir/write-udev-live-suse.sh"
inst_multiple chzdev
}

37
parse-zdev-suse.sh Normal file
View File

@ -0,0 +1,37 @@
#!/bin/bash
for zdev in $(getargs rd.zdev -d 'rd_ZDEV='); do
IFS=, read -r z_drv z_chan znet_opts <<< "$zdev"
if [ -n "$z_drv" ] && [ "$z_drv" = "no-auto" ] ; then
: # ignore, as it's handled by 95zdev
elif [ -z "$z_drv" ] || [ -z "$z_chan" ]; then
warn "Invalid arguments for rd.zdev="
else
info "+ chzdev --persistent --enable [...] $z_drv $z_chan $z_opts"
chzdev --persistent --enable --force --yes --no-root-update --no-settle $z_drv $z_chan $z_opts
fi
done
# REMOVE everything below for FCS!
# support initial implementation only for already deployed `parmfile`s
for znet in $(getargs rd.znet -d 'rd_ZNET='); do
IFS=, read -r znet_drv znet_sc0 znet_sc1 znet_sc2 znet_options <<< "$znet"
if [ -z "$znet_drv" ] || [ -z "$znet_sc0" ] || [ -z "$znet_sc1" ] || [ -z "$znet_sc2" ] ; then
warn "Invalid arguments for rd.znet="
else
info "+ chzdev --persistent --enable $znet_drv $znet_sc0:$znet_sc1:$znet_sc2 $znet_options"
chzdev --persistent --enable --force --yes --no-root-update --no-settle $znet_drv $znet_sc0:$znet_sc1:$znet_sc2 $znet_options
fi
done
for dasd in $(getargs rd.dasd -d 'rd_DASD='); do
dasd_drv=dasd
IFS=, read -r dasd_sc0 dasd_options <<< "$dasd"
if [ -z "$dasd_sc0" ]; then
warn "Invalid arguments for rd.dasd="
else
info "+ chzdev --persistent --enable $dasd_drv $dasd_sc0 $dasd_options"
chzdev --persistent --enable --force --yes --no-root-update --no-settle $dasd_drv $dasd_sc0 $dasd_options
fi
done

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Wed Mar 22 12:13:52 UTC 2023 - Nikolay Gueorguiev <nikolay.gueorguiev@suse.com>
- Added SUSE scripts
* module-setup.sh
* parse-zdev-suse.sh
* write-udev-live-suse.sh
-------------------------------------------------------------------
Mon Mar 13 15:33:43 UTC 2023 - Nikolay Gueorguiev <nikolay.gueorguiev@suse.com>

View File

@ -104,7 +104,11 @@ Source39: vmlogrdr.service.suse
%endif
Source40: xpram.service
Source41: pkey.conf
###
Source42: module-setup.sh
Source43: parse-zdev-suse.sh
Source44: write-udev-live-suse.sh
###
### Obsolete scripts and man pages to be removed once changes in other tools are made
### That's been delayed to at least SLES12 SP1, but I'm leaving the comments here.
Source86: read_values.c

6
write-udev-live-suse.sh Normal file
View File

@ -0,0 +1,6 @@
#!/bin/sh
if [ -w /sysroot/etc/udev/rules.d ]; then
# chzdev generated device activation starts with 41 ...
cp -p /etc/udev/rules.d/41-* /sysroot/etc/udev/rules.d
fi