Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4783987rdb; Tue, 12 Dec 2023 09:11:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IFpSaWJu0h7NUEV2j1XL5nD3Cn2ORjSQmrgUOWQibSVBuPtVMgH1oMWxD2vuQyX+KpOXWFe X-Received: by 2002:a17:902:d4c7:b0:1d0:910e:5039 with SMTP id o7-20020a170902d4c700b001d0910e5039mr3072608plg.77.1702401087342; Tue, 12 Dec 2023 09:11:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702401087; cv=none; d=google.com; s=arc-20160816; b=kepDEIBrKoU765f9jycO6+RTww8RTOnEog8cD0ZEF6atYd/MIHqsB+uEjeHGE+yAhB FNlkzaAg+xP+nA6B1qABwb6lIujyUbr7TN/dB0oz8oqdCZH9xJ8nLyJ4uY7Gn1l123x8 Kbj4OKPs/1BDgLADUnkVJrWOxgmbP7nPLJugZ/yaBHPIglospIJtLB9TlPFEsaYpbzRM aJIgrP3dzpqqxKo1SfuZV0U3q5T1f9FHPtn3eGXdETyVvJMlP9pnBw9vg8NtzMxCLUxM 094hExgRXDEHIQqDo3tLx2SFJT2zbLLj5j4So5Dgln0znfRKCkFUDBO8E5WOmAHaBgKs is2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4gv0M0HGbrAnaBTITUU22qWIN+D01416eS5uSG0g/5E=; fh=1NMr61wkEDw0llNPCucowiB15Sw3tySMn4Lsg9PEI6E=; b=jB3UcVCZ67SOmIHztBGDuNxGbs+9A4itO75fnOIk3OfsQh6FJzFM0Z26H35bkVEz4S PN758e3aK8CbY6aLNStdLO7a8jzng6pWxwW3sKKjyGeJWMY1yVOj/+TLKLxqSfEsoJv1 cU9mW7flSOubD+qDuXT1FcdFE27eKdcn8mlXsS1lq4Yy39/tK3HCN8EMME53gb/9DbvC krMIxbLDc36UZiQcoX3mpbRDm87WdkyHc+aJvLA4jl4oSbt+12Dxc9jFJ20acNl+v3OM HtBeg6OwBrQPfbcPwk8gZsNAtf7EDnPREUpL0ifj0adjSQwCZYXC5yU8+T61f3t7Vl7B 5dug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UDM40A97; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id i13-20020a170902c94d00b001c754f13381si8246543pla.455.2023.12.12.09.11.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 09:11:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UDM40A97; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 87D5E807E44D; Tue, 12 Dec 2023 09:11:24 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376570AbjLLRLE (ORCPT + 99 others); Tue, 12 Dec 2023 12:11:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235029AbjLLRKw (ORCPT ); Tue, 12 Dec 2023 12:10:52 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F69C8F for ; Tue, 12 Dec 2023 09:10:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702401058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4gv0M0HGbrAnaBTITUU22qWIN+D01416eS5uSG0g/5E=; b=UDM40A97buHJ5OuN/Lx7uD9qzV5tkWUVAn7+2htMFhTTID6QhC/EXuNFFq2wg0fGB2tDRh /QWSi1O0ei2pK7HrwGh8ekBvSB5WActVbtcoVh72FfVHREDNXfMYnLv4br15i8cotVHESw iO1cH1wLR4rrApQQRn17Tnm8ChVMMW8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-445-sc7vRIH0N7iyizZE1qVcUg-1; Tue, 12 Dec 2023 12:10:55 -0500 X-MC-Unique: sc7vRIH0N7iyizZE1qVcUg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 39174891067; Tue, 12 Dec 2023 17:10:55 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.39.192.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id D393F2166B31; Tue, 12 Dec 2023 17:10:52 +0000 (UTC) From: Jose Ignacio Tornos Martinez To: nathan@kernel.org Cc: dcavalca@meta.com, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, masahiroy@kernel.org, ndesaulniers@google.com, nicolas@fjasle.eu, Jose Ignacio Tornos Martinez , stable@vger.kernel.org Subject: [PATCH v2] rpm-pkg: simplify installkernel %post Date: Tue, 12 Dec 2023 18:10:44 +0100 Message-ID: <20231212171044.1108464-1-jtornosm@redhat.com> In-Reply-To: <20231108000749.GA3723879@dev-arch.thelio-3990X> References: <20231108000749.GA3723879@dev-arch.thelio-3990X> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 fry.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 (fry.vger.email [0.0.0.0]); Tue, 12 Dec 2023 09:11:24 -0800 (PST) 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: <> 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 --- 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