Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp832192rdb; Fri, 2 Feb 2024 05:35:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IGlpQmeL395v92Bhs7aspUSJZ05AwbIn1RLFWXXCAijdAnw6IgGrV7ZX9GN7Au3Qo+bElXj X-Received: by 2002:aa7:d897:0:b0:55f:b0a9:c525 with SMTP id u23-20020aa7d897000000b0055fb0a9c525mr3717962edq.2.1706880938996; Fri, 02 Feb 2024 05:35:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706880938; cv=pass; d=google.com; s=arc-20160816; b=YKLYaIbjhgsZbPmPUjSz7DDvFfVR3T9z1CgX59NbHYKmtLZ9dx59jF1K75HNtTQtJI hz54OLx0TWV4tczvUTBCqiVXT8LaWPwlj2Km7WWFAmd8NOkdJKFhgNWFsdyyXdcSjG+l 0zEEuD3BY/pSOA2L3afW3qXHUWBnhE4hQTwHyNfoOColUrRS7h4M9tw4IQxCLOc4sAHT TZoNaE8NssUYgbFoVYkntlUuRJeH6k2V3AltiDFJrKFv8l/47nWknbZZdb8lGmvpNlhi tzgP9vzaGbRwSNockN6zGcLzH0x6YMHGFVWMjS/ugH7bcyMyvpPl8VTbe/vXU7GqBRLp GU0Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=6Rnx9nu+vhOuZfQSLmGIry1m7ALm/JSk9kPP9WdMsPM=; fh=tbpiZuWqdInIfEmitcyWNvNIgtBpoBICwqUHWVxqKsM=; b=jF2/6yWQNxNQ3pIKPZtrdDsyV5aauMhmPYa//Wg1VKwjIP9bfkFEY8GDW2FBwLRIgt Ge0LaRdJUqU9sUVnHDgWENsKwyjpXO5YqMSCuwZqDREgp5N76o2W35myH26Nbi/Gijf6 xG/dpi3QEaI0/e2hlGlGInkjLG4AVTV4YLhX/rzRq8AqWpwn02YppGY4SKhAp7+dUeik vQcN6B4YD2/zoORsZhLEVTaZHQZT1OxIr0sgFKUWQYagmIWVnmfAvIEGoJQrMENCGM9b hhhC7SQ4FatLYhtZbOQmiAUOPp72L2rLuYfy6UJYMAikMxCTd30m8xn3quMsR5D0V7VW O/1A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PmN7xeAD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-49904-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49904-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCXHSxQccHVc4gMRQoO6RN/fL3WBG0Ec/PO87maAgNJE81VhWbPrdCqBPj9Eq7fUWc6acxrAOaLFrM17lrBzTue9mA0ZWxXNL8dMcwD7VQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id da10-20020a056402176a00b0055919fef846si800397edb.301.2024.02.02.05.35.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 05:35:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49904-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PmN7xeAD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-49904-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49904-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A82951F2B30F for ; Fri, 2 Feb 2024 13:35:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 53CF94776E; Fri, 2 Feb 2024 13:35:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PmN7xeAD" 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 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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) -- 2.40.1