One of the arguments of /sbin/depmod set by kmodtool is wrong.

Solution Verified - Updated -

Issue

  • WARNING and FATAL are displayed when I uninstall a kmod package that I made.

      # rpm -e kmod-sample-1.0.0-1.i686
      WARNING: Couldn't open directory /lib/modules/2.6.32-37.el6: No such file or directory
      FATAL: Could not open /lib/modules/2.6.32-37.el6/modules.dep.temp for writing: No such file or directory
    
  • The cause is that at %post section in kmodtool the second argument of /sbin/depmod is "${verrel}.%{_target_cpu}${dotvariant}", but at %postun section it's "${verrel}${variant}".

    -----/usr/lib/rpm/redhat/kmodtool
            120 %post          -n kmod-${kmod_name}${dashvariant}
            121 if [ -e "/boot/System.map-${verrel}.%{_target_cpu}${dotvariant}" ]; then
      *---->122     /sbin/depmod -aeF "/boot/System.map-${verrel}.%{_target_cpu}${dotvariant}" "${
            verrel}.%{_target_cpu}${dotvariant}" > /dev/null || :
            123 fi
            124
    ---------------        
            139 %postun        -n kmod-${kmod_name}${dashvariant}
            140 if [ -e "/boot/System.map-${verrel}.%{_target_cpu}${dotvariant}" ]; then
      *---->141     /sbin/depmod -aeF "/boot/System.map-${verrel}.%{_target_cpu}${dotvariant}" "${
            verrel}${variant}" > /dev/null || :
            142 fi
    ---------------
    
  • Therefore, at %postun section in kmodtool I'd like you to change the second argument to "${verrel}.%{_target_cpu}${dotvariant}".

Environment

  • Red Hat Enterprise Linux 6.0 beta2
  • Architecture: x86,intel64
  • redhat-rpm-config-9.0.3-20.el6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.