Re: [PATCH 1/2] Use /sbin/dasd_cio_free to free blacklisted DASDs (#558881)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Looks good.

(Somehow my mail client shows all removed lines with double minus at the beginning of the diff lines. I suppose the patch will simply work and remove those lines.)

On 03/29/2010 09:59 PM, David Cantrell wrote:
> 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.
> - ---
>  loader/linuxrc.s390  |   23 ++++++++++++++---------
>  scripts/upd-instroot |    1 +
>  2 files changed, 15 insertions(+), 9 deletions(-)
> 
> diff --git a/loader/linuxrc.s390 b/loader/linuxrc.s390
> index e2ba469..1f16de8 100644
> - --- a/loader/linuxrc.s390
> +++ b/loader/linuxrc.s390
> @@ -2397,14 +2397,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
> @@ -2465,14 +2478,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 8250ea1..ca0fcce 100755
> - --- a/scripts/upd-instroot
> +++ b/scripts/upd-instroot
> @@ -709,6 +709,7 @@ bin/uname
>  bin/vi
>  lib/modules/ibm
>  lib/security
> +sbin/*_cio_free
>  sbin/arp
>  sbin/cmsfscat
>  sbin/cmsfslst 


Steffen

Linux on System z Development

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux