[2/4] kbuild: rpm-pkg: mark installed files in /boot as %ghost

Message ID 20240202133520.302738-2-masahiroy@kernel.org
State New
Headers
Series [1/4] kbuild: rpm-pkg: do not include depmod-generated files |

Commit Message

Masahiro Yamada Feb. 2, 2024, 1:35 p.m. UTC
  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 <masahiroy@kernel.org>
---

 scripts/package/kernel.spec | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Nathan Chancellor Feb. 6, 2024, 1:35 a.m. UTC | #1
On Fri, Feb 02, 2024 at 10:35:18PM +0900, Masahiro Yamada wrote:
> 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 <masahiroy@kernel.org>

Tested-by: Nathan Chancellor <nathan@kernel.org>

> ---
> 
>  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
>  
> -- 
> 2.40.1
>
  

Patch

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