The changes regarding CU_DEVDRV and search_cu as well as sourcing controlunits in lsznet are nice cleanups of code duplication (see also the marking comments below). Thanks. All other parts have been encapsulated in lsznet intentionally, since they are not used elsewhere, especially not in linuxrc.s390. Linuxrc.s390 learns about some of those things by means of the cooked output provided by lsznet. Other than exposing some internals, your changes should not break anything, though. On 09/15/2009 03:52 AM, David Cantrell wrote: > Remove duplicate search_cu() function in linuxrc.s390, move CU_ data > structures to controlunits.sh and have linuxrc.s390 source > /sbin/controlunits when it runs. > --- > loader/controlunits.sh | 48 +++++++++++++++++++++++++++ > loader/lsznet.raw | 84 +----------------------------------------------- > 2 files changed, 49 insertions(+), 83 deletions(-) > > diff --git a/loader/controlunits.sh b/loader/controlunits.sh > index e99db36..890598d 100644 > --- a/loader/controlunits.sh > +++ b/loader/controlunits.sh > @@ -18,6 +18,14 @@ > # The arrays (among other things) should be adapted, if any of those device > # drivers start supporting different CU types/models. > > +# The following combinations of control unit type and model were taken from the > +# Linux network device drivers for s390 on 2008-06-09 from Linux 2.6.25.4. > +# The list (among other things) should be adapted, if any of those device > +# drivers start supporting different CU types/models. > +# (Alternatively, the list could be generated by reading the modaliases > +# directly out of the device driver modules: > +# modinfo qeth/cu3088 | fgrep 'alias:' > +# However, this would still require a list of device driver modules.) > readonly -a CU=( > 1731/01 > 1731/05 > @@ -29,6 +37,18 @@ readonly -a CU=( > 3088/61 > ) > > +# $CU_CARDTYPE array is the only one which may contain entries with spaces > +readonly -a CU_CARDTYPE=( > + "OSA (QDIO)" > + "HiperSocket" > + "CTC adapter" > + "escon channel" > + "ficon channel" > + "LCS p390" > + "LCS OSA" > + "LCS CLAW" > +) > + > readonly -a CU_DEVDRV=( > qeth > qeth > @@ -40,6 +60,34 @@ readonly -a CU_DEVDRV=( > lcs > ) > > +readonly -a CU_DEVNAME=( > + eth > + hsi > + ctc > + ctc > + ctc > + eth > + eth > + eth > +) > + > +readonly -a CU_GROUPCHANNELS=( > + 3 > + 3 > + 2 > + 2 > + 2 > + 2 > + 2 > + 2 > +) > + > +readonly -a CHPIDTYPES=( > + [10]=OSE > + [11]=OSD > + [24]=IQD > +) > + > # Searches for a match of argument 1 on the array $CU and sets $cu_idx > # to the matched array index on success. > # Returns 0 on success, 1 on failure. > diff --git a/loader/lsznet.raw b/loader/lsznet.raw > index 5b3df91..a260f6d 100644 > --- a/loader/lsznet.raw > +++ b/loader/lsznet.raw > @@ -50,74 +50,7 @@ if [ $krn_ver -lt 2 -o $krn_patch -lt 6 ]; then > error $"only works for kernel versions 2.6 or probably later" > fi > > -# The following combinations of control unit type and model were taken from the > -# Linux network device drivers for s390 on 2008-06-09 from Linux 2.6.25.4. > -# The list (among other things) should be adapted, if any of those device > -# drivers start supporting different CU types/models. > -# (Alternatively, the list could be generated by reading the modaliases > -# directly out of the device driver modules: > -# modinfo qeth/cu3088 | fgrep 'alias:' > -# However, this would still require a list of device driver modules.) > -readonly -a CU=( > - 1731/01 > - 1731/05 > - 3088/08 > - 3088/1f > - 3088/1e > - 3088/01 > - 3088/60 > - 3088/61 > -) > - > -# $CU_CARDTYPE array is the only one which may contain entries with spaces > -readonly -a CU_CARDTYPE=( > - "OSA (QDIO)" > - "HiperSocket" > - "CTC adapter" > - "escon channel" > - "ficon channel" > - "LCS p390" > - "LCS OSA" > - "LCS CLAW" > -) > - > -readonly -a CU_DEVDRV=( > - qeth > - qeth > - ctc > - ctc > - ctc > - lcs > - lcs > - lcs > -) Correct, CU_DEVDRV was a duplicate and should indeed be only in controlunits. > - > -readonly -a CU_DEVNAME=( > - eth > - hsi > - ctc > - ctc > - ctc > - eth > - eth > - eth > -) > - > -readonly -a CU_GROUPCHANNELS=( > - 3 > - 3 > - 2 > - 2 > - 2 > - 2 > - 2 > - 2 > -) > -readonly -a CHPIDTYPES=( > - [10]=OSE > - [11]=OSD > - [24]=IQD > -) The remainder starting from here is indeed a nice elimination of duplicate code. > +. /sbin/controlunits > > readonly PREFIXFORMAT=[[:xdigit:]]* > readonly SSIDFORMAT=[0-3] > @@ -131,21 +64,6 @@ function debug() { > [ $DEBUG -ge $level ] && echo "$*" 1>&2 > } > > -# Searches for a match of argument 1 on the array $CU and sets $cu_idx > -# to the matched array index on success. > -# Returns 0 on success, 1 on failure. > -function search_cu() { > - local scu=$1 > - local i > - for ((i=0; i < ${#CU[@]}; i++)); do > - if [ $scu == ${CU[i]} ]; then > - cu_idx=$i > - return 0 > - fi > - done > - return 1 > -} > - > # Returns symbolic name of CHPID type in $chpidtype_symbolic, > # if an entry in the array $CHPIDTYPES has been found at index of argument 1. > # Returns "?" otherwise. Steffen Linux on System z Development IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martin Jetter Geschäftsführung: Erich Baier 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