[pkg-nvidia-devel] Bug#416594: nvidia-kernel-source: bad attempt to nest fakeroot sessions

Russ Allbery rra at debian.org
Wed Mar 17 19:22:42 UTC 2010

retitle 416594 nvidia-kernel-source: bad attempt to nest fakeroot sessions with make-kpkg
tags patch

It took me a little while to figure out what's going on here, since it's
somewhat complicated.  I can understand now why other people haven't been
able to reproduce it.  It's an annoying bug, but I'm dubious that it
deserves RC status.  However, it is pretty annoying to people who use

The problem is that the debian/rules attempts to use ROOT_CMD in two
places.  Once is in the included generic rules provided by
module-assistant, which are only included if module-assistant is

    -include /usr/share/modass/include/generic.make
    -include /usr/share/modass/include/common-rules.make

This, in particular, defines the rules:

kdist_image: kdist_build
        $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules kdist_clean
        $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules kdist_clean kdist_config binary-modules

But the debian/rules file in the nvidia module source has:

kdist_config kdist_configure:
            $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules configure

so you end up running ROOT_CMD twice, one provided by the kdist_build
target and one provided by the kdist_config target.

I believe Bastian's patch in this bug is correct.  The configure target
doesn't need to run as root; nothing it's doing requires fakeroot or real
root.  So just removing $(ROOT_CMD) should be fine.  (In fact, I'm fairly
sure that replacing this rule with just:

kdist_config kdist_configure: configure

would be fine.)

Incidentally, I'm not sure that the leading hyphen in the includes of the
module-assistant supporting files is correct.  I don't see anything else
that's providing the kdist_image target, which so far as I can determine
is necessary for kernel-package to work, and calling debian/rules directly
isn't very useful unless one is setting all the variables that make-kpkg
or module-assistant are setting.

I think the correct approach to take here would be to make
nvidia-kernel-source just depend on module-assistant if the rules file is
toing to make use of the helper makefile fragments from module-assistant
and then include them unconditionally.  But I may be missing some

Russ Allbery (rra at debian.org)               <http://www.eyrie.org/~eagle/>

More information about the Pkg-nvidia-devel mailing list