Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2757345rdb; Mon, 5 Feb 2024 17:35:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IEZCjc8SjN5I33Njk/zA3ccEWIOwxND1G3/yCNtxNRPoh6LoVBu+uHiKOAJYoXUJVHdzrtY X-Received: by 2002:a05:620a:460c:b0:785:8f91:d417 with SMTP id br12-20020a05620a460c00b007858f91d417mr458896qkb.27.1707183318354; Mon, 05 Feb 2024 17:35:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707183318; cv=pass; d=google.com; s=arc-20160816; b=l/kwQMfXbssUFe7gwGjuRQC5tFqMgFV0kDrjx9P+gHeHIIAt2UCUMp3D5Pc0tyeQCj +fP51Htq+un5R/ykPWeKYKes35dMYRKyvWA7H4L+cdVa/Dm3jq6zpHuIgD8dO5QrglrE 16PrYwGFH22YvYDPnw/c5vK5KeEU0I1qhd5lccaHrJ3KlY3ieOr3ffD/BLcwUHkzgesi 9bYjk4dcAWxuVrQKBvCXiKXaXGMbkGjlQ2zvHVXQnpnY+/zJqQqHqQDbR55bk51We47w ZdnCCRE7ohkQe+AX0Z+RMjxt9Ye0JkT4jU0QN838RusF5WXxw5p9Qn4pTT2jxGyhkP3j tJbw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=6Nj/Xp2l2v89kUbynWFqmgd9+92nxRs+4fKuz6bB+2o=; fh=40adA/FGM46eMm58l8ds2dZRzcqc0n9hgi2PAK3nmjs=; b=1FuGKpUAY7VDwElvJ6q5hO5w+40h72XWbZWiYha8VK3Va8lW8nefAtEi+jYeR9P74R NS3vyFFn33K69rSMBZm/Al/KzIhaezaHTLLw9vRy35MYylZKRkNbYLU4q+IvmXswX+xD tCaevSUOh3IgcFmZ0UVhDVzklezgsScfxwXUfLrIs5hlbzWCXPLz3NKdcZhlOGnryWwy KX37Rwg2x+Hcq6IbZUobsUzOk7EgOgq49eAy0nrdf7U5TsHdxLJcZbfSg2C5qBnvUDAu 4LqLchep6Oy+C7n0mqMymQD0PX1159v1lPKCjJD4jX9dMhZGzIr9ydTVW5pPnYv+Cmqx MeMw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FtM5IkFT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-54156-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54156-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; AJvYcCUK/PPaHyU9Hf7w5mKpH+aB0tALuH28irn9Ylyz1K+zTwiIwN36QXZwNbtJdLedhhMvgR+QFjPP+gEEI3uYOnXCkUPybHyWtQCSsVIwFw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id x3-20020a05622a000300b0042c0ebb0fbesi1275303qtw.377.2024.02.05.17.35.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 17:35:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-54156-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FtM5IkFT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-54156-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54156-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 153B81C22E79 for ; Tue, 6 Feb 2024 01:35:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 50DC7137E; Tue, 6 Feb 2024 01:35:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FtM5IkFT" 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 75D4CED9; Tue, 6 Feb 2024 01:35:10 +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=1707183311; cv=none; b=BZK7SSEj3mL0zVlAZIpiLVBuRsNLw2+BtXk0GPD3KmqKD4LcLZgZYJL6MHqf92+rI9mThXIST2RJWNheazXxaqiciZhOObkY9xFIvriM8LP68qCVlbeyfLmBgYHYiy8QjmVEcDecuImjw7IJ4wkpdPqC1Mm+fG7DgLYU8fs3P6M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707183311; c=relaxed/simple; bh=nxiuL3ikLLQlErz9ldxF1gm9uIpqXguVlOjsCUXQYjk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QAGgUIeqvC0EnXyhIKKXWM9jUwQ7gksK2ze7ENkgu6i7vjqLMEARHlSttvjLnHLQ7SoT0/uaWTbiVb9BO7x9OjQmI9G9pZ2pyD5qgsupibdrdzSvH1okYv/Hd8Imi4k+xrYdNnREn312/OV86CspGQCCzZQTXZOD0K6l9CPQfL0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FtM5IkFT; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D705C433F1; Tue, 6 Feb 2024 01:35:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707183310; bh=nxiuL3ikLLQlErz9ldxF1gm9uIpqXguVlOjsCUXQYjk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FtM5IkFTnjk5ZpDHC788Rxt38lwYYMfr/VRkFbM3m/CepnPLZmp9tzM+HBbk5jBSa RZtCHE52oMUBQ13Kog7H2s7k1noO3CulClCMA+lQlvHu5j6zp2PvlDLBdSad2usOaV QC/+zlUYn2AqL6RHJIa3zlO6oNjbreiKjUl1Hc1nIIx2rw7evrcxOFzACaBqo9AYuR mSw5x2NeJKuFST0GKLRpMMcziAMOqsr9ZgCOjQor6N9sD8jIHFaEobfBuAK5YKl2lc qKyJl8z/cz0/aYUVFgeZAqQtNgJg5WcJvLBQfCZfEVIYwTdYWPmLwSowg53DGAivu9 LD80M3+6rzq2g== Date: Mon, 5 Feb 2024 18:35:08 -0700 From: Nathan Chancellor To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, Nicolas Schier , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/4] kbuild: rpm-pkg: do not include depmod-generated files Message-ID: <20240206013508.GA3151678@dev-arch.thelio-3990X> References: <20240202133520.302738-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240202133520.302738-1-masahiroy@kernel.org> On Fri, Feb 02, 2024 at 10:35:17PM +0900, Masahiro Yamada wrote: > 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) > -- > 2.40.1 >