Public bug reported:

The postinst script fails to run when a script that uses the dpkg
database is installed. I have mkvmlinuz installed on my system, the
files looks like:

#!/bin/sh

set -e

. /usr/share/debconf/confmodule

db_get mkvmlinuz/bootloaders
bootloader="$RET"

if [ "$bootloader" = mkvmlinuz ]; then
    /usr/sbin/mkvmlinuz $1 $2
fi

And installing linux-image-2.6.17-5-powerpc fails with.

Setting up linux-image-2.6.17-5-powerpc (2.6.17-5.16) ...
Running depmod.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/mkvmlinuz
run-parts: /etc/kernel/postinst.d/mkvmlinuz exited with return code 20
Failed to process /etc/kernel/postinst.d at 
/var/lib/dpkg/info/linux-image-2.6.17-5-powerpc.postinst line 1207.
dpkg: error processing linux-image-2.6.17-5-powerpc (--configure):
 subprocess post-installation script returned error exit status 2
Errors were encountered while processing:
 linux-image-2.6.17-5-powerpc
E: Sub-process /usr/bin/dpkg returned an error code (1)

Replacing 
> db_get mkvmlinuz/bootloaders
> bootloader="$RET"
with
> bootloader="mkvmlinuz"
makes it possible to install the kernel and generate the kernel with mkvmlinuz.

The problem is however somewhere in the postinst script for the kernel.
I tried to make a simple modifiction of the postinst script
(/var/lib/dpkg/info/linux-image-2.6.17-5-powerpc.postinst) by comment
out the three lines:

use Debconf::Client::ConfModule qw(:all);
version('2.0');
my $capb=capb("backup");

in the beginning of the postinst file and then tried to install the
kernel with the original mkvmlinuz postinst.d file. Surprisingly it
worked.

I don't know exactly what the problem is, but for some reason scripts in
/etc/kernel/postinst.d can't the the dpkg database when run from
/var/lib/dpkg/info/linux-image-2.6.17-5-powerpc.postinst. The
/etc/kernel/postinst.d/mkvmlinuz scripts works fine to run standalone.

** Affects: linux-source-2.6.17 (Ubuntu)
     Importance: Untriaged
         Status: Unconfirmed

-- 
linux-image-2.6.17-5-powerpc postinst fails
https://launchpad.net/bugs/55419

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to