public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
Cc: dcavalca@meta.com, linux-kbuild@vger.kernel.org,
	linux-kernel@vger.kernel.org, masahiroy@kernel.org,
	ndesaulniers@google.com, nicolas@fjasle.eu,
	stable@vger.kernel.org
Subject: Re: [PATCH v2] rpm-pkg: simplify installkernel %post
Date: Tue, 12 Dec 2023 12:19:18 -0700	[thread overview]
Message-ID: <20231212191918.GA2914380@dev-arch.thelio-3990X> (raw)
In-Reply-To: <20231212171044.1108464-1-jtornosm@redhat.com>

On Tue, Dec 12, 2023 at 06:10:44PM +0100, Jose Ignacio Tornos Martinez wrote:
> A new installkernel application is now included in systemd-udev package
> and it has been improved to allow simplifications.
> 
> For the new installkernel application, as Davide says:
> <<The %post currently does a shuffling dance before calling installkernel.
> This isn't actually necessary afaict, and the current implementation
> ends up triggering downstream issues such as
> https://github.com/systemd/systemd/issues/29568
> This commit simplifies the logic to remove the shuffling. For reference,
> the original logic was added in commit 3c9c7a14b627("rpm-pkg: add %post
> section to create initramfs and grub hooks").>>
> 
> But we need to keep the old behavior as well, because the old installkernel
> application from grubby package, does not allow this simplification and
> we need to be backward compatible to avoid issues with the different
> packages. So the easiest solution is to check the package that provides
> the installkernel application, and simplify (and fix for this
> application at the same time), only if the package is systemd-udev.
> 
> cc: stable@vger.kernel.org
> Co-Developed-by: Davide Cavalca <dcavalca@meta.com>
> Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>

Thanks, I can confirm that installing the same RPM package produced by
binrpm-pkg on both Fedora 38 and 39 works as expected now and the check
seems reasonable to me but I'll defer to Masahiro for further comments.

Tested-by: Nathan Chancellor <nathan@kernel.org>

> ---
> V1 -> V2:
> - Complete to be backward compatible with the previous installkernel
> application.
> 
>  scripts/package/kernel.spec | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/scripts/package/kernel.spec b/scripts/package/kernel.spec
> index 3eee0143e0c5..d4276ddb6645 100644
> --- a/scripts/package/kernel.spec
> +++ b/scripts/package/kernel.spec
> @@ -77,12 +77,16 @@ rm -rf %{buildroot}
>  
>  %post
>  if [ -x /sbin/installkernel -a -r /boot/vmlinuz-%{KERNELRELEASE} -a -r /boot/System.map-%{KERNELRELEASE} ]; then
> +if [ $(rpm -qf /sbin/installkernel --queryformat "%{n}") = systemd-udev ];then
> +/sbin/installkernel %{KERNELRELEASE} /boot/vmlinuz-%{KERNELRELEASE} /boot/System.map-%{KERNELRELEASE}
> +else
>  cp /boot/vmlinuz-%{KERNELRELEASE} /boot/.vmlinuz-%{KERNELRELEASE}-rpm
>  cp /boot/System.map-%{KERNELRELEASE} /boot/.System.map-%{KERNELRELEASE}-rpm
>  rm -f /boot/vmlinuz-%{KERNELRELEASE} /boot/System.map-%{KERNELRELEASE}
>  /sbin/installkernel %{KERNELRELEASE} /boot/.vmlinuz-%{KERNELRELEASE}-rpm /boot/.System.map-%{KERNELRELEASE}-rpm
>  rm -f /boot/.vmlinuz-%{KERNELRELEASE}-rpm /boot/.System.map-%{KERNELRELEASE}-rpm
>  fi
> +fi
>  
>  %preun
>  if [ -x /sbin/new-kernel-pkg ]; then
> -- 
> 2.43.0
> 

  reply	other threads:[~2023-12-12 19:19 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20231108000749.GA3723879@dev-arch.thelio-3990X>
2023-12-12 17:10 ` [PATCH v2] rpm-pkg: simplify installkernel %post Jose Ignacio Tornos Martinez
2023-12-12 19:19   ` Nathan Chancellor [this message]
2023-12-18 18:26   ` Masahiro Yamada
2023-12-19  8:43     ` Jose Ignacio Tornos Martinez
2023-12-19 15:56     ` [PATCH v3] " Jose Ignacio Tornos Martinez
2023-12-19 16:49       ` Masahiro Yamada
2023-12-19 20:17         ` [PATCH v4] " Jose Ignacio Tornos Martinez
2023-12-20 17:18           ` Nathan Chancellor
2023-12-26  4:02           ` Masahiro Yamada
2024-01-07 15:25             ` Jose Ignacio Tornos Martinez
2024-01-14  8:06             ` [PATCH V5 1/2] " Jose Ignacio Tornos Martinez
2024-01-17  1:29               ` Masahiro Yamada
2024-01-18 14:12                 ` Jose Ignacio Tornos Martinez
2024-01-21 17:32                   ` Masahiro Yamada
2024-01-22 18:22                     ` Jose Ignacio Tornos Martinez
2024-01-22 18:22                     ` [PATCH] " Jose Ignacio Tornos Martinez
2024-01-28  7:32                       ` Masahiro Yamada
2024-01-29  9:27                         ` Jose Ignacio Tornos Martinez
2024-01-29  9:28                         ` [PATCH v7] " Jose Ignacio Tornos Martinez
2024-01-31  1:48                           ` Masahiro Yamada
2024-01-14  8:07             ` [PATCH V5 2/2] rpm-pkg: avoid install/remove the running kernel Jose Ignacio Tornos Martinez
2024-01-17  1:32               ` Masahiro Yamada
2024-01-18 14:12                 ` Jose Ignacio Tornos Martinez
2024-01-21 17:33                   ` Masahiro Yamada
2024-01-22 15:53                     ` Jose Ignacio Tornos Martinez

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=20231212191918.GA2914380@dev-arch.thelio-3990X \
    --to=nathan@kernel.org \
    --cc=dcavalca@meta.com \
    --cc=jtornosm@redhat.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=nicolas@fjasle.eu \
    --cc=stable@vger.kernel.org \
    /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