dkms - error when installing custom kernel

Bug #292606 reported by yossarian_uk
110
This bug affects 15 people
Affects Status Importance Assigned to Milestone
DKMS
Invalid
Undecided
Unassigned
dkms (Ubuntu)
Fix Released
Medium
Mario Limonciello
Declined for Jaunty by Mario Limonciello
Declined for Karmic by Mario Limonciello
nvidia-common (Ubuntu)
Invalid
Medium
Alberto Milone
Declined for Jaunty by Mario Limonciello
Declined for Karmic by Mario Limonciello

Bug Description

Hi

After installing Envy (nvidia) in intrepid I have installed a custom kernel (based on linux-source package) .

When I install the .deb file it does install correctly and correctly installs nvidia module. however I get the following error - also every time I do an apt-get upgrade it try to re-do this (and fails...)

------------------------------------------------------------------

Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /vmlinuz-2.6.27.7-k8
Found kernel: /vmlinuz-2.6.27-7-generic
Found kernel: /memtest86+.bin
Replacing config file /var/run/grub/menu.lst with new version
Updating /boot/grub/menu.lst ... done

Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms
run-parts: executing /etc/kernel/postinst.d/nvidia-common
run-parts: /etc/kernel/postinst.d/nvidia-common exited with return code 20
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-2.6.27.7-k8.postinst line 1181.
dpkg: error processing linux-image-2.6.27.7-k8 (--install):
subprocess post-installation script returned error exit status 2
Setting up linux-headers-2.6.27.7-k8 (686) ...

- Any ideas how to fix this ?

Revision history for this message
Josh Snellink (tyroeternal) wrote :

I am having the exact same issues, though I am not using envy for my nvidia drivers and my kernel and patches are straight from kernel.org.

---
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-2.6.27.4.tyro2.postinst line 1181.
dpkg: error processing linux-image-2.6.27.4.tyro2 (--install):
 subprocess post-installation script returned error exit status 2
---

Revision history for this message
snoapx (didelot-sylvain) wrote :

I have exactly the same error here. I tried to build my own kernel. All is ok, but when I try to install the *.deb, I get the error during the package configuration.

There is my configuration :

- Ubuntu 8.10. Installed from scratch, no upgrades from a previous version.
- Nvidia Driver version : 177.80 (from official Ubuntu repositories)
- Kernel sources from official Ubuntu repositories, with the phc patch

There is my error :
-------
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms
run-parts: executing /etc/kernel/postinst.d/nvidia-common
run-parts: /etc/kernel/postinst.d/nvidia-common exited with return code 20
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-2.6.27custom.postinst line 1181.
dpkg: error processing linux-image-2.6.27custom (--configure):
 subprocess post-installation script returned error exit status 2
Errors were encountered while processing:
 linux-image-2.6.27custom
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up linux-image-2.6.27custom (2.6.27custom-10.00.Custom) ...
Running depmod.
Finding valid ramdisk creators.
Using mkinitramfs-kpkg to build the ramdisk.
initrd.img(/boot/initrd.img-2.6.27custom
) points to /boot/initrd.img-2.6.27custom
 (/boot/initrd.img-2.6.27custom) -- doing nothing at /var/lib/dpkg/info/linux-image-2.6.27custom.postinst line 583.
vmlinuz(/boot/vmlinuz-2.6.27custom
) points to /boot/vmlinuz-2.6.27custom
 (/boot/vmlinuz-2.6.27custom) -- doing nothing at /var/lib/dpkg/info/linux-image-2.6.27custom.postinst line 583.
Running postinst hook script update-grub.
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-2.6.27.4.old
Found kernel: /boot/vmlinuz-2.6.27.4
Found kernel: /boot/vmlinuz-2.6.27custom
Found kernel: /boot/vmlinuz-2.6.27-7-generic
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst ... done

Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms
run-parts: executing /etc/kernel/postinst.d/nvidia-common
run-parts: /etc/kernel/postinst.d/nvidia-common exited with return code 20
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-2.6.27custom.postinst line 1181.
dpkg: error processing linux-image-2.6.27custom (--configure):
 subprocess post-installation script returned error exit status 2
Errors were encountered while processing:
 linux-image-2.6.27custom
-----

Has anybody an idea about this bug?

Regards

Revision history for this message
kilroy (channelsconf) wrote :
Download full text (3.5 KiB)

Same problem here.

cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=8.10
DISTRIB_CODENAME=intrepid
DISTRIB_DESCRIPTION="Ubuntu 8.10"

uname -a
Linux jambo 2.6.27-7-generic #1 SMP Tue Nov 4 19:33:20 UTC 2008 i686 GNU/Linux

ii linux-firmware 1.2 Firmware for Linux kernel drivers
ii linux-headers-2.6.27-7 2.6.27-7.16 Header files related to Linux kernel version
ii linux-headers-2.6.27-7-generic 2.6.27-7.16 Linux kernel headers for version 2.6.27 on x
ii linux-headers-2.6.27.2 2.6.27.2.HM64 Header files related to Linux kernel, specif
ii linux-headers-generic 2.6.27.7.11 Generic Linux kernel headers
ii linux-image-2.6.27-7-generic 2.6.27-7.16 Linux kernel image for version 2.6.27 on x86
ii linux-image-generic 2.6.27.7.11 Generic Linux kernel image
ii linux-libc-dev 2.6.27-7.16 Linux Kernel Headers for development
ii linux-restricted-modules-common 2.6.27-7.12 Non-free Linux 2.6.27 modules helper script
ii linux-sound-base 1.0.17.dfsg-2ubuntu1 base package for ALSA and OSS sound systems
ii linux-source 2.6.27.7.11 Linux kernel source with Ubuntu patches
ii linux-source-2.6.27 2.6.27-7.16 Linux kernel source for version 2.6.27 with

ii nvidia-173-modaliases 173.14.12-1-0ubuntu4 Modaliases for the NVIDIA binary X.Org drive
ii nvidia-177-kernel-source 177.80-0ubuntu2 NVIDIA binary kernel module source
ii nvidia-177-modaliases 177.80-0ubuntu2 Modaliases for the NVIDIA binary X.Org drive
ii nvidia-71-modaliases 71.86.04-0ubuntu10 Modaliases for the NVIDIA binary X.Org drive
ii nvidia-96-modaliases 96.43.09-0ubuntu1 Modaliases for the NVIDIA binary X.Org drive
ii nvidia-common 0.2.4 Find obsolete NVIDIA drivers
ii nvidia-glx-177 177.80-0ubuntu2 NVIDIA binary Xorg driver
ii nvidia-settings 177.78-0ubuntu2 Tool of configuring the NVIDIA graphics driv

>----<

cd /usr/src/
tar xjf linux-source-2.6.27.tar.bz2
ln -s linux-source-2.6.27 linux
cd linux
cp /boot/config-2.6.27-7-generic .config
make menuconfig
# CONFIG_HIGHMEM64G=y
make-kpkg clean
make-kpkg --initrd --revision 2.6.27.2.HM64 binary
cd ..
dpkg -i linux-image-2.6.27.2_2.6.27.2.HM64_i386.deb linux-headers-2.6.27.2_2.6.27.2.HM64_i386.deb
...
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms
run-parts: executing /etc/kernel/postinst.d/nvidia-co...

Read more...

Revision history for this message
kilroy (channelsconf) wrote :

Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms
run-parts: executing /etc/kernel/postinst.d/nvidia-common
+ . /usr/share/debconf/confmodule
++ set -x
++ '[' '!' 1 ']'
++ '[' -z '' ']'
++ exec
++ '[' '' ']'
++ exec
++ DEBCONF_REDIR=1
++ export DEBCONF_REDIR
+ db_set nvidia-common/obsolete-driver false
+ _db_cmd 'SET nvidia-common/obsolete-driver' false
+ IFS=' '
+ printf '%s\n' 'SET nvidia-common/obsolete-driver false'
+ IFS='
'
+ read -r _db_internal_line
+ RET='20 Unsupported command "*" (full line was " * Running DKMS auto installation service for kernel 2.6.27.2") received from conf module.'
+ case ${_db_internal_line%%[ ]*} in
+ return 20
run-parts: /etc/kernel/postinst.d/nvidia-common exited with return code 20
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-2.6.27.2.postinst line 1181.

Revision history for this message
dx9s (dx9s) wrote :

I have the same problem and I came to same conclusion that it was nvidia-common ... upon trying to figure out what package it came from... it comes from "nvidia-common" (quite simple).

The weird thing is I didn't have that package installed.. so I installed it (and it also flagged other modaliases for different nvidia driver versions) ... then removed nvidia-common and the modaliases for the versions I didn't need (I must use 173.x as I have legacy nvidia hardware).

That should remove the nvidia-common script in /etc/kernel/postinst.d (could also remove it manually or what I did early on to work-around: "chmod -x nvidia-common" to disable it from running).

Make sure you have nvidia-common package installed (--reinstalled) if you need it or removed properly if not using it.

That seems to fix it for me. I suspect there is an issue with properly installed/removing that package. If you are still having problems and you reinstalled the package... try removing execute permissions from that script before installing your custom kernel via the .deb method!

--Doug

Revision history for this message
renald (renald-buter) wrote : Re: [Bug 292606] Re: dkms - error when installing custom kernel

I had to do the following:

sudo chmod -x /etc/kernel/postinst.d/nvidia-common
sudo apt-get remove nvidia-common

This completes the installation of the custom kernel. However, the
/etc/kernel/postinst.d/nvidia-common is still there. So, I, reinstalled it
 and then purged:

sudo apt-get install nvidia-common
sudo apt-get purge nvidia-common

After that, the file is gone.

Renald

On 11/11/08, dx9s <email address hidden> wrote:
> I have the same problem and I came to same conclusion that it was
> nvidia-common ... upon trying to figure out what package it came from...
> it comes from "nvidia-common" (quite simple).
>
> The weird thing is I didn't have that package installed.. so I installed
> it (and it also flagged other modaliases for different nvidia driver
> versions) ... then removed nvidia-common and the modaliases for the
> versions I didn't need (I must use 173.x as I have legacy nvidia
> hardware).
>
> That should remove the nvidia-common script in /etc/kernel/postinst.d
> (could also remove it manually or what I did early on to work-around:
> "chmod -x nvidia-common" to disable it from running).
>
> Make sure you have nvidia-common package installed (--reinstalled) if
> you need it or removed properly if not using it.
>
> That seems to fix it for me. I suspect there is an issue with properly
> installed/removing that package. If you are still having problems and
> you reinstalled the package... try removing execute permissions from
> that script before installing your custom kernel via the .deb method!
>
> --Doug
>
> --
> dkms - error when installing custom kernel
> https://bugs.launchpad.net/bugs/292606
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Ubuntu: New
>
> Bug description:
> Hi
>
> After installing Envy (nvidia) in intrepid I have installed a custom kernel
> (based on linux-source package) .
>
> When I install the .deb file it does install correctly and correctly
> installs nvidia module. however I get the following error - also every time
> I do an apt-get upgrade it try to re-do this (and fails...)
>
> ------------------------------------------------------------------
>
> Searching for default file ... found: /boot/grub/default
> Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
> Searching for splash image ... none found, skipping ...
> Found kernel: /vmlinuz-2.6.27.7-k8
> Found kernel: /vmlinuz-2.6.27-7-generic
> Found kernel: /memtest86+.bin
> Replacing config file /var/run/grub/menu.lst with new version
> Updating /boot/grub/menu.lst ... done
>
> Examining /etc/kernel/postinst.d.
> run-parts: executing /etc/kernel/postinst.d/dkms
> run-parts: executing /etc/kernel/postinst.d/nvidia-common
> run-parts: /etc/kernel/postinst.d/nvidia-common exited with return code 20
> Failed to process /etc/kernel/postinst.d at
> /var/lib/dpkg/info/linux-image-2.6.27.7-k8.postinst line 1181.
> dpkg: error processing linux-image-2.6.27.7-k8 (--install):
> subprocess post-installation script returned error exit status 2
> Setting up linux-headers-2.6.27.7-k8 (686) ...
>
> - Any ideas how to fix this ?
>

Revision history for this message
goto (gotolaunchpad) wrote :

I have the exact same issue when installing the debs of my custom kernel

Revision history for this message
Geoff123 (gsking1) wrote :

Same problem here.
>Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-2.6.27.2.postinst line 1181.

The fix of removing nvidia-common worked for me.
Geoff

Revision history for this message
goto (gotolaunchpad) wrote :

Wouldn't removing nvidia-common not let you install the drivers?

Revision history for this message
MarcHess (marc-hessonline) wrote :

Hello

I had the same Problem. I solved it like this:

Boot system in FileSave Mode
Go to root Console
do apt-get purge nvidia-common
install your Kernel. dpkk -i "KERNEL.deb"
when done reinstall the nvidia-common Package apt-get install nvidia-common

It worked for me. Everything fine. Nvidia Drivers are working

But be carefull, i'm not an experienced Linux User. I have just compiled my first kernel. Its running, so i think i should be Ok. But i did'nt really know what i was doing:-)

Revision history for this message
Filipe Sousa (natros) wrote :

I'm having the same problem after compiling a custom kernel using kernel-package:

$ sudo make-kpkg --initrd --append-to-version=-nostradamus kernel_image kernel_headers

$ sudo dpkg -i linux-image-2.6.27.10-nostradamus_2.6.27.10-nostradamus-10.00.Custom_amd64.deb

Selecting previously deselected package linux-image-2.6.27.10-nostradamus.
(Reading database ... 147895 files and directories currently installed.)
Unpacking linux-image-2.6.27.10-nostradamus (from linux-image-2.6.27.10-nostradamus_2.6.27.10-nostradamus-10.00.Custom_amd64.deb) ...
Done.
Setting up linux-image-2.6.27.10-nostradamus (2.6.27.10-nostradamus-10.00.Custom) ...
Running depmod.
Finding valid ramdisk creators.
Using mkinitramfs-kpkg to build the ramdisk.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms
run-parts: executing /etc/kernel/postinst.d/nvidia-common
run-parts: /etc/kernel/postinst.d/nvidia-common exited with return code 20
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-2.6.27.10-nostradamus.postinst line 1181.
dpkg: error processing linux-image-2.6.27.10-nostradamus (--install):
 subprocess post-installation script returned error exit status 2
Errors were encountered while processing:
 linux-image-2.6.27.10-nostradamus

Revision history for this message
Stefano Angeleri (weltall) wrote :

i can confirm the same exact error of those above with 2.6.28. it seems to happen whathever you use distro supplied nvidia drivers or not (i use nvidia installer for both kernel module and driver (exactly 180.18) and i could run xorg as soon as i rebooted after installing the module with the nvidia installer (-k --kernel-name=2.6.28-custom) before rebooting in the new kernel. The error seems to appear for everything done with apt (altough it doesn't give issues as the kernel boots perfectly regardless) till you remove nvidia-common which makes the configuration of the package a success. Then reinstalling it is fine too

Revision history for this message
quequotion (quequotion) wrote :

In Intrepid amd64 with kernel 2.6.27.18:

If I remove the nvidia-common package, the kernel install "finishes" without error, but it is not really finishing.

The kernel is never added to /boot/grub/menu.lst and I suspect other more important steps are being skipped.

I can manually add the kernel to menu.lst and surprisingly enough it boots, but I can't be sure what parts of the install are being skipped .

I don't think this error is strictly bound to nvidia-common since the installation seems to fail even without the package.

Revision history for this message
quequotion (quequotion) wrote :

upon closer inspection, no abi is made for the kernel when "installed" without nvidia-common (no error, no finish).

the /boot/ directory has abi-2.6.27etc for each kernel image except the kernel I compiled.

Revision history for this message
quequotion (quequotion) wrote :

Disregard both of my posts.

My issue was not as it appeared.

Since I had edited my menu.lst by hand in the past (to add Grub Invaders) the update-grub process was being skipped after the kernel install. When I ran it by myself it asked if I want to keep my own menu.lst or take the package-maintainers.

Now, I am not sure why the kernel installer decided to skip running update-grub altogether, especially sine the program itself has a failsafe to protect the current menu.lst.

Revision history for this message
Andrei Emeltchenko (andrei-emeltchenko-finik) wrote :

Error still present
sudo dpkg -i ../linux-image-2.6.28.9_2.6.28.9-10.00.Custom_i386.deb
[sudo] password for niko:
Выбор ранее не выбранного пакета linux-image-2.6.28.9.
(Чтение базы данных... на данный момент установлено 305345 файлов и каталогов.)
Распаковывается пакет linux-image-2.6.28.9 (из файла .../linux-image-2.6.28.9_2.6.28.9-10.00.Custom_i386.deb)...
Done.
Настраивается пакет linux-image-2.6.28.9 (2.6.28.9-10.00.Custom) ...
Running depmod.
Running postinst hook script update-grub.
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /vmlinuz-2.6.28.9
Found kernel: /vmlinuz-2.6.28-12-generic
Found kernel: /vmlinuz-2.6.28-11-generic
Found kernel: /vmlinuz-2.6.27-11-generic
Found kernel: /memtest86+.bin
Replacing config file /var/run/grub/menu.lst with new version
Updating /boot/grub/menu.lst ... done

Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms
run-parts: executing /etc/kernel/postinst.d/nvidia-common
run-parts: /etc/kernel/postinst.d/nvidia-common exited with return code 20
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-2.6.28.9.postinst line 1186.
dpkg: не удалось обработать параметр linux-image-2.6.28.9 (--install):
 подпроцесс post-installation script возвратил код ошибки 2
При обработке следующих пакетов произошли ошибки:
 linux-image-2.6.28.9

Revision history for this message
Mike Stroyan (stroyan) wrote :

This is not actually a defect in nvidia-common. It is a defect in dkms.
The /etc/kernel/postinst.d/dkms script is sending messages to stdout.
That script is run under /usr/share/debconf/frontend, which expects that stdout will only be used for messages to it.
The actual response to the output does not occur while /etc/kernel/postinst.d/dkms is running.
The error message is deferred until the /etc/kernel/postinst.d/nvidia-common script runs.
That second script tries to send debconf requests to stdout.
That triggers the debconf error message in response to the junk that dkms wrote earlier.

Patching /etc/kernel/postinst.d/dkms to redirect stdout fixes the problem.
Adding "1>&2" to the invocation of /etc/init.d/dkms_autoinstaller keeps stdout clean.

Mike Stroyan (stroyan)
affects: nvidia-common (Ubuntu) → dkms (Ubuntu)
Revision history for this message
Mario Limonciello (superm1) wrote :

I don't know that I agree that's logically correct. the output from the init script should be going to to stdout. It is *not* error output from DKMS's kernel postinstall script, so it shouldn't be on stderr.

If it's not happening while DKMS is running, then before loading debconf in nvidia-common, I think nvidia-common should flush stdout to prevent anything deferred showing up.

affects: dkms (Ubuntu) → nvidia-common (Ubuntu)
Revision history for this message
Mike Stroyan (stroyan) wrote :

"man 7 debconf" states-
       * Avoid outputting anything to stdout in your postinst, since that
              can confuse debconf, and postinst should not be verbose anyway.
              Output to stderr is ok, if you must.

It might be better to redirect stdout to file descriptor 3.
I see this comment in /usr/share/debconf/confmodule
        # Redirect standard output to standard error. This prevents common
        # mistakes by making all the output of the postinst or whatever
        # script is using this library not be parsed as confmodule commands.
        #
        # To actually send something to standard output, send it to fd 3.

But I don't see any documentation outside that file that directly says that fd 3 should be
used in the role of stdout.

The nvidia-common package certainly cannot be expected to make up for the problem that
the dkms package creates. The bad output is already sitting in a pipe headed to
the debconf frontend before the nvidia-common postinst script is ever run.

Revision history for this message
webfreakz (webfreakz) wrote :

I've got the same errors with dkms/nvidia-common when installing my fresh from the shelf linux kernel image.deb. I also noticed there's no abi-file in the /boot directory. From what I've figured out, this makes me either press the <SPACE>-bar at system bootup (after GRUB) or I can chose to just wait 30 seconds. I don't have to do this with e.g. linux-image.2.6.30-9-generic, and from what I can figure that's because of the existence of the abi-2.6.30-9-generic file... Is there any way to solve this issue?

Revision history for this message
aspa (marko-asplund) wrote :

I'm having the same problem on Ubuntu 9.04.

Changed in nvidia-common (Ubuntu):
assignee: nobody → Alberto Milone (albertomilone)
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Alberto Milone (albertomilone) wrote :

The latest commit in my branch should fix this (by flushing stdout before printing): lp:nvidia-common

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nvidia-common - 0.2.12

---------------
nvidia-common (0.2.12) karmic; urgency=low

  * debian/control:
    - Drop dependency on nvidia-71-modaliases.
  * NvidiaDetector/nvidiadetector.py:
    - Use a text file in /usr/share/nvidia-common/
      instead of hardcoding the list of obsolete
      packages in the program.
    - Add "obsolete" optional argument to the ctor so
      as to allow to change the default path to the
      list of obsolete packages.
    - Catch IOError if the path to the modalias files
      does not exist.
    - Flush stdout before printing (LP: #292606).
  * nvidia-common:
    - Prevent the script from failing when $LATEST is
      null.
  * setup.py:
    - Install share/obsolete to /usr/share/nvidia-common.
  * share/obsolete:
    - Add nvidia-glx-71.

 -- Alberto Milone <email address hidden> Fri, 24 Jul 2009 17:03:18 +0200

Changed in nvidia-common (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Jasmine Hassan (jasmine-aura) wrote :

NOPE, NOT FIXED!

Got the diff from:
http://launchpadlibrarian.net/29611367/nvidia-common_0.2.11_0.2.12.diff.gz

Applied the relevant changes to 0.2.11 in:
/usr/share/pyshared/NvidiaDetector/nvidiadetector.py
/etc/kernel/postinst.d/nvidia-common

BUT still, same problem persists:

Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms
run-parts: executing /etc/kernel/postinst.d/nvidia-common
run-parts: /etc/kernel/postinst.d/nvidia-common exited with return code 20
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-2.6.30-phc1.postinst line 1186.
dpkg: error processing linux-image-2.6.30-phc1 (--configure):
 subprocess post-installation script returned error exit status 2

Changed in nvidia-common (Ubuntu):
status: Fix Released → In Progress
Revision history for this message
Alberto Milone (albertomilone) wrote :

@jasmineaura:
Does it solve the problem if you apply the attached patch to your /var/lib/dpkg/info/nvidia-common.config ?

Please let me know

Revision history for this message
Alberto Milone (albertomilone) wrote :

(in addition to what you had already applied from the package in karmic)

Revision history for this message
Mike Stroyan (stroyan) wrote :

Flushing stdout is not going to help with this problem.
As I said in comment #17, the error is caused by /etc/init.d/dkms_autoinstaller sending text to debconf via stdout.
Flushing output within /etc/kernel/postinst.d/nvidia-common won't undo that error.
Debconf has already gotten the bad command before /etc/kernel/postinst.d/nvidia-common is started.

Patching /etc/kernel/postinst.d/dkms to redirect stdout DOES FIX the problem.
Adding "1>&2" to the invocation of /etc/init.d/dkms_autoinstaller keeps stdout clean.

Revision history for this message
Jasmine Hassan (jasmine-aura) wrote :

@Alberto Milone

I applied you attached patch to:
/var/lib/dpkg/info/nvidia-common.config

in addition to what I had already applied previously to:
/usr/share/pyshared/NvidiaDetector/nvidiadetector.py
/etc/kernel/postinst.d/nvidia-common

Same problem persists...

I guess Mike Stroyan has a point here... See his comment #19
He provided logical explanation for why this is happening and why it should be fixed in postinst.d/dkms and not in nvidia-common, and he quoted the debconf manual to justify his reasoning, which seems appropriate in this case..

After adding "1>&2" to the invocation of /etc/init.d/dkms_autoinstaller in /etc/kernel/postinst.d/dkms as he recommended:

Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms
 * Running DKMS auto installation service for kernel 2.6.30-phc1
 * madwifi-hal (0.10.5.6)...
madwifi-hal (0.10.5.6): Already installed on this kernel.
                                                                                                                             [ OK ]
 * nvidia (185.18.29)...
nvidia (185.18.29): Already installed on this kernel.
                                                                                                                             [ OK ]
 * rt73-k2wrlz (3.0.3)...
rt73-k2wrlz (3.0.3): Already installed on this kernel.
                                                                                                                             [ OK ]
run-parts: executing /etc/kernel/postinst.d/nvidia-common

# (success)

So perhaps this bug should be changed to 'dkms' package instead of 'nvidia-common', don't you think?

Revision history for this message
Bhaskar Kandiyal (bkandiyal) wrote :

This bug is still present in dkms as of 2.0.21.1. It would be nice if it gets fixed before karmic's release. So I nominated it for karmic.
Attached a debdiff for the maintainers.

Revision history for this message
Greg Donald (gd) wrote :

This bug is still present in dkms 2.0.21.1-0ubuntu3.

Revision history for this message
Martin Pitt (pitti) wrote :

I'm a bit confused here. The last patch in comment 29 looks weird and does not incorporate Alberto's latest proposed change.

Alberto, can you please attach a complete and tested patch, and re-subscribe the sponsoring team once its ready? Thanks!

Revision history for this message
Alberto Milone (albertomilone) wrote :

As discussed in this bug report, the problem should be fixed in DKMS (by flushing stdout after printing).

I have marked the report as invalid for nvidia-common and assigned the bug to dkms instead.

Changed in dkms (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Changed in nvidia-common (Ubuntu):
status: In Progress → Invalid
Revision history for this message
Mike Stroyan (stroyan) wrote :

The actual fix to dkms is not adding flushing of stdout.
The fix is redirecting /etc/init.d/dkms_autoinstaller output to stderr so that it doesn't send confusing output to debconf via stdout.

Revision history for this message
Mario Limonciello (superm1) wrote :

Why does the nvidia-common kernel postinst even exist? It looks like it's only purpose is to replicate the functionality that was there from the nvidia-common postinst. Obsoleted drivers won't be introduced by new kernel images, but instead by newer modaliases as detected by nvidia-common.

nvidia-common's postinst already does this, so I don't see any reason why this script should be sticking around in /etc/kernel/postinst.d.

Revision history for this message
Alberto Milone (albertomilone) wrote :

@Mario
the kernel postinst exists because it can happen that the nvidia-common postinst is triggered before the installation of the new (or updated) modalias files takes place thus preventing nvidia-common from helping users with the transition to a new driver.

The kernel postinst gives nvidia-common a better chance to do its job by making sure that the postinst is triggered sooner or later during the upgrade.

Revision history for this message
Mario Limonciello (superm1) wrote :

Alberto:

I don't agree here that running this in the kernel postinst is going to
increase the likelihood of nvidia-common helping transition users. The
order that the nvidia-common postisnt and kernel postinst would trigger
is irrelevant, because the message will be displayed either way, and the
user can't react to it until apt is done anyway.

If you are thinking that by trigger in the kernel postinst because of
changed filed in a modalias package to catch it before nvidia-common's
postinst, you should /really/ be doing that in the modalias postinst.
That's just a hack to have it run in the kernel's. The kernel hasn't
changed these modaliases at *all*.

Alberto Milone wrote:
> @Mario
> the kernel postinst exists because it can happen that the nvidia-common postinst is triggered before the installation of the new (or updated) modalias files takes place thus preventing nvidia-common from helping users with the transition to a new driver.
>
> The kernel postinst gives nvidia-common a better chance to do its job by
> making sure that the postinst is triggered sooner or later during the
> upgrade.
>
>

--
Mario Limonciello
*Dell | Linux Engineering*
<email address hidden>

Changed in dkms (Ubuntu):
status: Confirmed → Invalid
Changed in nvidia-common (Ubuntu):
status: Invalid → New
Changed in dkms:
status: New → Invalid
Revision history for this message
Alberto Milone (albertomilone) wrote :

Mario:
Adding the debconf trigger in every modalias package would imply calling the trigger every time the modaliases are installed which could be, say, 3 times (as currently there are 3 different drivers) in row when dist-upgrading to Karmic. This means that users will see the same message three times during the same dist-upgrade.

The message is not meant to allow users to take further steps during the upgrade. It's simply a warning which explains what they will have to do manually. This should be ok since we're speaking of the case in which users dist-upgrade from the command line instead of relying upon Update Manager (which gets rid of obsolete drivers automatically through nvidia-common).

Revision history for this message
Steve Langasek (vorlon) wrote :

Mike Stroyan's analysis is correct. This is not a bug in nvidia-common, it's a bug in dkms for outputting to stdout.

Standard Ubuntu kernel packages don't load the debconf confmodule, but custom packages built with make-kpkg do, and this is perfectly legitimate. Anything called from a maintainer script that has debconf loaded should not be outputting to stdout. For that matter, Ubuntu Policy has this to say about maintainer script output in general:

 3.9. Maintainer Scripts
 -----------------------

     The package installation scripts should avoid producing output which
     is unnecessary for the user to see and should rely on `dpkg' to stave
     off boredom on the part of a user installing many packages. This
     means, amongst other things, using the `--quiet' option on
     `install-info'.

dkms really needs to be fixed to not output on stdout. If output is needed, it should use stderr - but output really should not be needed at all except in the case of errors.

Changed in dkms (Ubuntu):
status: Invalid → Triaged
Revision history for this message
Mark Greenwood (fatgerman) wrote :

Also happening for me in Karmic. The fix outlined above:

"Patching /etc/kernel/postinst.d/dkms to redirect stdout DOES FIX the problem.
Adding "1>&2" to the invocation of /etc/init.d/dkms_autoinstaller keeps stdout clean."

fixes the problem for me.

Changed in nvidia-common (Ubuntu):
status: New → Invalid
Revision history for this message
krahim (karim-rahim) wrote :

Hi

So I have this problem now. As a result of an upgrade I had serious boot issues, I almost considered reinstalling an os. Anyways I installed a custom kernel and the latest Nvidia drivers. Apparently this is bad form? It's linux is it not so I can use kernel.org kernels can I not?

So I have this problem and apt-get and aptitude want to configure my kernel
linux-image-2.6.31.5-amd64-custom but it appears ot work fine...

I get:
sudo dpkg --configure -a
...

Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms
run-parts: executing /etc/kernel/postinst.d/nvidia-common
run-parts: /etc/kernel/postinst.d/nvidia-common exited with return code 20
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-2.6.31.5-2.6.32.5.custom.postinst line 1186.
dpkg: error processing linux-image-2.6.31.5-2.6.32.5.custom (--configure):
 subprocess installed post-installation script returned error exit status 2

I wondering how to get apt-get and aptitude to ignore this non-error and work almost normally. I had another problem with my 32 bit chroot after the upgrade and I managed to get past it.

Thanks,

Karim

Revision history for this message
krahim (karim-rahim) wrote :

Hi,

So I can change the status of the package in the file /var/lib/dpkg/status
I changed the status from ``install ok half-configured''
to ``install ok installed''.

That at least prevents aptitude and apt-get from breaking my nvidia driver.

Karim

Revision history for this message
Mario Limonciello (superm1) wrote :

I've got a fix committed upstream that will handle this particularly:
http://linux.dell.com/git/?p=dkms.git;a=commit;h=f113f8759d2eb60ad2cde4e009d4f5966c6ad4f1

There are several other related commits near by that include the conversion to upstart, and causing all logging to go to the syslog.

Changed in dkms (Ubuntu):
status: Triaged → Fix Committed
assignee: nobody → Mario Limonciello (superm1)
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.3 KiB)

This bug was fixed in the package dkms - 2.1.1.0-0ubuntu1

---------------
dkms (2.1.1.0-0ubuntu1) lucid; urgency=low

  [ Mario Limonciello ]
  * New upstream version
  * dkms_autoinstall: Minor logic cleanups from submitted patches.
  * dkms_autoinstall: Run under dash since dkms.conf isn't sourced anymore.
  * dkms_autoinstall: Whitespace cleanup.
  * Convert DKMS to an upstart script that starts up before GDM or KDM can
    start. This ensures that drivers are built before X tries to start.
    (LP: #453365)
  * dkms_autoinstall: Rather than having if/else clauses all over the script,
    stub out any functions that aren't provided on Debian/Ubuntu when
    /etc/debian_version isn't present.
  * dkms_autoinstall: Exit immediately if this script is present but DKMS
    isn't anymore rather than sourcing functions and then exiting.
  * kernel_postinst.d_dkms: Launch the upstart script instead. In the process
    all output will be going to /var/log/dkms_autoinstaller (LP: #292606)
  * dkms_autoinstall: Don't ever output to stdout, even with kernel parameters.
  * dkms_autoinstall: Don't log the situation that we already have everything
    installed that needs to be.
  * dkms_autoinstall: Rather than logging to /var/log/dkms_autoinstaller,
    use logger to log to syslog during build and install.
  * dkms_autoinstall: Clean up the method to get arch. These hacks shouldn't
    be necessary. If you have problems with them gone, file a bug and we'll
    fix them more cleanly.
  * dkms_autoinstall: Notate the kernel we are building a module against
    when building it.
  * debian/rules: Don't attempt to stop DKMS on upgrades. It's a task, not
    a daemon, so stop wouldn't do anything.
  * Makefile: Install the old initscript to /usr/lib so that different distros
    can migrate to upstart at their leisure.
  * Makefile: Move any debian specific calls into the Makefile.
  * dkms: Revert the code that runs DKMS as the user "nobody".
    - It's causing problems with people with nonstandard PAM configs because it
      uses "su". (LP: #484725)
    - Also people have reported that nothing should be owned by 'nobody' per
      Debian & Ubuntu policy. This could have been fixed by creating a DKMS
      user, but that still wouldn't solve the problems with using 'su'.
  * dkms: Emit built-module MODULE=foo if initctl is available on the system
    after done building a module.
  * Add a special apport package-hook for when package builds fail to try
    to report them against the package providing that DKMS package.
    (LP: #484871)

  [ Alberto Milone ]
  * dkms_common.postinst: try to build the module for the most recent
    kernel in addition to building it for the current kernel (LP: #474917).

  [ Steve Langasek ]
  * dkms_autoinstall: optimize with a single find call instead of multiple
    loops with ls. (LP: 3484386)
  * dkms_autoinstall: drop localization of the usage message - this is
    inconsistent with all other init scripts on the system.

  [ Pauli Virtanen ]
  * Remove dependence from environment's umask and certain environment
    variables. (LP: #438393, #436039)

  [ Giuseppe Iuculano ]
  * dkms_autoinstall: Correct the prov...

Read more...

Changed in dkms (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Giorgio B. (spudhead85) wrote :

Fix released for Lucid... What about Karmic?
Shall I recompile/patch the package?
I see that the version of dkms for Karmik is 2.1.0.1... Will be released a 2.1.1.2 for Karmic too?

Revision history for this message
Giorgio B. (spudhead85) wrote :
Revision history for this message
Pablo Castellano (pablocastellano) wrote :

Maybe this is related:
https://bugs.launchpad.net/ubuntu/+source/nvidia-common/+bug/292606

Can you also have a look at it? Fix should be similar

Revision history for this message
Giorgio B. (spudhead85) wrote :

On a fully-updated Karmic I had the same problem while installing a custom kernel compiled with make-kpkg.
Installing this package solved the problem:

http://linux.dell.com/dkms/permalink/dkms_2.1.1.2-0ubuntu1_all.deb

Hope this will help those who cannot upgrade to (still unstable) Lucid.

Revision history for this message
Duststorm (duststorm-design) wrote :

Sadly, I have to report that this bug still persists in ubuntu Lucid.

Revision history for this message
Daniel Pendolino (dpendolino) wrote :

I just came across this bug in Lucid, trying to compile my own zen kernel, does anyone know if this is still going on in Maverick?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.