diff options
| author | David Cantrell <dcantrell@redhat.com> | 2010-03-29 10:01:21 -1000 |
|---|---|---|
| committer | David Cantrell <dcantrell@redhat.com> | 2010-03-30 03:59:44 -1000 |
| commit | cc462ffe4e10cceae338e1f442cbf516dcacb63b (patch) | |
| tree | eb3628d5018af06a272f15128224de159c0e24f1 | |
| parent | ee601630b1b7f72d6728e704a8332e98084236fe (diff) | |
Use /sbin/dasd_cio_free to free blacklisted DASDs (#558881)
Use the dasd_cio_free command to free blacklisted DASDs and block until
they are available to set online and set other attributes. We were just
writing "free $DEVICE" to /proc/cio_ignore, but we lacked the wait loop
to make sure the device showed up. The /sbin/dasd_cio_free command does
that for us, so we can just call that.
NOTE: The dasd_cio_free command reads the DASD list from the output of
the 'modprobe --showconfig' command, so the $DASD list is placed in the
/etc/modprobe.d/dasd_mod.conf in module option format so that modprobe
can return it correctly.
| -rw-r--r-- | loader/linuxrc.s390 | 23 | ||||
| -rwxr-xr-x | scripts/upd-instroot | 1 |
2 files changed, 15 insertions, 9 deletions
diff --git a/loader/linuxrc.s390 b/loader/linuxrc.s390 index 83f5c94e5..5110e0a77 100644 --- a/loader/linuxrc.s390 +++ b/loader/linuxrc.s390 @@ -2393,14 +2393,27 @@ function parse_dasd() { [ "$1" = "-h" ] && handle=yes || unset handle local dasditem local allgood="yes" + local cio_wc=$(wc -c /proc/cio_ignore) + read cio_wc_bytes cio_wc_filename cio_wc_foo <<< "$cio_wc" + if [ "$handle" = "yes" -a "$cio_wc_bytes" != "0" ]; then + echo $"Trying to clear specified DASDs from device blacklist..." + mkdir -p /etc/modprobe.d + echo "options dasd_mod dasd=$DASD" > /etc/modprobe.d/dasd_mod.conf + if ! dasd_cio_free; then + echo $"Not all specified DASDs could be detected within timeout." + allgood="no" + fi + fi while read dasditem; do unset range features range lo hi rangegood \ attrs devno lodevno hidevno devbusid sys case $dasditem in autodetect) [ -z "$handle" ] && continue - local cio_wc=$(wc -c /proc/cio_ignore) + cio_wc=$(wc -c /proc/cio_ignore) read cio_wc_bytes cio_wc_filename cio_wc_foo <<< "$cio_wc" + # above we only freed the devices specified in $DASD, + # so there might still be other DASDs in the blacklist if [ "$cio_wc_bytes" != "0" ]; then echo $"Note: There is a device blacklist active! Only activating visible DASDs." fi @@ -2461,14 +2474,6 @@ function parse_dasd() { *) echo "l.$LINENO: unexpected return code of regex match operator =~, code needs to be fixed" 1>&2 ;; esac fi - if [ "$rangegood" = "yes" -a "$handle" = "yes" ]; then - if ! sysecho /proc/cio_ignore "free $range"; then - echo $"Could not free DASD device $range from device blacklist" - allgood="no" - else - udevadm settle - fi - fi if [ "${features//*)/}" != "" ]; then if [ -z "$handle" ]; then echo $"Missing closing parenthesis at features of DASD range $range: ($features" diff --git a/scripts/upd-instroot b/scripts/upd-instroot index d8375b452..f35b49dd8 100755 --- a/scripts/upd-instroot +++ b/scripts/upd-instroot @@ -725,6 +725,7 @@ lib/modules/ibm lib/s390-tools/lsznet.raw lib/s390-tools/znetcontrolunits lib/security +sbin/*_cio_free sbin/arp sbin/cmsfscat sbin/cmsfslst |
