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

Re: make-kpkg and 2.6.29.2 vanilla sources



On Sun, May 03 2009, Bernd Zeimetz wrote:

> David Paleino wrote:
>
>>   * The image postinst no longer runs the initramfs creation
>>     commands. Instead, there are example scripts provided that will
>>     perform the task. These scripts will work for official kernel images
>>     as well.
>
> Don't use the example scripts, they're kinda weird. initramfs-tools installs
> proper hooks there, at least since 0.93.2.

        What horrendous advice. Obviously, there was no attempt to
 actually test the advice, or even to read the hook script. And as such,
 this advice is wrong. Observe:
,----
| __> dpkg -x /var/cache/apt/archives/initramfs-tools_0.93.2_all.deb root1
| __> cat root1/etc/kernel/postinst.d/initramfs-tools
| #!/bin/sh
| 
| # passing the kernel version is required
| [ -z "$1" ] && exit 0
| 
| # kernel-package passes an extra arg; hack to not run under kernel-package
| [ -z "$2" ] || exit 0
| 
| # we're good - create initramfs.  update runs do_bootloader
| update-initramfs -c -t -k "$1"
`----

        See where it says that this hook doe snot run under
 kernel-package images? maks has not yet had time to upload the patched
 hook (he does have other things to do, you know). Now observe the
 script below, from kernel-package.

        See how it aborts when there is an indication that the
 kernel-image does not need an initrd? So that people who are compiling
 their own kernels and who do not need an initramfs are not saddled with
 one anyway?

        See also that it only triggers when the maintainer script is
 called with the configure command? See how it supports, like
 kernel-package does, having your vmlinuz-* being not in .boot, but
 elsewhere? 

        Weird my foot.

        manoj

,----
| __> cat etc/kernel/postinst.d/initramfs 
| #! /bin/sh
| 
| set -e
| 
| if [ -n "$INITRD" ] && [ "$INITRD" = 'No' ]; then
|     exit 0
| fi
| version="$1"
| vmlinuz_location="$2"
| 
| 
| if [ -n "$DEB_MAINT_PARAMS" ]; then
|     eval set -- "$DEB_MAINT_PARAMS"
|     if [ -z "$1" ] || [ "$1" != "configure" ]; then
|         exit 0;
|     fi
| fi
| 
| # passing the kernel version is required
| [ -z "$version" ] && exit 1
| 
| 
| if [  -n "$vmlinuz_location" ]; then
|     # Where is the image located? We'll place the initrd there.
|     boot=$(dirname "$vmlinuz_location")
|     bootarg="-b $boot"
| fi
| 
| # 
| if which update-initramfs >/dev/null ; then
|     update-initramfs -c -t -k "$version" $bootarg
| fi
`----

-- 
Conserve energy, kill yourself. jon@dscatoh0.sac.ca.us
Manoj Srivastava <srivasta@debian.org> <http://www.debian.org/~srivasta/>  
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C


Reply to: