diff --git a/dasd_configure b/dasd_configure index 09c3dca..9603173 100644 --- a/dasd_configure +++ b/dasd_configure @@ -28,7 +28,8 @@ # 1 to use z/VM DIAG250 I/O # # Return values: -# Return codes are determined by the chzdev command. +# Return codes are determined by the chzdev command, with one exception: If a +# DASD volume is not formatted, we will issue a return code of 8. # mesg () { @@ -138,9 +139,35 @@ fi RC=${?} if [ ${RC} -ne 0 ]; then exit ${RC} +elif [ ${ON_OFF} == 1 ]; then + exitcode=0 + # Extract the full busid so that we can reference the proper entries in /sys + BUSID=$(/sbin/lszdev dasd ${CCW_CHAN_ID} | /usr/bin/sed -e 1d | /usr/bin/tr -s " " | /usr/bin/cut -f2 -d" " ) + # Make sure the DASD volume came online + for ((counter=0; counter<30; counter++)); do + sleep 0.1 + read online < /sys/bus/ccw/devices/${BUSID}/online + if [ ${online} -eq 1 ] ; then + break + fi + done + + if [ ${online} -ne 1 ]; then + debug_mesg "DASD ${CCW_CHAN_ID} did not come online." + exit 17 + fi + + # Check to see if the DASD volume is unformatted. If so, let YaST know. + read status < /sys/bus/ccw/devices/${BUSID}/status + if [ "${status}" == "unformatted" ]; then + mesg "DASD ${CCW_CHAN_ID} is unformatted." + exitcode=8 + fi fi if [ ${ON_OFF} == 1 ]; then add_cio_channel "${CCW_CHAN_ID}" else remove_cio_channel "${CCW_CHAN_ID}" fi + +exit ${exitcode} diff --git a/s390-tools.changes b/s390-tools.changes index 57cdb7f..b252665 100644 --- a/s390-tools.changes +++ b/s390-tools.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Mar 22 21:16:00 UTC 2018 - mpost@suse.com + +- Modified dasd_configure script to set a return code of 8 if a + DASD volume being brought online is not formatted. (bsc#1084503) + ------------------------------------------------------------------- Tue Dec 12 01:01:09 UTC 2017 - mpost@suse.com diff --git a/s390-tools.spec b/s390-tools.spec index 0422ada..6e95ed2 100644 --- a/s390-tools.spec +++ b/s390-tools.spec @@ -1,7 +1,7 @@ # # spec file for package s390-tools # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed