Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-19773

DKMS: Passing $kmoddir has no effect

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Medium
    • Upstream
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      There are two issues about $kmoddir.

      Issue1: DKMS cannot set $kmoddir automatically if it is not set so you need to pass the value instead.  For example, the value of kmoddir is always NULL when $kmoddir is not set and passed to DKMS.

      # grep kmoddir /usr/src/lustre-client-2.17.0/dkms.conf
      PRE_BUILD="lustre-dkms_pre-build.sh $module $module_version $kernelver $kernel_source_dir      $arch $source_tree $dkms_tree $kmoddir" POST_BUILD="lustre-dkms_post-build.sh $module $module_version $kernelver $kernel_source_dir      $arch $source_tree $dkms_tree $kmoddir" POST_REMOVE="lustre-dkms_post-remove.sh $module $module_version $kernelver $kernel_source_dir      $arch $source_tree $dkms_tree $kmoddir"
      # head -7 config.log 
      This file contains any messages produced by compilers while
      running configure, to aid debugging if configure makes a mistake.
      It was created by Lustre configure 2.17.0, which was
      generated by GNU Autoconf 2.71.  Invocation command line was
        $ ./configure --prefix=/usr --enable-modules --disable-iokit --disable-doc --disable-utils --disable-tests --disable-maintainer-mode --with-linux=/usr/src/kernels/6.12.0-124.16.1.el10_1.x86_64 --with-linux-obj=/usr/src/kernels/6.12.0-124.16.1.el10_1.x86_64 --with-o2ib=/usr/src/ofa_kernel/default --with-kmp-moddir=/lustre-client --disable-gss --disable-server --enable-client --disable-manpages --disable-mpitests
      

      Issue2: the value of kmoddir will be ignored even if $kmoddir is set and passed to DKMS. This behavior is defined in code and described in DKMS manpage.

      code:
      # grep "override_dest_module_location()$" -A 23 /usr/sbin/dkms 
      override_dest_module_location()
      {
          local orig_location
          orig_location="$1"
          [[ ${addon_modules_dir} ]] && echo "/${addon_modules_dir}" && return
          case "$running_distribution" in
          fedora* | rhel* | ovm*)
              echo "/extra" && return
              ;;
          sles* | suse* | opensuse*)
              echo "/updates" && return
              ;;
          debian* | ubuntu*)
              echo "/updates/dkms" && return
              ;;
          arch*)
              echo "/updates/dkms" && return
              ;;
          *)
              ;;
          esac
          echo "$orig_location"
      }
      
      DKMS manpage:
      DEST_MODULE_LOCATION[#]=
             This directive specifies the destination where a module should be installed to, once compiled. It also is used for finding  original_modules.
             This  is  a  required  directive, except as noted below. This directive must start with the text "/kernel" which is in reference to /lib/mod‐
             ules/<kernelversion>/kernel.  Note that for each module within a dkms package, the numeric value of # must be the same for each of BUILT_MOD‐
             ULE_NAME , BUILT_MODULE_LOCATION , DEST_MODULE_NAME and DEST_MODULE_LOCATION and that the numbering should start at 0 (eg.  DEST_MODULE_LOCA‐
             TION[0]="/kernel/drivers/something/" DEST_MODULE_LOCATION[1]="/kernel/drivers/other/" ).
             DEST_MODULE_LOCATION is ignored on Fedora, Red Hat Enterprise Linux, SuSE Linux Enterprise Server, openSUSE and Ubuntu.  Instead, the  proper
             distribution-specific directory is used.
      

      Attachments

        Activity

          People

            xyang Xiao Yang
            xyang Xiao Yang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: