* [PATCH] kbuild: Restore .version auto-increment behaviour for Debian/RPM packages
@ 2022-11-13 16:02 Marc Zyngier
2022-11-15 0:09 ` Masahiro Yamada
0 siblings, 1 reply; 4+ messages in thread
From: Marc Zyngier @ 2022-11-13 16:02 UTC (permalink / raw)
To: linux-kbuild, linux-kernel
Cc: Masahiro Yamada, Michal Marek, Nick Desaulniers
Since 2df8220cc511 ("kbuild: build init/built-in.a just once"),
generating Debian packages using 'make bindeb-pkg' results in
packages that are stuck to the same .version, leading to unexpected
behaviours (multiple packages with the same version).
Restore the previous behaviour by calling init/build-version
instead of reading the .version file. This is likely to result
in too many .version bumps, but this is what was happening before
(although the bump was affecting builds made the current one).
Only tested with bindeb-pkg.
Fixes: 2df8220cc511 ("kbuild: build init/built-in.a just once")
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Michal Marek <michal.lkml@markovi.net>
Cc: Nick Desaulniers <ndesaulniers@google.com>
---
scripts/package/mkdebian | 2 +-
scripts/package/mkspec | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index 60a2a63a5e90..e5c983afddab 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -90,7 +90,7 @@ if [ -n "$KDEB_PKGVERSION" ]; then
packageversion=$KDEB_PKGVERSION
revision=${packageversion##*-}
else
- revision=$(cat .version 2>/dev/null||echo 1)
+ revision=$(init/build-version)
packageversion=$version-$revision
fi
sourcename=$KDEB_SOURCENAME
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index 70392fd2fd29..9cbd45f497ba 100755
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -42,7 +42,7 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
Name: kernel
Summary: The Linux Kernel
Version: $__KERNELRELEASE
- Release: $(cat .version 2>/dev/null || echo 1)
+ Release: $(init/build-version)
License: GPL
Group: System Environment/Kernel
Vendor: The Linux Community
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] kbuild: Restore .version auto-increment behaviour for Debian/RPM packages
2022-11-13 16:02 [PATCH] kbuild: Restore .version auto-increment behaviour for Debian/RPM packages Marc Zyngier
@ 2022-11-15 0:09 ` Masahiro Yamada
2022-11-15 3:36 ` Masahiro Yamada
0 siblings, 1 reply; 4+ messages in thread
From: Masahiro Yamada @ 2022-11-15 0:09 UTC (permalink / raw)
To: Marc Zyngier; +Cc: linux-kbuild, linux-kernel, Michal Marek, Nick Desaulniers
On Mon, Nov 14, 2022 at 1:02 AM Marc Zyngier <maz@kernel.org> wrote:
>
> diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
> index 60a2a63a5e90..e5c983afddab 100755
> --- a/scripts/package/mkdebian
> +++ b/scripts/package/mkdebian
> @@ -90,7 +90,7 @@ if [ -n "$KDEB_PKGVERSION" ]; then
> packageversion=$KDEB_PKGVERSION
> revision=${packageversion##*-}
> else
> - revision=$(cat .version 2>/dev/null||echo 1)
> + revision=$(init/build-version)
This does not work for out-of-tree builds
because init/build-version is a check-in source file.
For example, "make O=/tmp/foo bindeb-pkg" fails with:
.../linux/scripts/package/mkdebian: 93: init/build-version: not found
The correct code is:
revision=$($srctree/init/build-version)
> packageversion=$version-$revision
> fi
> sourcename=$KDEB_SOURCENAME
> diff --git a/scripts/package/mkspec b/scripts/package/mkspec
> index 70392fd2fd29..9cbd45f497ba 100755
> --- a/scripts/package/mkspec
> +++ b/scripts/package/mkspec
> @@ -42,7 +42,7 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
> Name: kernel
> Summary: The Linux Kernel
> Version: $__KERNELRELEASE
> - Release: $(cat .version 2>/dev/null || echo 1)
> + Release: $(init/build-version)
Ditto.
Release: $($srctree/init/build-version)
> License: GPL
> Group: System Environment/Kernel
> Vendor: The Linux Community
> --
> 2.34.1
>
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] kbuild: Restore .version auto-increment behaviour for Debian/RPM packages
2022-11-15 0:09 ` Masahiro Yamada
@ 2022-11-15 3:36 ` Masahiro Yamada
2022-11-15 19:17 ` Marc Zyngier
0 siblings, 1 reply; 4+ messages in thread
From: Masahiro Yamada @ 2022-11-15 3:36 UTC (permalink / raw)
To: Marc Zyngier; +Cc: linux-kbuild, linux-kernel, Michal Marek, Nick Desaulniers
On Tue, Nov 15, 2022 at 9:09 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> On Mon, Nov 14, 2022 at 1:02 AM Marc Zyngier <maz@kernel.org> wrote:
> >
> > diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
> > index 60a2a63a5e90..e5c983afddab 100755
> > --- a/scripts/package/mkdebian
> > +++ b/scripts/package/mkdebian
> > @@ -90,7 +90,7 @@ if [ -n "$KDEB_PKGVERSION" ]; then
> > packageversion=$KDEB_PKGVERSION
> > revision=${packageversion##*-}
> > else
> > - revision=$(cat .version 2>/dev/null||echo 1)
> > + revision=$(init/build-version)
>
>
> This does not work for out-of-tree builds
> because init/build-version is a check-in source file.
>
>
>
> For example, "make O=/tmp/foo bindeb-pkg" fails with:
> .../linux/scripts/package/mkdebian: 93: init/build-version: not found
>
>
> The correct code is:
>
>
> revision=$($srctree/init/build-version)
>
>
>
>
> > packageversion=$version-$revision
> > fi
> > sourcename=$KDEB_SOURCENAME
> > diff --git a/scripts/package/mkspec b/scripts/package/mkspec
> > index 70392fd2fd29..9cbd45f497ba 100755
> > --- a/scripts/package/mkspec
> > +++ b/scripts/package/mkspec
> > @@ -42,7 +42,7 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
> > Name: kernel
> > Summary: The Linux Kernel
> > Version: $__KERNELRELEASE
> > - Release: $(cat .version 2>/dev/null || echo 1)
> > + Release: $(init/build-version)
>
>
> Ditto.
>
> Release: $($srctree/init/build-version)
No, mkspec needs no change because binrpm-pkg builds the kernel
_before_ generating the spec file.
If you increment the .version file here again, you would have
the revision mismatch between the package and the actual vmlinuz.
Please send the change for mkdebian only.
>
>
>
>
> > License: GPL
> > Group: System Environment/Kernel
> > Vendor: The Linux Community
> > --
> > 2.34.1
> >
>
>
> --
> Best Regards
> Masahiro Yamada
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] kbuild: Restore .version auto-increment behaviour for Debian/RPM packages
2022-11-15 3:36 ` Masahiro Yamada
@ 2022-11-15 19:17 ` Marc Zyngier
0 siblings, 0 replies; 4+ messages in thread
From: Marc Zyngier @ 2022-11-15 19:17 UTC (permalink / raw)
To: Masahiro Yamada
Cc: linux-kbuild, linux-kernel, Michal Marek, Nick Desaulniers
On Tue, 15 Nov 2022 03:36:05 +0000,
Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> On Tue, Nov 15, 2022 at 9:09 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
> >
> > On Mon, Nov 14, 2022 at 1:02 AM Marc Zyngier <maz@kernel.org> wrote:
> > >
> > > diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
> > > index 60a2a63a5e90..e5c983afddab 100755
> > > --- a/scripts/package/mkdebian
> > > +++ b/scripts/package/mkdebian
> > > @@ -90,7 +90,7 @@ if [ -n "$KDEB_PKGVERSION" ]; then
> > > packageversion=$KDEB_PKGVERSION
> > > revision=${packageversion##*-}
> > > else
> > > - revision=$(cat .version 2>/dev/null||echo 1)
> > > + revision=$(init/build-version)
> >
> >
> > This does not work for out-of-tree builds
> > because init/build-version is a check-in source file.
> >
> >
> >
> > For example, "make O=/tmp/foo bindeb-pkg" fails with:
> > .../linux/scripts/package/mkdebian: 93: init/build-version: not found
> >
> >
> > The correct code is:
> >
> >
> > revision=$($srctree/init/build-version)
> >
> >
> >
> >
> > > packageversion=$version-$revision
> > > fi
> > > sourcename=$KDEB_SOURCENAME
> > > diff --git a/scripts/package/mkspec b/scripts/package/mkspec
> > > index 70392fd2fd29..9cbd45f497ba 100755
> > > --- a/scripts/package/mkspec
> > > +++ b/scripts/package/mkspec
> > > @@ -42,7 +42,7 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
> > > Name: kernel
> > > Summary: The Linux Kernel
> > > Version: $__KERNELRELEASE
> > > - Release: $(cat .version 2>/dev/null || echo 1)
> > > + Release: $(init/build-version)
> >
> >
> > Ditto.
> >
> > Release: $($srctree/init/build-version)
>
>
>
> No, mkspec needs no change because binrpm-pkg builds the kernel
> _before_ generating the spec file.
>
> If you increment the .version file here again, you would have
> the revision mismatch between the package and the actual vmlinuz.
>
>
>
> Please send the change for mkdebian only.
Yup, good point on both count. Patch incoming shortly.
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-11-15 19:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-13 16:02 [PATCH] kbuild: Restore .version auto-increment behaviour for Debian/RPM packages Marc Zyngier
2022-11-15 0:09 ` Masahiro Yamada
2022-11-15 3:36 ` Masahiro Yamada
2022-11-15 19:17 ` Marc Zyngier
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.