Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4863783rdb; Tue, 12 Dec 2023 11:19:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IEy8P76XiQTR4nWyenj2SIKx4uA4bmrfAUE2fktSnebmxglvO4vnN0IIKPgFeQwnPfbLkZX X-Received: by 2002:a17:902:daca:b0:1d0:b066:f83 with SMTP id q10-20020a170902daca00b001d0b0660f83mr8587561plx.106.1702408780132; Tue, 12 Dec 2023 11:19:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702408780; cv=none; d=google.com; s=arc-20160816; b=nW3wfNv29tBp7/Iod7B5ICIahZ5G6fdHLZP5X/mJdsuOX5F6W8HcZclkJdUBLCoNgy H9rbIc4ecyzDnjaBH1pFrdajPzlfS4RljmD6UYBQDG6ls033LSg8jFc5yIaA0KOHT+YO EzOVVKNvUMRL53D/0db8p+WHElQ+QRhAKLC24PRG/uEFtGiaUvyta+Ynb1WJ2WOl08H0 xg3MI18CAgnOvCTzaqzoOeyMpmMH/vJK23lK2hWcnx4wlFZ5fiamoc2yN8rKx5yXfuIs 4Y0ouM2UmEefBQiRyXOdp2Z/ApC9TrilU1N+Y8j+fV9FeoLeqQo+5kyonku64uVXV3YP UtOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=42/PyHRofNEoUmt+aiZitX10jL43ww6GB4PZhSZSj0Q=; fh=P35jFCOU6rv7DbEqL7IuH0dJNc5LFBvvdX3fPaMOf14=; b=JmgTVMS7wmGlPtp0s1p5oYCAftNdxAjWJLcAA8ere+pPdzREK3N1UmPL4mPlM1Mcpd nrYMY3125aoje4mqyLngDse6yhAXko2LGNhDeiEljjU4J8jvxIxpFIPOLyC3vtHeOk8t DvhiMaEIfU+onWFkA2tBVcxxGUg6hpdpreTWJ3goly9u18q6pLB9/iI12G4LPcZqeQgB w9IMdv7rjraSM9f+Pfiu/tAfZFl8cMubE2GYbEpLYau6bJT3zG2GzaakRTavkaUGJxKs T/lbIdoya7JJ9KRFpABg7YV0ATFU+LD0OkyoChCj8fcB3B5b73ko960VKPzdYyyhVIvE EWJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sv4X21Aq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id b2-20020a170902d50200b001d344a3f78asi687243plg.84.2023.12.12.11.19.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 11:19:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sv4X21Aq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 786F880E7092; Tue, 12 Dec 2023 11:19:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233067AbjLLTTR (ORCPT + 99 others); Tue, 12 Dec 2023 14:19:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235120AbjLLTTO (ORCPT ); Tue, 12 Dec 2023 14:19:14 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05E88F5 for ; Tue, 12 Dec 2023 11:19:21 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 266EEC433C8; Tue, 12 Dec 2023 19:19:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702408760; bh=uqEk75tNt0gCIiuSDm0WdJvZtKoO1NR6Qn5m6gbH2tU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sv4X21Aqaaa/6NVM5siE3Ts0NlVAQSrkbVJ/0ylBNduhTX6+Dba0Vt1QiATLtcOWL oaMQYtwW0TZi9F3BXbqJmoXNItwUQxVbXk0ikBvQDrLNzFIWMLwW8Seer+KzR2ozQx CuAHW5UBoSYKyG+L6H3YQJy4dNGoaNNCzTtH8ZR1eK4ASA99wU9jgNDI7/opQymw5A WUlcMnSIf215SpBE2LAyuyUluuruGGyKB3pFQ5bowm71qutLyVTS3MxtfmJETEGJZU ALZRN2ehEtppvlOhdfhjuuQ9YFOt7GRg4OSRWfHUPvdb77a/Hrc699kRymsDTz9VVW hGUsCMps1pOrg== Date: Tue, 12 Dec 2023 12:19:18 -0700 From: Nathan Chancellor To: Jose Ignacio Tornos Martinez 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 Message-ID: <20231212191918.GA2914380@dev-arch.thelio-3990X> References: <20231108000749.GA3723879@dev-arch.thelio-3990X> <20231212171044.1108464-1-jtornosm@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231212171044.1108464-1-jtornosm@redhat.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 12 Dec 2023 11:19:37 -0800 (PST) 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: > < 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 > Signed-off-by: Jose Ignacio Tornos Martinez 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 > --- > 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 >