[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: custom kernel not triggering update-initramfs



On 7 November 2014 06:05, Daniel Baumann
<daniel.baumann@progress-technologies.net> wrote:
> On 11/06/2014 11:53 PM, Aaron McSorley wrote:
>> I cannot get my custom kernel to trigger an update-initramfs
>
> you probably didn't build it right, how did you do it? did you use make
> deb or kernel-package or something, rather than properly rebuilding a
> patched debian source package?

Well, 'properly rebuilding a patched debian source package' is
something hardly documented for a Linux kernel, especially when what
you have is not really a small patch for existing Debian kernel but a
fresh upstream tarball or random git tree. Building a Debian kernel
package requires some weird dependency packages which even the Debian
kernel maintainers fail to generate properly and/or upload with the
kernel time and time again. It requires non-trivial amount of cpu time
and disk space and when an error happens during the build you have to
do whole build from start. So overall _very_ unpleasant thing.

There is 'make deb' target in upstream kernel which is completely
useless because among other things it cannot build kernel headers.

And there is kernel-package which needs the --initrd option when
building package to enable creating initrd. However, even with this
option the initrd may not be created with some versions of debian
because the kernel-package and initramfs-tools maintainers cannot
agree on a way to configure generating an initramfs.

So I gave up and just wrote a live-build chroot hook that generates
missing initramfs.

#!/bin/bash -x
for i in boot/vmlinuz* ; do
    kernel="$(basename "$i")"
    version="${kernel##vmlinuz-}"
    initrd="boot/initrd.img-${version}"
    [ -f "$initrd" ] || update-initramfs -c -k "$version" || true
done

HTH

Michal


Reply to: