All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kbuild: Add an option to skip vmlinux.bz2 in the rpm's
@ 2022-09-22 18:45 Zack Rusin
  2022-09-23 17:34 ` Nathan Chancellor
  2022-09-26 17:38 ` Masahiro Yamada
  0 siblings, 2 replies; 5+ messages in thread
From: Zack Rusin @ 2022-09-22 18:45 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Zack Rusin, Michal Marek, Nick Desaulniers, linux-kbuild, linux-kernel

From: Zack Rusin <zackr@vmware.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@vmware.com>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Michal Marek <michal.lkml@markovi.net>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] kbuild: Add an option to skip vmlinux.bz2 in the rpm's
  2022-09-22 18:45 [PATCH] kbuild: Add an option to skip vmlinux.bz2 in the rpm's Zack Rusin
@ 2022-09-23 17:34 ` Nathan Chancellor
  2022-09-26 17:38 ` Masahiro Yamada
  1 sibling, 0 replies; 5+ messages in thread
From: Nathan Chancellor @ 2022-09-23 17:34 UTC (permalink / raw)
  To: Zack Rusin
  Cc: Masahiro Yamada, Michal Marek, Nick Desaulniers, linux-kbuild,
	linux-kernel

On Thu, Sep 22, 2022 at 02:45:25PM -0400, Zack Rusin wrote:
> From: Zack Rusin <zackr@vmware.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@vmware.com>
> Cc: Masahiro Yamada <masahiroy@kernel.org>
> Cc: Michal Marek <michal.lkml@markovi.net>
> Cc: Nick Desaulniers <ndesaulniers@google.com>
> Cc: linux-kbuild@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org

Yes please, this seems to slightly improve the time spent actually
building and installing the package.

Tested-by: Nathan Chancellor <nathan@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
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] kbuild: Add an option to skip vmlinux.bz2 in the rpm's
  2022-09-22 18:45 [PATCH] kbuild: Add an option to skip vmlinux.bz2 in the rpm's Zack Rusin
  2022-09-23 17:34 ` Nathan Chancellor
@ 2022-09-26 17:38 ` Masahiro Yamada
  2022-09-28  1:09   ` Zack Rusin
  1 sibling, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2022-09-26 17:38 UTC (permalink / raw)
  To: Zack Rusin
  Cc: Michal Marek, Nick Desaulniers, Linux Kbuild mailing list,
	Linux Kernel Mailing List

On Fri, Sep 23, 2022 at 3:45 AM Zack Rusin <zack@kde.org> wrote:
>
> From: Zack Rusin <zackr@vmware.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@vmware.com>
> Cc: Masahiro Yamada <masahiroy@kernel.org>
> Cc: Michal Marek <michal.lkml@markovi.net>
> Cc: Nick Desaulniers <ndesaulniers@google.com>
> Cc: linux-kbuild@vger.kernel.org
> Cc: linux-kernel@vger.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
>




This came from fc370ecfdb37b853bd8e2118c7ad9f99fa9ac5cd
I do not know how useful or annoying it is.
Presumably, it was a cheesy work, and rather annoying than useful.


In debian (scripts/package/mkdebian), this kind of stuff is
a separate debug package, and only built when CONFIG_DEBUG_INFO=y.


Take more time in case somebody may come up with a better idea.



--
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] kbuild: Add an option to skip vmlinux.bz2 in the rpm's
  2022-09-26 17:38 ` Masahiro Yamada
@ 2022-09-28  1:09   ` Zack Rusin
  2022-09-28  2:05     ` Masahiro Yamada
  0 siblings, 1 reply; 5+ messages in thread
From: Zack Rusin @ 2022-09-28  1:09 UTC (permalink / raw)
  To: masahiroy; +Cc: michal.lkml, ndesaulniers, linux-kbuild, linux-kernel

On Tue, 2022-09-27 at 02:38 +0900, Masahiro Yamada wrote:
> ⚠ External Email
> 
> On Fri, Sep 23, 2022 at 3:45 AM Zack Rusin <zack@kde.org> wrote:
> > 
> > From: Zack Rusin <zackr@vmware.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@vmware.com>
> > Cc: Masahiro Yamada <masahiroy@kernel.org>
> > Cc: Michal Marek <michal.lkml@markovi.net>
> > Cc: Nick Desaulniers <ndesaulniers@google.com>
> > Cc: linux-kbuild@vger.kernel.org
> > Cc: linux-kernel@vger.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
> > 
> 
> 
> 
> 
> This came from fc370ecfdb37b853bd8e2118c7ad9f99fa9ac5cd
> I do not know how useful or annoying it is.
> Presumably, it was a cheesy work, and rather annoying than useful.
> 
> 
> In debian (scripts/package/mkdebian), this kind of stuff is
> a separate debug package, and only built when CONFIG_DEBUG_INFO=y.
> 
> 
> Take more time in case somebody may come up with a better idea.

I'd be happy to rework it in whatever way would be more convenient. Because rpm
builds already depend on environment vars due to RPMOPTS I thought this approach was
fitting but I'm not particularly attached to it. The important thing is the the end
result of not including vmlinux.bz2 in the rpm itself.

I think the other reasonable question to ask is: is anyone still using vmlinux.bz2
from rpms? Because maybe just removing that code completely is the better option
here.

z


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] kbuild: Add an option to skip vmlinux.bz2 in the rpm's
  2022-09-28  1:09   ` Zack Rusin
@ 2022-09-28  2:05     ` Masahiro Yamada
  0 siblings, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2022-09-28  2:05 UTC (permalink / raw)
  To: Zack Rusin; +Cc: michal.lkml, ndesaulniers, linux-kbuild, linux-kernel

On Wed, Sep 28, 2022 at 10:09 AM Zack Rusin <zackr@vmware.com> wrote:
>
> On Tue, 2022-09-27 at 02:38 +0900, Masahiro Yamada wrote:
> > ⚠ External Email
> >
> > On Fri, Sep 23, 2022 at 3:45 AM Zack Rusin <zack@kde.org> wrote:
> > >
> > > From: Zack Rusin <zackr@vmware.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@vmware.com>
> > > Cc: Masahiro Yamada <masahiroy@kernel.org>
> > > Cc: Michal Marek <michal.lkml@markovi.net>
> > > Cc: Nick Desaulniers <ndesaulniers@google.com>
> > > Cc: linux-kbuild@vger.kernel.org
> > > Cc: linux-kernel@vger.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
> > >
> >
> >
> >
> >
> > This came from fc370ecfdb37b853bd8e2118c7ad9f99fa9ac5cd
> > I do not know how useful or annoying it is.
> > Presumably, it was a cheesy work, and rather annoying than useful.
> >
> >
> > In debian (scripts/package/mkdebian), this kind of stuff is
> > a separate debug package, and only built when CONFIG_DEBUG_INFO=y.
> >
> >
> > Take more time in case somebody may come up with a better idea.
>
> I'd be happy to rework it in whatever way would be more convenient. Because rpm
> builds already depend on environment vars due to RPMOPTS I thought this approach was
> fitting but I'm not particularly attached to it. The important thing is the the end
> result of not including vmlinux.bz2 in the rpm itself.
>
> I think the other reasonable question to ask is: is anyone still using vmlinux.bz2
> from rpms? Because maybe just removing that code completely is the better option
> here.


Yes, I like it.




-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-09-28  2:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-22 18:45 [PATCH] kbuild: Add an option to skip vmlinux.bz2 in the rpm's Zack Rusin
2022-09-23 17:34 ` Nathan Chancellor
2022-09-26 17:38 ` Masahiro Yamada
2022-09-28  1:09   ` Zack Rusin
2022-09-28  2:05     ` Masahiro Yamada

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.