On Sun, Feb 17, 2008 at 08:16:25PM -0600, Matt Domsch wrote: > is there any reason why we can't just move %post to %posttrans? two patches below, moving %post to %posttrans in the kernel packages (not -devel of course), and implementing the hooks in new-kernel-pkg. Thanks, Matt -- Matt Domsch Linux Technology Strategist, Dell Office of the CTO linux.dell.com & www.dell.com/linux --- kernel.spec.orig 2008-02-15 21:06:33.000000000 -0600 +++ kernel.spec 2008-02-17 23:30:06.000000000 -0600 @@ -1590,13 +1590,13 @@ fi\ %{nil} # -# This macro defines a %%post script for a kernel package and its devel package. -# %%kernel_variant_post [-v <subpackage>] [-s <s> -r <r>] <mkinitrd-args> +# This macro defines a %%posttrans script for a kernel package and its devel package. +# %%kernel_variant_posttrans [-v <subpackage>] [-s <s> -r <r>] <mkinitrd-args> # More text can follow to go at the end of this variant's %%post. # -%define kernel_variant_post(s:r:v:) \ +%define kernel_variant_posttrans(s:r:v:) \ %{expand:%%kernel_devel_post %{?-v*}}\ -%{expand:%%post %{?-v*}}\ +%{expand:%%posttrans %{?-v*}}\ %{-s:\ if [ `uname -i` == "x86_64" -o `uname -i` == "i386" ] &&\ [ -f /etc/sysconfig/kernel ]; then\ @@ -1623,22 +1623,22 @@ fi}\ %{nil} %kernel_variant_preun -%kernel_variant_post -s kernel-smp -r kernel +%kernel_variant_posttrans -s kernel-smp -r kernel %kernel_variant_preun smp -%kernel_variant_post -v smp +%kernel_variant_posttrans -v smp %kernel_variant_preun PAE -%kernel_variant_post -v PAE -s kernel-smp -r kernel-PAE +%kernel_variant_posttrans -v PAE -s kernel-smp -r kernel-PAE %kernel_variant_preun debug -%kernel_variant_post -v debug +%kernel_variant_posttrans -v debug -%kernel_variant_post -v PAEdebug -s kernel-smp -r kernel-PAEdebug +%kernel_variant_posttrans -v PAEdebug -s kernel-smp -r kernel-PAEdebug %kernel_variant_preun PAEdebug %kernel_variant_preun xen -%kernel_variant_post xen -v xen -s kernel-xen[0U] -r kernel-xen -- `[ -d /proc/xen -a ! -e /proc/xen/xsd_kva ] || echo --multiboot=/%{image_install_path}/xen.gz-%{KVERREL}` +%kernel_variant_posttrans xen -v xen -s kernel-xen[0U] -r kernel-xen -- `[ -d /proc/xen -a ! -e /proc/xen/xsd_kva ] || echo --multiboot=/%{image_install_path}/xen.gz-%{KVERREL}` if [ -x /sbin/ldconfig ] then /sbin/ldconfig -X || exit $? --- new-kernel-pkg.orig 2008-02-15 13:22:46.000000000 -0600 +++ new-kernel-pkg 2008-02-17 20:20:47.000000000 -0600 @@ -183,6 +183,15 @@ install() { [ -n "$verbose" ] && echo "$liloConfig does not exist, not running grubby" fi + local d + local f + for d in /etc/kernel/postinst.d /etc/kernel/postinst.d/$version ; do + if [ -d $d ]; then + for f in $(ls $d/); do + [ -x $d/$f ] && $d/$f $version $bootPrefix/$kernelName-$version + done + fi + done } remove() { @@ -193,6 +202,16 @@ remove() { return fi + local d + local f + for d in /etc/kernel/prerm.d /etc/kernel/prerm.d/$version ; do + if [ -d $d ]; then + for f in $(ls $d/); do + [ -x $d/$f ] && $d/$f $version $bootPrefix/$kernelName-$version + done + fi + done + if [ -n "$cfgGrub" ]; then [ -n "$verbose" ] && echo "removing $version from $grubConfig" $grubby --remove-kernel=$bootPrefix/$kernelName-$version _______________________________________________ Fedora-kernel-list mailing list Fedora-kernel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/fedora-kernel-list