Add a trigger for creating/updating the initramfs.

It's activated at post-install time, and only if template uses:
triggers="initramfs-tools". Use it in the kernel package.

Also print a message when a trigger is being run.

--HG--
extra : convert_revision : 3f2a0c113ed523e4b09822665cf6d94e30b7d1e4
This commit is contained in:
Juan RP 2009-03-12 11:50:46 +01:00
parent 53747489f0
commit bbcc9c4b13
5 changed files with 66 additions and 41 deletions

View file

@ -1,36 +0,0 @@
#
# This scripts creates the initramfs for the newly installed
# kernel package.
#
case "$2" in
pre)
;;
post)
echo "Running $3-$4 post installation hooks..."
if [ "$1" = "NOTSET" ]; then
mntproc_cmd="mount -t proc proc /proc"
umntproc_cmd="umount /proc"
mntsys_cmd="mount -t sysfs none /sys"
umntsys_cmd="umount /sys"
initramfs_cmd="update-initramfs"
else
mntproc_cmd="chroot $1 mount -t proc proc ./proc"
umntproc_cmd="chroot $1 umount ./proc"
mntsys_cmd="chroot $1 mount -t sysfs none ./sys"
umntsys_cmd="chroot $1 umount ./sys"
initramfs_cmd="chroot $1 update-initramfs"
fi
if [ ! -f ./var/lib/initramfs-tools/$4 ]; then
initramfs_cmd="$initramfs_cmd -c -k $4"
else
initramfs_cmd="$initramfs_cmd -u -k $4"
fi
${mntproc_cmd}
${mntsys_cmd}
${initramfs_cmd}
${umntproc_cmd}
${umntsys_cmd}
;;
esac

View file

@ -17,6 +17,8 @@ long_desc="
This package provides the linux kernel image, kernel modules
and firmware files."
triggers="initramfs-tools"
Add_dependency full glibc
Add_dependency full dash
Add_dependency full coreutils