From patchwork Fri Feb 2 13:35:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13542904 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 74F924655F; Fri, 2 Feb 2024 13:35:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706880927; cv=none; b=u9j2wXOdveH6hkU8um7zbewkXwNxLNIXHXY+WmN06mlCooLCGCePI13jyj/HtSn8sIUh6I421Hp1+qrEgJFKmJlUSu8uyNCqAL0zCpT9pn9u58Ybj8lgLUdtlRWYhDExQ1iHNsj08R7f9z68VVXNdiJH8yNS6qMgfoinpweApLk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706880927; c=relaxed/simple; bh=RKMOk0rYR3IGINlpmA2Z8cdwjH0dlA8ns+BK0/KqDhQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Qkb/qemZcN2jPAYHgKsmGGNtRyXJQ+LH5lcv4ro+0DskQEx1WyNKlfs/xue0IlldpvW+lBEqo10AY/2K4Ky+jls+nIHeHiTzUuEpV+0Nqwnx7+TfpP/8cBfyLtigNQ/vU+0eF9RhNHiEkoMUvHagh+pW4Zt6Q3HQUohZiEOty44= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PmN7xeAD; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PmN7xeAD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 151F8C433C7; Fri, 2 Feb 2024 13:35:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706880927; bh=RKMOk0rYR3IGINlpmA2Z8cdwjH0dlA8ns+BK0/KqDhQ=; h=From:To:Cc:Subject:Date:From; b=PmN7xeADdgyThbN7l4XKfqTgeB5HRIhIwfK6MGIj/wMB2Gzx8p4vd6jPX50FtHTjk 3gXfTRHzFrUEGlX61XMOKZRHol/iKQX9KIz6LL+8UQ9Ixv88/iCOqln2zDa8ijfjQR saGUs8jNuaA03bFRDUuw/NuuLSm3J/kzXg2fFEyR65SuPeSPRUZEQi1NdY3fw+Q+ce 1cscWfbqheiBklAi2zFpfruIrYoY+LApEe0rmKwEnfmz3WdnseHZrbRmroWvz+f7k4 Sa0hKmese3nNXWu3+r28Oz6AzCLtKO1Z6D82itcIO3yC/HG8BrE4EK+I2WlanjNXVf TlKnuFhDLChww== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Nathan Chancellor , Nicolas Schier , linux-kernel@vger.kernel.org Subject: [PATCH 1/4] kbuild: rpm-pkg: do not include depmod-generated files Date: Fri, 2 Feb 2024 22:35:17 +0900 Message-Id: <20240202133520.302738-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Installing the kernel package is fine, but when uninstalling it, the following warnings are shown: warning: file modules.symbols.bin: remove failed: No such file or directory warning: file modules.symbols: remove failed: No such file or directory warning: file modules.softdep: remove failed: No such file or directory warning: file modules.devname: remove failed: No such file or directory warning: file modules.dep.bin: remove failed: No such file or directory warning: file modules.dep: remove failed: No such file or directory warning: file modules.builtin.bin: remove failed: No such file or directory warning: file modules.builtin.alias.bin: remove failed: No such file or directory warning: file modules.alias.bin: remove failed: No such file or directory warning: file modules.alias: remove failed: No such file or directory The %preun scriptlet runs 'kernel-install remove', which in turn invokes /usr/lib/kernel/install.d/50-depmod.install to remove those files before the actual package removal. RPM-based distributions do not ship files generated by depmod. Mark them as %ghost in order to exclude them from the package, but still claim the ownership on them. Signed-off-by: Masahiro Yamada Tested-by: Nathan Chancellor --- scripts/package/kernel.spec | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/scripts/package/kernel.spec b/scripts/package/kernel.spec index f58726671fb3..aaedb6d1b26f 100644 --- a/scripts/package/kernel.spec +++ b/scripts/package/kernel.spec @@ -66,6 +66,20 @@ ln -fns /usr/src/kernels/%{KERNELRELEASE} %{buildroot}/lib/modules/%{KERNELRELEA %{make} %{makeflags} run-command KBUILD_RUN_COMMAND='${srctree}/scripts/package/install-extmod-build %{buildroot}/usr/src/kernels/%{KERNELRELEASE}' %endif +{ + for x in System.map config kernel modules.builtin \ + modules.builtin.modinfo modules.order vmlinuz; do + echo "/lib/modules/%{KERNELRELEASE}/${x}" + done + + for x in alias alias.bin builtin.alias.bin builtin.bin dep dep.bin \ + devname softdep symbols symbols.bin; do + echo "%ghost /lib/modules/%{KERNELRELEASE}/modules.${x}" + done + + echo "%exclude /lib/modules/%{KERNELRELEASE}/build" +} > %{buildroot}/kernel.list + %clean rm -rf %{buildroot} @@ -78,6 +92,9 @@ for file in vmlinuz System.map config; do cp "/lib/modules/%{KERNELRELEASE}/${file}" "/boot/${file}-%{KERNELRELEASE}" fi done +if [ ! -e "/lib/modules/%{KERNELRELEASE}/modules.dep" ]; then + /usr/sbin/depmod %{KERNELRELEASE} +fi %preun if [ -x /sbin/new-kernel-pkg ]; then @@ -91,10 +108,9 @@ if [ -x /sbin/update-bootloader ]; then /sbin/update-bootloader --remove %{KERNELRELEASE} fi -%files +%files -f %{buildroot}/kernel.list %defattr (-, root, root) -/lib/modules/%{KERNELRELEASE} -%exclude /lib/modules/%{KERNELRELEASE}/build +%exclude /kernel.list %files headers %defattr (-, root, root) From patchwork Fri Feb 2 13:35:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13542905 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B14041E4A6; Fri, 2 Feb 2024 13:35:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706880928; cv=none; b=kKZK8CLf62vMMo4nF0fiq9HYi/6hulrZHdl6xtLyuvROjRajgttFQ4X4AY0DknzkqLwEBLO4QvXGUKoqxMUEB0BuiEiWIUOjdfjuc8Jy5Feoj+nX4emjajY0C0JDN6oVNwdlVvIEWIqu7Mw6Id1EmNgvLUf/q/FKAjH+kJadGIc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706880928; c=relaxed/simple; bh=7eFQengerwA9drGKbBSRiI3jh5gQkIy0/WN8yF4kW5A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=bDAirjA0h5S9Ll4XyPNoCSJDuyEEVxqTzXuoqM1D6AiG79/k0gqgI6m6otbzpbFhlVgduMxDWPSIfrDp217gHDaBY9uwIQDifTCCWf1MXeLCUFCwLoVLMZwNDtlotYx5VYcBRcRp0IDk+zRYOfsFb7YpuYzrNd8mGnMvsstUxKg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XRLSM7mY; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XRLSM7mY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A3B1C43394; Fri, 2 Feb 2024 13:35:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706880928; bh=7eFQengerwA9drGKbBSRiI3jh5gQkIy0/WN8yF4kW5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XRLSM7mYYOf+1dV6jtbbEtoEV813bFXK7NmK4Mcvj9CpQvCjMKLfsC/R1Oo34SkkV MYnB/WaBRQATuooUF1RokGWwLbY9pRS3KDISENNZVwRG+F9KhDFxUgs3vwa0rMuB+9 bktrA1tFVleEDBF/6DXVqeUmgyUmbIWiffmPAovpczR2XKwc+H+F/ZjlCa4usM0Omk BpYhAH41HlbJsxrujtWts2EJ+5xAcTUetVAyvlR0d1lVq6Sf1qR+0pu3aZ/uuzKgWi ImHgaXjS2tt6uqlUSBwTJHXdNRh2TXNr0b/yBtXz6vToO41rr3hie4TedwZ1XCQhfB MCUCyBzHXcjiQ== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Nathan Chancellor , Nicolas Schier , linux-kernel@vger.kernel.org Subject: [PATCH 2/4] kbuild: rpm-pkg: mark installed files in /boot as %ghost Date: Fri, 2 Feb 2024 22:35:18 +0900 Message-Id: <20240202133520.302738-2-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240202133520.302738-1-masahiroy@kernel.org> References: <20240202133520.302738-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Mark the files installed to /boot as %ghost to make sure they will be removed when the package is uninstalled. Signed-off-by: Masahiro Yamada Tested-by: Nathan Chancellor --- scripts/package/kernel.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/package/kernel.spec b/scripts/package/kernel.spec index aaedb6d1b26f..ecedcfc11e73 100644 --- a/scripts/package/kernel.spec +++ b/scripts/package/kernel.spec @@ -77,6 +77,10 @@ ln -fns /usr/src/kernels/%{KERNELRELEASE} %{buildroot}/lib/modules/%{KERNELRELEA echo "%ghost /lib/modules/%{KERNELRELEASE}/modules.${x}" done + for x in System.map config vmlinuz; do + echo "%ghost /boot/${x}-%{KERNELRELEASE}" + done + echo "%exclude /lib/modules/%{KERNELRELEASE}/build" } > %{buildroot}/kernel.list From patchwork Fri Feb 2 13:35:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13542906 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6676B60249; Fri, 2 Feb 2024 13:35:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706880930; cv=none; b=DViYL3lo/niD85UY3OOaeh5gaS+4EGqUaaKgMCyep9gvWU4my49mEGHTzJfsdYjeUg1awprt1d7kurLhS2EBCjNkMDN/Vrd0e9lzfWpL5mhTorSPW6BXu0d9IUnixx3jatdiw8ucSEoGkgFtAGnQjdHPoZvi8OPVvp5pp8pW9SU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706880930; c=relaxed/simple; bh=K6THucq1Y36mjX1mtaVBB8G3stK33EV44ZYVaZxE6qM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=a5sbbmopCZA1ydvN7iS+WJs27edghEB8V9VPfHJ6gm/0O+btwGXLns/3giuPiI3gN6kkeAeiNZqs1E3pN/wJirL7KsIfuMYu/VqcFNjFNRDVCT0xpripcDaZ+HRm8+18L2uioLZ5F5x/4LmvxyfQR+qvhduqFqJ69emH0ZW4Vog= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VTRodOTz; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VTRodOTz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F1525C43394; Fri, 2 Feb 2024 13:35:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706880929; bh=K6THucq1Y36mjX1mtaVBB8G3stK33EV44ZYVaZxE6qM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VTRodOTz25bBMg9dt1yMLRJ3+YxQ+CO5lRLU9KR+IXHRBEaqEVqK5H2LrBtzcKJTY IGXcZzof9ZstcCQUBorzavfa8x8coAOwES6EkkZ6JrIBHmUEwH8pa/3ztbj9lZ1lPq /BiXHn7gFbuMsG0R/1TTI7Am+58h8RYbgLCXSCoG49rEfryZhY7N7VpiNERlTjplB0 Rx8q6DOdmiWeuvgb3Oa3Qbk+8r5LDNxEUv9MQPxP+/OMwg+kXk6X1zF2+QRQ5Ccn6Z yvdmPOK7cH0a4Ptz6/rbYE1z0kdet4ukcmkGoz/uy00av3vFr4Fjwf3wZUTNUINzKr qlTKPUmZTtmiw== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Nathan Chancellor , Nicolas Schier , linux-kernel@vger.kernel.org Subject: [PATCH 3/4] Revert "kbuild/mkspec: support 'update-bootloader'-based systems" Date: Fri, 2 Feb 2024 22:35:19 +0900 Message-Id: <20240202133520.302738-3-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240202133520.302738-1-masahiroy@kernel.org> References: <20240202133520.302738-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This reverts commit 27c3bffd230abd0a598586aed0fe0ba7b61e0e2e. If this is still needed, we can bring it back. However, I'd like to understand why 'update-bootloader --remove' is needed for uninstallation, while 'update-bootloader --add' was not called during the installation. Signed-off-by: Masahiro Yamada --- scripts/package/kernel.spec | 5 ----- 1 file changed, 5 deletions(-) diff --git a/scripts/package/kernel.spec b/scripts/package/kernel.spec index ecedcfc11e73..c1b745967f64 100644 --- a/scripts/package/kernel.spec +++ b/scripts/package/kernel.spec @@ -107,11 +107,6 @@ elif [ -x /usr/bin/kernel-install ]; then kernel-install remove %{KERNELRELEASE} fi -%postun -if [ -x /sbin/update-bootloader ]; then -/sbin/update-bootloader --remove %{KERNELRELEASE} -fi - %files -f %{buildroot}/kernel.list %defattr (-, root, root) %exclude /kernel.list From patchwork Fri Feb 2 13:35:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13542907 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C35601419B0; Fri, 2 Feb 2024 13:35:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706880931; cv=none; b=Asuj2kGush6IkkAaYbLGTtSdhTPDhlFy6r552wodT8zsIkykBDiygeu7HLDHfL6UTOQQeSYmXnEWgb0DOiyV2Auem64shf9xzaR8NqjUJYRhcb4yWK3p2GDP69bbvT766f/tluvGGdY5w7xqMjLvY+5eDwEdaGIuddQiqUKktfU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706880931; c=relaxed/simple; bh=kEo4j6RbGBwDkaFpN5XVSmcWPQCgDr626mH0ogy5qbs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=VTxc0neANVfYn87TPZOb34IvFKNs8JSJudYpwXjAd2x2QEdBkZMnVdN0svFtzn+n0ew84FHqYAkGjuk+J9S6icqFFwydLgfdsIwDjvQbLy7xrKZhiUY7nQBi4lX3hnkqQScb3Rh/X6+yRNLNanhrORh8d9R4WieugoIDwF+CjBE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=o9wTjFPF; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="o9wTjFPF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5833DC43390; Fri, 2 Feb 2024 13:35:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706880931; bh=kEo4j6RbGBwDkaFpN5XVSmcWPQCgDr626mH0ogy5qbs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o9wTjFPFPUJZK+qU5vDxPrIjjaDRM1wdNAawh31g3gXI9yurFsRiN/HBPEGxELIvY 9jikLJsYmkoG5bwzv5TCpYgwc6Kz9K+MpaedtrlvHjO2cQrp9s2MkrXTJ6saCjGUMR EPXBmw6r6sTPzoY6ebxDZcnYdA46KIkVUUKiURoxQDvj36fiCQs0J6E72Xe0cdS7H7 SKodssaWEDeF9AbuLWHiC0COSXjep14e+0e7MVh2Em7QWxmWBaf82sl3LAE3Lrya2j 9HQ1S7hJNLZuuSi+Sz6SAzv58SSRztDl8mmcSomkIeS1PBHOKLUxhVlEVJ/7jCKNRb Wq9+aaWA6wPag== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Nathan Chancellor , Nicolas Schier , linux-kernel@vger.kernel.org Subject: [PATCH 4/4] Revert "kbuild/mkspec: clean boot loader configuration on rpm removal" Date: Fri, 2 Feb 2024 22:35:20 +0900 Message-Id: <20240202133520.302738-4-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240202133520.302738-1-masahiroy@kernel.org> References: <20240202133520.302738-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This reverts commit 6ef41e22a320d95a246d45b673aa7247cc1bbf7b. If this is still needed, we can bring it back. However, I'd like to understand why 'new-kernel-pkg --remove' is needed for uninstallation, while 'new-kernel-pkg --install' was not called during the installation. Signed-off-by: Masahiro Yamada --- scripts/package/kernel.spec | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/package/kernel.spec b/scripts/package/kernel.spec index c1b745967f64..c256b73cca3e 100644 --- a/scripts/package/kernel.spec +++ b/scripts/package/kernel.spec @@ -101,9 +101,7 @@ if [ ! -e "/lib/modules/%{KERNELRELEASE}/modules.dep" ]; then fi %preun -if [ -x /sbin/new-kernel-pkg ]; then -new-kernel-pkg --remove %{KERNELRELEASE} --rminitrd --initrdfile=/boot/initramfs-%{KERNELRELEASE}.img -elif [ -x /usr/bin/kernel-install ]; then +if [ -x /usr/bin/kernel-install ]; then kernel-install remove %{KERNELRELEASE} fi