%post(aufs-kmp-default) scriptlet failed


i built the rpm aufs-kmp-default-cvs20081020_2.6.27.7_9.1-1.26.rpm from source and tried to install it using init_buildsystem in a chroot environment.

This ended up in the following error:

error: %post(aufs-kmp-default-cvs20081020_2.6.27.7_9.1-1.26.i586) scriptlet failed, exit status 1

The corresponding %post scriptlet looks as follows:

rpm -qp --scripts aufs-kmp-default-cvs20081020_2.6.27.7_9.1-1.26.i586.rpm
>> postinstall scriptlet (using /bin/sh):
>> version=cvs20081020_2.6.27.7_9.1
>> nvr=aufs-kmp-default-$version-1.26
>> wm2=/usr/lib/module-init-tools/weak-modules2
>> if  -x $wm2 ]; then
>>     $wm2 --add-kmp $nvr
>> fi

As investigated so far (which might be wrong …) the scriptlet fails because the rpm is not installed in the running system but within chroot environment.

As a consequence i would like to remove the (%post) scriptlet from my built rpm. During investigation i found http://developer.novell.com/wiki/images/f/fd/Kmpm-code10.pdf, which mentions the “-s” option of %suse_kernel_module_package to modify the default script behaviour. Unfortunately so far i failed in writing an appropriate sub-package-spec. Any hints (e.g. the mentioned default-template, which actually adds the post-scriptlet) are highly appreciated.


do you have /dev and /proc mounted in your chroot ?
mount -t proc none /pathtochroot/proc
mount -o bind /dev /pathtochroot/dev

Yes, i think the init_buildsystem script provided by SUSE mounts those directories, but slightly different:

mkdir -p $BUILD_ROOT/proc
mkdir -p $BUILD_ROOT/dev/pts
mount -n -tproc none $BUILD_ROOT/proc 2>/dev/null || true
mount -n -tdevpts none $BUILD_ROOT/dev/pts 2>/dev/null || true

$BUILD_ROOT equals /pathtochroot from below.