[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220922184525.3021522-1-zack@kde.org>
Date: Thu, 22 Sep 2022 14:45:25 -0400
From: Zack Rusin <zack@....org>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: Zack Rusin <zackr@...are.com>,
Michal Marek <michal.lkml@...kovi.net>,
Nick Desaulniers <ndesaulniers@...gle.com>,
linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] kbuild: Add an option to skip vmlinux.bz2 in the rpm's
From: Zack Rusin <zackr@...are.com>
The debug vmlinux takes up the vast majority of space in the built
rpm's. While having it enabled by default is a good idea because it
makes debugging easier, having an option to skip it is highly valuable
for CI/CD systems where small packages are a lot easier to deal with
e.g. kernel rpm built using binrpm-pkg on Fedora 36 default 5.19.8 kernel
config and localmodconfig goes from 255MB to 65MB which is an almost
4x difference.
To skip adding vmlinux.bz2 to the built rpm add SKIP_RPM_VMLINUX
environment variable which when set to "y", e.g. via
"SKIP_RPM_VMLINUX=y make binrpm-pkg" won't include vmlinux.bz2 in the
built rpm.
Signed-off-by: Zack Rusin <zackr@...are.com>
Cc: Masahiro Yamada <masahiroy@...nel.org>
Cc: Michal Marek <michal.lkml@...kovi.net>
Cc: Nick Desaulniers <ndesaulniers@...gle.com>
Cc: linux-kbuild@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
---
scripts/package/mkspec | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index 7c477ca7dc98..5a71fc0852b0 100755
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -23,6 +23,12 @@ else
M=DEL
fi
+if [ "$RPM_SKIP_VMLINUX" = y ]; then
+ D=DEL
+else
+ D=
+fi
+
if grep -q CONFIG_DRM=y .config; then
PROVIDES=kernel-drm
fi
@@ -94,8 +100,8 @@ $M $MAKE %{?_smp_mflags} INSTALL_MOD_PATH=%{buildroot} modules_install
$MAKE %{?_smp_mflags} INSTALL_HDR_PATH=%{buildroot}/usr headers_install
cp System.map %{buildroot}/boot/System.map-$KERNELRELEASE
cp .config %{buildroot}/boot/config-$KERNELRELEASE
- bzip2 -9 --keep vmlinux
- mv vmlinux.bz2 %{buildroot}/boot/vmlinux-$KERNELRELEASE.bz2
+$D bzip2 -9 --keep vmlinux
+$D mv vmlinux.bz2 %{buildroot}/boot/vmlinux-$KERNELRELEASE.bz2
$S$M rm -f %{buildroot}/lib/modules/$KERNELRELEASE/build
$S$M rm -f %{buildroot}/lib/modules/$KERNELRELEASE/source
$S$M mkdir -p %{buildroot}/usr/src/kernels/$KERNELRELEASE
--
2.34.1
Powered by blists - more mailing lists