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

Re: compiling a kernel from kernel.org [SOLVED]

On Wed, Oct 21 2009, Gregor Galwas wrote:

> The only problem to be solved was the initrd. it has NOT been
> generated by dpkg during the installation.
> so I generated it using mkinitramfs -c -k 2.6.32-rc5. worked
> fine. update-grub - worked fine as well.

,----[ Manual page make-kpkg(1) ]
|  --initrd
|         If make-kpkg is generating a kernel-image package, arrange to
|         convey to the hook scripts run from the post installation
|         maintainer scripts that this image requires an initrd, and that
|         the initrd generation hook scripts should not short circuit
|         early. Without this option, the example initramfs hook scripts
|         bundled in with kernel-package will take no action on
|         installation.  The same effect can be achieved by setting the
|         environment variable INITRD to any non empty value.  Please note
|         that unless there are hook scripts in /etc/kernel or added into
|         the hook script parameter of /etc/kernel-img.conf.  no initrd
|         will be created (the bundled in example scripts are just
|         examples -- user action is required before anything happens).

,----[ /usr/share/doc/kernel-package/README.gz ]
|  gotchas. Note that you will have to arrange for the actual
|  initrd creation to take place by installing a script like
|  /usr/share/kernel-package/examples/etc/kernel/post{inst,rm}.d/yaird
|  or, alternately,
|  /usr/share/kernel-package/examples/etc/kernel/post{inst,rm}.d/initramfs 
|  into the corresponding directories /etc/kernel/post{inst,rm}.d,
|  since the kernel-postinst does not arrange for the initramfs
|  creator to be called. You can thus select your own;
|  initramfs-tools or yaird.
|  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/yaird \
|     /etc/kernel/postinst.d/
|  cp /usr/share/kernel-package/examples/etc/kernel/postrm.d/yaird \
|     /etc/kernel/postrm.d/
| --8<---------------cut here---------------end--------------->8---
|         Or, alternately, you could do:
| --8<---------------cut here---------------start------------->8---
|  cp /usr/share/kernel-package/examples/etc/kernel/postinst.d/initramfs \
|     /etc/kernel/postinst.d/
|  cp /usr/share/kernel-package/examples/etc/kernel/postrm.d/initramfs \
|     /etc/kernel/postrm.d/
| --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
| scripts.
| For example, if you use linux-headers-* packages to compile third
| party modules so that you do not have to keep the sources directory
| around, you might be interested in:
| --8<---------------cut here---------------start------------->8---
| /etc/kernel/header_postinst.d/link
| /etc/kernel/header_postrm.d/link
| /etc/kernel/header_prerm.d/link
| /etc/kernel/postinst.d/force-build-link
| /etc/kernel/postrm.d/force-build-link
| --8<---------------cut here---------------end--------------->8---
|         These scripts will try to make sure that the symlink
|  /lib/modules/$VERSION/build 
|  is sane -- that is points to the header packages whether you install
|  the image packages first, or the header packages first -- and takes
|  care of cleanup when either of the packages are installed.

        Perhaps people who maintain FAQ's on this list add the above?


Some people have a great ambition: to build something that will last, at
least until they've finished building it.
Manoj Srivastava <srivasta@acm.org> <http://www.golden-gryphon.com/>  
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C

Reply to: