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

Re: [OT] compiled kernels do not boot

Le 26/03/2011 15:25, Hugo Vanwoerkom a écrit :
> tv.debian@googlemail.com wrote:
>> 25/03/2011 21:19, Hugo Vanwoerkom wrote:
>>> Hi,
>>> I have tried 3 self-compiled kernels and they do not boot. They compile
>>> w/o errors.
>>> They are compiled with 'make-kpkg --revision 1 --append-to-version -ck2
>>> --initrd kernel_image'. This is with an uptodate Sid.
>>> I have looked at the initrd files with cpio and I see nothing wrong: the
>>> 'init' file is there as it should be, etc. But what to look for?
>>> I use legacy-grub and that just sits there with 'boot' as the last
>>> command, forever.
>>> Does anybody have any suggestions as to what to try next?
>>> I have used make-kpkg many times, but not in the last 5 months, and this
>>> has never happened to me.
>>> Hugo
>> Hi, I don't think there is a general problem in kernel-package
>> (12.036+nmu1 here), I compiled three kernels (2.6.37* and 2.6.38*) this
>> week and one more is backing right now without issue.
>> Are the required hooks scripts for your setup in place and valid (see
>> /usr/share/kernel-package/examples/etc/) ? Any module missing from
>> /etc/initramfs-tools/modules ?
> I did not change the scripts in /etc/kernel. Did you?

Yes, this is from kernel-package README :

"Let me repeat:
 Since nothing is created automatically. you need to provide a hook
 script for things to happen when you install the kernel image
 package.  The user provides such scripts. For example, to invoke
 mkinitramfs, I did:
--8<---------------cut here---------------start------------->8---
 cp /usr/share/kernel-package/examples/etc/kernel/postinst.d/initramfs \
 cp /usr/share/kernel-package/examples/etc/kernel/postrm.d/initramfs \
--8<---------------cut here---------------end--------------->8---

        These scripts above to nothing unless the corresponding
 packages are installed (initramfs-tools or yaird), so you could
 potentially cp both over -- as long as you never install both yaird
 and initramfs-tools at the same time.

        To run grub, I have in /etc/kernel-img.conf:
--8<---------------cut here---------------start------------->8---
postinst_hook = update-grub
postrm_hook   = update-grub
--8<---------------cut here---------------end--------------->8---

You can look at other example in the examples directory:
/usr/share/kernel-package/examples/ to see if there are other example
script you want to cp into /etc/kernel -- and you can create your own

This is my setup :

ls -lR /etc/kernel/

total 8
-rwxr-xr-x 1 root root  436  4 juin   2010 dkms
-rwxr-xr-x 1 root root 1404  1 mai    2009 link

total 4
-rwxr-xr-x 1 root root 522  1 mai    2009 link

total 0

total 4
-rwxr-xr-x 1 root root 430  1 mai    2009 link

total 24
-rwxr-xr-x 1 root root  436  4 juin   2010 dkms
-rwxr-xr-x 1 root root  612  1 mai    2009 initramfs
-rwxr-xr-x 1 root root  704  9 juil.  2010 initramfs-tools
-rwxr-xr-x 1 root root  196 30 nov.   2009 pm-utils
-rwxr-xr-x 1 root root 3326 10 sept.  2009 symlink_hook
-rwxr-xr-x 1 root root  496 18 déc.  19:40 zz-update-grub

total 12
-rwxr-xr-x 1 root root 919  1 mai    2009 initramfs
-rwxr-xr-x 1 root root 567  9 juil.  2010 initramfs-tools
-rwxr-xr-x 1 root root 496 18 déc.  19:40 zz-update-grub

total 0

total 4
-rwxr-xr-x 1 root root 630 17 juil.  2010 dkms

Ignore "dkms" which is not relevant to your situation. The scripts are
mostly the example ones provided by kernel-package, some slightly
adapted to my taste.

Also :

cat /etc/kernel-img.conf

# Kernel image management overrides
# See kernel-img.conf(5) for details
do_symlinks = yes
relative_links = yes
do_bootloader = no
do_bootfloppy = no
do_initrd = yes
link_in_boot = no
image_dest = /

> I have not added any module to /etc/initramfs-tools/modules.

I have special needs since my system is LUKS on raid for everything
except /boot, maybe you don't need anything special here.

>> Maybe you could try with "make deb-pkg" target and see if it boots
>> this way.
> Never used that before. But I ran "make deb-pkg" in the kernel tree and
> that created a .deb. Installed that and booted that kernel and it
> behaved exactly the same way: last grub command is 'boot' and it just
> sits there.
> Hugo

The deb-pkg target has been added some time ago and it is now the
preferred way to build a kernel image in Debian if I understood well, I
still prefer to use kernel-package though.

If the custom kernel image doesn't boot using the stock config from a
Debian kernel (known to boot), then the image and/or initrd is in the
wrong place, doesn't exist, or doesn't contain what's needed for your
setup. That's why I would recommend booting from a Debian kernel, having
a look at the loaded modules to see if something could be missing from
your initrd (and then add it to /etc/initramfs-tools/modules before
updating initrd).

Reply to: