I have chosen to generate the fitting initrd-image for a Linux-kernel
built with kernel-package via initramfs-example-scripts in
"/etc/kernel/*.d".
While testing, I discovered a problem while purging via dpkg,
"/etc/kernel/postrm.d/initramfs" is twice invoked. The first
invokation is purging the initrd-image, the second one can't because
there is no initrd-image file, anymore.

Out of curiosity:
Can you please describe the way to put all informations/scripts into a
linux-image-*.deb concerning initrd-image creation/deletion (building
with kernel-package)?

INSTRUCTIONS:

[1] Copy initramfs-example-scripts provided by kernel-package (here: v12.008):

$ cp -v /usr/share/kernel-package/examples/etc/kernel/postinst.d/initramfs
/etc/kernel/postinst.d/
$ cp -v /usr/share/kernel-package/examples/etc/kernel/postrm.d/initramfs
/etc/kernel/postrm.d/

On the filesystem:

/etc/kernel/postinst.d:
total 8
-rwxr-xr-x 1 root root 560 2009-04-14 06:09 initramfs
-rwxr-xr-x 1 root root 264 2009-04-13 15:02 initramfs-tools

/etc/kernel/postrm.d:
total 8
-rwxr-xr-x 1 root root 597 2009-04-14 06:09 initramfs
-rwxr-xr-x 1 root root 220 2009-04-13 15:03 initramfs-tools

Without both initramfs-scripts the according initrd-image is neither
generated (install via dpkg -i *.deb) nor removed (dpkg --purge
*.deb), that means the scripts are not obsolete (as you answered).

[2] Required: File "/etc/kernel-img.conf":

--- BOF ---
# Kernel Image management overrides
# See kernel-img.conf(5) for details
do_symlinks = Yes
postinst_hook = /usr/sbin/update-grub
postrm_hook = /usr/sbin/update-grub
do_bootloader = no
do_initrd = Yes
relative_links = Yes
--- EOF ---

[3] Problems purging linux-image Debian-package via dpkg

Removing the initrd-image seems to be broken, because
"/etc/kernel/postrm.d/initramfs" is twice invoked. At the moment, I
can't see where it comes from.
Correlation with the scripts of initramfs-tools package?
Any idea?

>From "dpkg --purge $package" (Details see below investigations section):
[...]
run-parts: executing /etc/kernel/postrm.d/initramfs
[...]
run-parts: executing /etc/kernel/postrm.d/initramfs
[...]

--Sedat

----- BEGIN INVESTIGATIONS -----

# dpkg --purge $(dpkg -l | grep 2.6.30-rc1-git7-iniza-1 | cut -d' ' -f 3)
(Reading database ... 246059 files and directories currently installed.)
Removing linux-headers-2.6.30-rc1-git7-iniza-1 ...
Purging configuration files for linux-headers-2.6.30-rc1-git7-iniza-1 ...
Removing linux-image-2.6.30-rc1-git7-iniza-1 ...
Examining /etc/kernel/prerm.d.
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs
run-parts: executing /etc/kernel/postrm.d/initramfs-tools
Running postrm hook script /usr/sbin/update-grub.
Generating grub.cfg ...
Found Debian background: moreblue-orbit-grub.png
Found linux image: /boot/vmlinuz-2.6.30-rc1-git5-iniza-7
Found initrd image: /boot/initrd.img-2.6.30-rc1-git5-iniza-7
Found linux image: /boot/vmlinuz-2.6.29-1.slh.3-sidux-686
Found initrd image: /boot/initrd.img-2.6.29-1.slh.3-sidux-686
Found linux image: /boot/vmlinuz-2.6.29-1.slh.1-sidux-686
Found initrd image: /boot/initrd.img-2.6.29-1.slh.1-sidux-686
Found linux image: /boot/vmlinuz-2.6.29-rc8-drm-rawhide-dea27f6-gcc44-gnu-gold
Found initrd image:
/boot/initrd.img-2.6.29-rc8-drm-rawhide-dea27f6-gcc44-gnu-gold
Found linux image: /boot/vmlinuz-2.6.26-5.slh.6-sidux-686
Found initrd image: /boot/initrd.img-2.6.26-5.slh.6-sidux-686
Warning: update-grub_lib is deprecated, use grub-mkconfig_lib instead
Found memtest86+ image: /boot/memtest86+.bin
Found Microsoft Windows XP Professional on /dev/sda1
Found Debian GNU/Linux (squeeze/sid) on /dev/sda6
done
Purging configuration files for linux-image-2.6.30-rc1-git7-iniza-1 ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs
Cannot delete /boot/initrd.img-2.6.30-rc1-git7-iniza-1, doesn't exist.
run-parts: /etc/kernel/postrm.d/initramfs exited with return code 1
Failed to process /etc/kernel/postrm.d at
/var/lib/dpkg/info/linux-image-2.6.30-rc1-git7-iniza-1.postrm line
265.
dpkg: error processing linux-image-2.6.30-rc1-git7-iniza-1 (--purge):
 subprocess post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-2.6.30-rc1-git7-iniza-1

----- END INVESTIGATIONS -----

On Tue, Apr 14, 2009 at 7:33 AM, Manoj Srivastava <[email protected]> wrote:
> On Tue, Apr 14 2009, Sedat Dilek wrote:
>
>> Does this mean a Linux-kernel compiled with latest kernel-package does
>> not need any initramfs-script in "/etc/kernel/*.d", because the
>> generated "linux-image-$version*.deb" has all scripts to create and
>> remove an initrd-image (scripts shipped in the Debian package)
>> automatically?
>
>        No. It means that the kernel package does not limit you to a
>  predefined policy for initramfs creators. *You* get to chose what
>  scripts you want to drop into /etc/kernel/postrm.d/ and
>  /etc/kernel/postinst.d/
>
>> To ask precisely: These scripts are obsolete, now?
>> /etc/kernel/postrm.d/initramfs
>> /etc/kernel/postinst.d/initramfs
>
>
>        No, they are not obsolete. But now you, as end user, have full
>  control: you can put in any scripts there that you want, not just the
>  ones kernel--package provides as examples. Or, if you so choose, elect
>  not to have any scripts at all (by building everything into your
>  kernel).
>
>        The 12.X kernel-packages are about expanding user choice.
>
>        manoj
> --
> When the revolution comes, count your change.
> Manoj Srivastava <[email protected]> <http://www.debian.org/~srivasta/>
> 1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C
>



--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to