linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: Paolo Abeni <pabeni@redhat.com>, linux-kernel@vger.kernel.org
Cc: linux-kbuild@vger.kernel.org, Michal Marek <mmarek@suse.com>
Subject: Re: [PATCH] kbuild/mkspec: clean boot loader configuration on rpm removal
Date: Wed, 2 Mar 2016 15:38:11 +0100	[thread overview]
Message-ID: <56D6FAD3.3000208@stressinduktion.org> (raw)
In-Reply-To: <cf947ffc2e633b0a2b75c21bd42c2061f3c5d418.1456925798.git.pabeni@redhat.com>

On 02.03.2016 15:28, Paolo Abeni wrote:
> This patch add a rpm preuninstall scriptlet to cleanup the
> boot loader configuration on kernel package uninstall.
> The initrd for the to-be-removed kernel is deleted, too.
>
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> ---
>   scripts/package/mkspec | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/scripts/package/mkspec b/scripts/package/mkspec
> index fe44d68..b6de63c 100755
> --- a/scripts/package/mkspec
> +++ b/scripts/package/mkspec
> @@ -138,6 +138,11 @@ echo "/sbin/installkernel $KERNELRELEASE /boot/.vmlinuz-$KERNELRELEASE-rpm /boot
>   echo "rm -f /boot/.vmlinuz-$KERNELRELEASE-rpm /boot/.System.map-$KERNELRELEASE-rpm"
>   echo "fi"
>   echo ""
> +echo "%preun"
> +echo "if [ -x /sbin/new-kernel-pkg ]; then"
> +echo "new-kernel-pkg --remove $KERNELRELEASE --rminitrd --initrdfile=/boot/initramfs-$KERNELRELEASE.img"
> +echo "fi"
> +echo ""
>   echo "%files"
>   echo '%defattr (-, root, root)'
>   echo "/lib/modules/$KERNELRELEASE"
>

Maybe we should also switch to new-kernel-pkg for the postinstall call? 
How about switching to kernel-install?

Thanks,
Hannes

  reply	other threads:[~2016-03-02 14:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-02 14:28 [PATCH] kbuild/mkspec: clean boot loader configuration on rpm removal Paolo Abeni
2016-03-02 14:38 ` Hannes Frederic Sowa [this message]
2016-03-02 15:09   ` Josh Boyer
2016-03-03  9:09     ` Paolo Abeni
2016-03-04 21:55       ` Michal Marek
2016-03-04 21:59 ` Michal Marek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56D6FAD3.3000208@stressinduktion.org \
    --to=hannes@stressinduktion.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.com \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).