[lkml]   [2011]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: how to avoid that goes mad, if I am not root?
Harald Dunkel writes:
> Hash: SHA1
> Hi folks,
> I am trying to build my own custom Debian kernel package. Problem:
> If the kernel is supposed to be installed in a temporary package
> build directory, then it dies with
> :
> :
> make[1]: Entering directory `/var/tmp/build_kernel/raw-kernel-2.6.37/linux-2.6.37'
> sh /var/tmp/build_kernel/raw-kernel-2.6.37/linux-2.6.37/arch/x86/boot/ 2.6.37 arch/x86/boot/bzImage \
> "/var/tmp/build_kernel/raw-kernel-2.6.37/debian/raw-kernel-2.6.37/boot"
> run-parts: executing /etc/kernel/postinst.d/dkms 2.6.37 /var/tmp/build_kernel/raw-kernel-2.6.37/debian/raw-kernel-2.6.37/boot/vmlinuz-2.6.37
> dkms: running auto installation service for kernel 2.6.37:
> nvidia-current (260.19.29)...done.
> vboxhost (3.2.12)...done.
> run-parts: executing /etc/kernel/postinst.d/initramfs-tools 2.6.37 /var/tmp/build_kernel/raw-kernel-2.6.37/debian/raw-kernel-2.6.37/boot/vmlinuz-2.6.37
> run-parts: executing /etc/kernel/postinst.d/pm-utils 2.6.37 /var/tmp/build_kernel/raw-kernel-2.6.37/debian/raw-kernel-2.6.37/boot/vmlinuz-2.6.37
> touch: cannot touch `/var/run/do-not-hibernate': Permission denied
> run-parts: /etc/kernel/postinst.d/pm-utils exited with return code 1
> make[3]: *** [install] Error 1
> make[2]: *** [install] Error 2
> make[1]: *** [sub-make] Error 2
> make[1]: Leaving directory `/var/tmp/build_kernel/raw-kernel-2.6.37/linux-2.6.37'
> AFAICS this happens because the arch/x86/boot/ script calls
> /sbin/installkernel, which in turn runs all the scripts delivered
> by various other packages. This is fine for a regular kernel install
> as well as for an installation of the final kernel package, but for
> a non-root install in a package build directory /sbin/installkernel
> and all the run-parts scripts should not be run. installkernel doesn't
> even know the redefined install directory.
> Would it be possible to avoid that /sbin/installkernel is run by
> install,sh, e.g. if the install directory has been redefined, or if
> UID != 0?
> Any helpful comment would be highly appreciated

First, at least on x86, the kernel will look for the 'installkernel'
executable first in your own ~/bin/, so if you have that then it will
override /sbin/installkernel.

Second, you don't have to let the kernel choose; just run
/path/to/myinstallkernel $kernelversion path/to/boot/image
(Disadvantage: path/to/boot/image varies depending on arch.)

 \ /
  Last update: 2011-01-20 22:51    [W:0.092 / U:2.728 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site