Re: [PATCH 3/3] Simplify s390x module list generation.

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

 



comments inline

On 09/24/2009 02:58 AM, David Cantrell wrote:
> Only pull in kernel modules in kernel/drivers/s390 as well as
> libiscsi_tcp.  The mk-images script takes care of dependency resolution
> and regenerating the modules.dep file.
> ---
>  scripts/mk-images.s390 |   53 ++---------------------------------------------
>  1 files changed, 3 insertions(+), 50 deletions(-)
> 
> diff --git a/scripts/mk-images.s390 b/scripts/mk-images.s390
> index 308afcf..50d0f8d 100644
> --- a/scripts/mk-images.s390
> +++ b/scripts/mk-images.s390
> @@ -23,60 +23,13 @@ getAllS390ModuleNames() {
>          find ${s390dir} -type f -name "*.ko" | while read line ; do
>              echo "$(basename ${line} .ko)"
>          done | sort | uniq | tr '\n' ' '
> +    else
> +        echo "*** ERROR: ${s390dir} is missing, this tree probably won't have a working initrd.img" >&2
>      fi
>  }
> 
> -collectModuleNames() {
> -    grep -v "^#" ${KERNELROOT}/lib/modules/${version}/modules.${1} | \
> -        cut -d ' ' -f 1 | sort | uniq | \
> -        sed -e 's|\.ko$||g' | \
> -        tr '\n' ' '
> -}
> -
> -expandModuleDeps() {
> -    MODS="$*"
> -    DEPS=
> -
> -    DEPSFILE="$(mktemp ${TMPDIR:-/tmp}/moduledeps.XXXXXX)"
> -    echo "${MODS}" | tr ' ' '\n' > "${DEPSFILE}"
> -
> -    cd ${KERNELROOT}
> -
> -    while [ true ]; do
> -        beforeCount="$(wc -l "${DEPSFILE}" | cut -d ' ' -f 1)"
> -
> -        while read module ; do
> -            modulePath="$(find ${KERNELROOT}/lib/modules/${version} -name "${module}.ko")"
> -            if [ -z "${modulePath}" ]; then
> -                echo "ERROR: Missing ${module}.ko on s390" >&2
> -                continue
> -            fi
> -
> -            deps="$(modinfo -F depends ${modulePath})"
> -
> -            if [ ! -z "${deps}" ]; then
> -                echo "${deps}" | tr ',' '\n' >> ${DEPSFILE}
> -            fi
> -        done < "${DEPSFILE}"
> -
> -        sort "${DEPSFILE}" | uniq > "${DEPSFILE}.new"
> -        mv "${DEPSFILE}.new" "${DEPSFILE}"
> -        afterCount="$(wc -l "${DEPSFILE}" | cut -d ' ' -f 1)"
> -
> -        if [ ${beforeCount} -eq ${afterCount} ]; then
> -            break
> -        fi
> -    done
> -
> -    cat "${DEPSFILE}" | tr '\n' ' '
> -    rm -f "${DEPSFILE}"
> -}
> -

ack

>  S390BASEMODS="$(getAllS390ModuleNames)"

This must go into the body of makeBootImages() below, because mk-images
won't have the kernel modules set up before calling makeBootImages().
Since we iterate over the kernel module directory with "find ${s390dir}"
above, we must have the modules already set up. At least, that's what I
came up with after having looked at the shell script traces of a recent
compose.

> -S390CCWMODS="$(collectModuleNames ccwmap)"
> -S390BLOCKMODS="$(collectModuleNames block)"
> -S390NETMODS="$(collectModuleNames networking)"
> -S390MODS="$(expandModuleDeps $S390BASEMODS $S390CCWMODS $S390BLOCKMODS $S390NETMODS)"

ack

> +S390MODS="$S390BASEMODS libiscsi_tcp"

I would like to understand why libiscsi_tcp appears here. AFAIK, we have
never had this module here in mk-images.s390 so far. And in the
20090923.2 compose the module is already there without explicitly
mention it for s390x. In fact, mk-images adds iscsi_tcp to SCSIMODS,
which in turn goes into INITRDMODS and expandModuleSet() will pull in
the dependencies automatically being
"libiscsi,libiscsi_tcp,scsi_transport_iscsi" for iscsi_tcp.

In the improbable case we really need to explicitly specify this here,
it has to go into the body of makeBootImages() as well, since S390MODS
depends on S390BASEMODS.

> 
>  makeBootImages() {

    S390BASEMODS="$(getAllS390ModuleNames)"
    S390MODS="$S390BASEMODS"

>  	makeinitrd --initrdto $TOPDESTPATH/images/initrd.img \

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

[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