All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts: package: KDEB_SOURCENAME in .deb names
@ 2017-03-13 22:21 Joe Konno
  2017-03-14  8:49 ` Riku Voipio
  0 siblings, 1 reply; 5+ messages in thread
From: Joe Konno @ 2017-03-13 22:21 UTC (permalink / raw)
  To: linux-kbuild

From: Joe Konno <joe.konno@intel.com>

Currently, the KDEB_SOURCENAME make variable only controls the name of the
packaged source tarball, and does not impact the .deb package names output
by bindeb-pkg and deb-pkg. Presently, these files are more rigidly named,
as the user may only control the names of .deb outputs by setting
KDEB_PKGVERSION in their environment.

This patch modifies the builddeb script to use KDEB_SOURCENAME when naming
the image, firmware-image, headers, and libc-dev .deb output files. This
would allow folks who build-- for instance-- mainline, stable, and next
kernel packages more control over how their .deb outputs are named.

This patch also changes the default value of KDEB_SOURCENAME so as not to
change default .deb output file names. However, this does have the side
effect of renaming the source tarball generated for .deb source packages.

For example:
  $ KDEB_SOURCENAME="linux-mainline" make bindeb-pkg

Would output .deb files that begin with
  ../linux-mainline-{image,firmware-image,headers,libc-dev}

Signed-off-by: Joe Konno <joe.konno@intel.com>
---
 scripts/package/Makefile | 2 +-
 scripts/package/builddeb | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index 71b4a8af9d4d..e4280da03991 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -23,7 +23,7 @@
 
 # Remove hyphens since they have special meaning in RPM filenames
 KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE))
-KDEB_SOURCENAME ?= linux-$(KERNELRELEASE)
+KDEB_SOURCENAME ?= linux
 export KDEB_SOURCENAME
 # Include only those top-level files that are needed by make, plus the GPL copy
 TAR_CONTENT := $(KBUILD_ALLDIRS) .config .scmversion Makefile \
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 3c575cd07888..50caa143fb13 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -96,10 +96,10 @@ fwdir="$objtree/debian/fwtmp"
 kernel_headers_dir="$objtree/debian/hdrtmp"
 libc_headers_dir="$objtree/debian/headertmp"
 dbg_dir="$objtree/debian/dbgtmp"
-packagename=linux-image-$version
-fwpackagename=linux-firmware-image-$version
-kernel_headers_packagename=linux-headers-$version
-libc_headers_packagename=linux-libc-dev
+packagename=${sourcename}-image-$version
+fwpackagename=${sourcename}-firmware-image-$version
+kernel_headers_packagename=${sourcename}-headers-$version
+libc_headers_packagename=${sourcename}-libc-dev
 dbg_packagename=$packagename-dbg
 debarch=
 forcearch=
-- 
2.7.4


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

* Re: [PATCH] scripts: package: KDEB_SOURCENAME in .deb names
  2017-03-13 22:21 [PATCH] scripts: package: KDEB_SOURCENAME in .deb names Joe Konno
@ 2017-03-14  8:49 ` Riku Voipio
  2017-03-14 15:47   ` Joe Konno
  0 siblings, 1 reply; 5+ messages in thread
From: Riku Voipio @ 2017-03-14  8:49 UTC (permalink / raw)
  To: Joe Konno; +Cc: linux-kbuild

On 14 March 2017 at 00:21, Joe Konno <joe.konno@linux.intel.com> wrote:
> From: Joe Konno <joe.konno@intel.com>
>
> Currently, the KDEB_SOURCENAME make variable only controls the name of the
> packaged source tarball, and does not impact the .deb package names output
> by bindeb-pkg and deb-pkg. Presently, these files are more rigidly named,
> as the user may only control the names of .deb outputs by setting
> KDEB_PKGVERSION in their environment.
>
> This patch modifies the builddeb script to use KDEB_SOURCENAME when naming
> the image, firmware-image, headers, and libc-dev .deb output files. This
> would allow folks who build-- for instance-- mainline, stable, and next
> kernel packages more control over how their .deb outputs are named.
>
> This patch also changes the default value of KDEB_SOURCENAME so as not to
> change default .deb output file names. However, this does have the side
> effect of renaming the source tarball generated for .deb source packages.
>
> For example:
>   $ KDEB_SOURCENAME="linux-mainline" make bindeb-pkg
>
> Would output .deb files that begin with
>   ../linux-mainline-{image,firmware-image,headers,libc-dev}

I'm not sure this a really useful. Next, mainline, stable etc are all
different versions of linux, so version seems the correct place to
describe them?

> Signed-off-by: Joe Konno <joe.konno@intel.com>
> ---
>  scripts/package/Makefile | 2 +-
>  scripts/package/builddeb | 8 ++++----
>  2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/scripts/package/Makefile b/scripts/package/Makefile
> index 71b4a8af9d4d..e4280da03991 100644
> --- a/scripts/package/Makefile
> +++ b/scripts/package/Makefile
> @@ -23,7 +23,7 @@
>
>  # Remove hyphens since they have special meaning in RPM filenames
>  KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE))
> -KDEB_SOURCENAME ?= linux-$(KERNELRELEASE)
> +KDEB_SOURCENAME ?= linux
>  export KDEB_SOURCENAME
>  # Include only those top-level files that are needed by make, plus the GPL copy
>  TAR_CONTENT := $(KBUILD_ALLDIRS) .config .scmversion Makefile \
> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index 3c575cd07888..50caa143fb13 100755
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -96,10 +96,10 @@ fwdir="$objtree/debian/fwtmp"
>  kernel_headers_dir="$objtree/debian/hdrtmp"
>  libc_headers_dir="$objtree/debian/headertmp"
>  dbg_dir="$objtree/debian/dbgtmp"
> -packagename=linux-image-$version
> -fwpackagename=linux-firmware-image-$version
> -kernel_headers_packagename=linux-headers-$version
> -libc_headers_packagename=linux-libc-dev
> +packagename=${sourcename}-image-$version
> +fwpackagename=${sourcename}-firmware-image-$version
> +kernel_headers_packagename=${sourcename}-headers-$version
> +libc_headers_packagename=${sourcename}-libc-dev

The style here is to use variables without curly braces unless really needed.

>  dbg_packagename=$packagename-dbg
>  debarch=
>  forcearch=
> --
> 2.7.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] scripts: package: KDEB_SOURCENAME in .deb names
  2017-03-14  8:49 ` Riku Voipio
@ 2017-03-14 15:47   ` Joe Konno
  2017-03-21  8:34     ` Riku Voipio
  0 siblings, 1 reply; 5+ messages in thread
From: Joe Konno @ 2017-03-14 15:47 UTC (permalink / raw)
  To: Riku Voipio; +Cc: linux-kbuild

[-- Attachment #1: Type: text/plain, Size: 4831 bytes --]

On Tue, 14 Mar 2017 10:49:55 +0200
Riku Voipio <riku.voipio@linaro.org> wrote:

> On 14 March 2017 at 00:21, Joe Konno <joe.konno@linux.intel.com>
> wrote:
> > From: Joe Konno <joe.konno@intel.com>
> >
> > Currently, the KDEB_SOURCENAME make variable only controls the name
> > of the packaged source tarball, and does not impact the .deb
> > package names output by bindeb-pkg and deb-pkg. Presently, these
> > files are more rigidly named, as the user may only control the
> > names of .deb outputs by setting KDEB_PKGVERSION in their
> > environment.
> >
> > This patch modifies the builddeb script to use KDEB_SOURCENAME when
> > naming the image, firmware-image, headers, and libc-dev .deb output
> > files. This would allow folks who build-- for instance-- mainline,
> > stable, and next kernel packages more control over how their .deb
> > outputs are named.
> >
> > This patch also changes the default value of KDEB_SOURCENAME so as
> > not to change default .deb output file names. However, this does
> > have the side effect of renaming the source tarball generated
> > for .deb source packages.
> >
> > For example:
> >   $ KDEB_SOURCENAME="linux-mainline" make bindeb-pkg
> >
> > Would output .deb files that begin with
> >   ../linux-mainline-{image,firmware-image,headers,libc-dev}  
> 
> I'm not sure this a really useful. Next, mainline, stable etc are all
> different versions of linux, so version seems the correct place to
> describe them?

Thanks for the feedback. You make a good point.

I took this approach for the following problem as well (which I did
not mention in my initial submission, silly me):

  - Build and package the same kernel commit, but with different kernel
    configurations

If I were building and packaging different kernel commits on the same
tree, I could live without my patch. The bulleted edge case, and my
original commit message's case, do something interesting for target
installations. With some KDEB_PKGVERSION finesse, I could make multiple
versions of 'linux-configA-image' and 'linux-configB-image' available
to the target. At least for my usage, this patch can be useful.

Granted, LOCALVERSION hacking could accomplish the same thing. Maybe
it's the pedant in me, but "4.11.0-rc2$LOCALVERSION" seems ideal for
describing a named package, be it 'linux-image', 'linux-configA-image',
or '$KDEB_SOURCENAME-image'.

> 
> > Signed-off-by: Joe Konno <joe.konno@intel.com>
> > ---
> >  scripts/package/Makefile | 2 +-
> >  scripts/package/builddeb | 8 ++++----
> >  2 files changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/scripts/package/Makefile b/scripts/package/Makefile
> > index 71b4a8af9d4d..e4280da03991 100644
> > --- a/scripts/package/Makefile
> > +++ b/scripts/package/Makefile
> > @@ -23,7 +23,7 @@
> >
> >  # Remove hyphens since they have special meaning in RPM filenames
> >  KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE))
> > -KDEB_SOURCENAME ?= linux-$(KERNELRELEASE)
> > +KDEB_SOURCENAME ?= linux
> >  export KDEB_SOURCENAME
> >  # Include only those top-level files that are needed by make, plus
> > the GPL copy TAR_CONTENT := $(KBUILD_ALLDIRS) .config .scmversion
> > Makefile \ diff --git a/scripts/package/builddeb
> > b/scripts/package/builddeb index 3c575cd07888..50caa143fb13 100755
> > --- a/scripts/package/builddeb
> > +++ b/scripts/package/builddeb
> > @@ -96,10 +96,10 @@ fwdir="$objtree/debian/fwtmp"
> >  kernel_headers_dir="$objtree/debian/hdrtmp"
> >  libc_headers_dir="$objtree/debian/headertmp"
> >  dbg_dir="$objtree/debian/dbgtmp"
> > -packagename=linux-image-$version
> > -fwpackagename=linux-firmware-image-$version
> > -kernel_headers_packagename=linux-headers-$version
> > -libc_headers_packagename=linux-libc-dev
> > +packagename=${sourcename}-image-$version
> > +fwpackagename=${sourcename}-firmware-image-$version
> > +kernel_headers_packagename=${sourcename}-headers-$version
> > +libc_headers_packagename=${sourcename}-libc-dev  
> 
> The style here is to use variables without curly braces unless really
> needed.

I noted the prevailing style initially, but I took the (overly)
cautious route for submission. Thanks for the note-- no more curly
braces when expanding shell variables.

> 
> >  dbg_packagename=$packagename-dbg
> >  debarch=
> >  forcearch=
> > --
> > 2.7.4
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe
> > linux-kbuild" in the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html  
> --
> To unsubscribe from this list: send the line "unsubscribe
> linux-kbuild" in the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] scripts: package: KDEB_SOURCENAME in .deb names
  2017-03-14 15:47   ` Joe Konno
@ 2017-03-21  8:34     ` Riku Voipio
  2017-03-21 17:01       ` Joe Konno
  0 siblings, 1 reply; 5+ messages in thread
From: Riku Voipio @ 2017-03-21  8:34 UTC (permalink / raw)
  To: Joe Konno; +Cc: linux-kbuild

On 14 March 2017 at 17:47, Joe Konno <joe.konno@linux.intel.com> wrote:
> I took this approach for the following problem as well (which I did
> not mention in my initial submission, silly me):
>
>   - Build and package the same kernel commit, but with different kernel
>     configurations

Semi-related - you probably want to use bindeb-pkg (or my proposed fastdeb-pkg)
as with deb-pkg target you will generate many huge source tarballs with
identical content.

> If I were building and packaging different kernel commits on the same
> tree, I could live without my patch. The bulleted edge case, and my
> original commit message's case, do something interesting for target
> installations. With some KDEB_PKGVERSION finesse, I could make multiple
> versions of 'linux-configA-image' and 'linux-configB-image' available
> to the target. At least for my usage, this patch can be useful.

> Granted, LOCALVERSION hacking could accomplish the same thing. Maybe
> it's the pedant in me, but "4.11.0-rc2$LOCALVERSION" seems ideal for
> describing a named package, be it 'linux-image', 'linux-configA-image',
> or '$KDEB_SOURCENAME-image'.

It is idiomatic for Debian to have the configuration also in the version string:

$ apt-cache search ^linux-image
linux-image-4.9.0-2-686-pae-unsigned - Linux 4.9 for modern PCs
linux-image-4.9.0-2-686-unsigned - Linux 4.9 for older PCs
linux-image-4.9.0-2-amd64-unsigned - Linux 4.9 for 64-bit PCs
linux-image-4.9.0-2-rt-686-pae-unsigned - Linux 4.9 for modern PCs,
PREEMPT_RT
linux-image-4.9.0-2-rt-amd64-unsigned - Linux 4.9 for 64-bit PCs, PREEMPT_RT

It is a bit of bikeshedding matter, but your users might be expecting the above
command to tell what kernels are available and "dpkg -l linux-image*" to
tell what kernels are installed.

Also I wouldn't be surprised if various scripts (dkms?) expected the
kernel packages to
start with "linux-image-".

Riku

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

* Re: [PATCH] scripts: package: KDEB_SOURCENAME in .deb names
  2017-03-21  8:34     ` Riku Voipio
@ 2017-03-21 17:01       ` Joe Konno
  0 siblings, 0 replies; 5+ messages in thread
From: Joe Konno @ 2017-03-21 17:01 UTC (permalink / raw)
  To: Riku Voipio; +Cc: linux-kbuild

[-- Attachment #1: Type: text/plain, Size: 2849 bytes --]

On Tue, 21 Mar 2017 10:34:36 +0200
Riku Voipio <riku.voipio@linaro.org> wrote:

> On 14 March 2017 at 17:47, Joe Konno <joe.konno@linux.intel.com>
> wrote:
> > I took this approach for the following problem as well (which I did
> > not mention in my initial submission, silly me):
> >
> >   - Build and package the same kernel commit, but with different
> > kernel configurations  
> 
> Semi-related - you probably want to use bindeb-pkg (or my proposed
> fastdeb-pkg) as with deb-pkg target you will generate many huge
> source tarballs with identical content.
> 
> > If I were building and packaging different kernel commits on the
> > same tree, I could live without my patch. The bulleted edge case,
> > and my original commit message's case, do something interesting for
> > target installations. With some KDEB_PKGVERSION finesse, I could
> > make multiple versions of 'linux-configA-image' and
> > 'linux-configB-image' available to the target. At least for my
> > usage, this patch can be useful.  
> 
> > Granted, LOCALVERSION hacking could accomplish the same thing. Maybe
> > it's the pedant in me, but "4.11.0-rc2$LOCALVERSION" seems ideal for
> > describing a named package, be it 'linux-image',
> > 'linux-configA-image', or '$KDEB_SOURCENAME-image'.  
> 
> It is idiomatic for Debian to have the configuration also in the
> version string:
> 
> $ apt-cache search ^linux-image
> linux-image-4.9.0-2-686-pae-unsigned - Linux 4.9 for modern PCs
> linux-image-4.9.0-2-686-unsigned - Linux 4.9 for older PCs
> linux-image-4.9.0-2-amd64-unsigned - Linux 4.9 for 64-bit PCs
> linux-image-4.9.0-2-rt-686-pae-unsigned - Linux 4.9 for modern PCs,
> PREEMPT_RT
> linux-image-4.9.0-2-rt-amd64-unsigned - Linux 4.9 for 64-bit PCs,
> PREEMPT_RT
> 
> It is a bit of bikeshedding matter, but your users might be expecting
> the above command to tell what kernels are available and "dpkg -l
> linux-image*" to tell what kernels are installed.

Feedback appreciated as always. It's hard to argue for changing
builddeb when it already follows Debian's long-standing kernel
naming/versioning scheme.

I haven't any further arguments for my patch at this point. It seems
I'm up against long-standing Debian packaging norms, so I would need to
start a discussion within that community. So, I'll orphan my patch (and
current approach) here. I'll be sure to share any future
enhancements/fixes here.

Thanks again, Riku, for the review and feedback.

> 
> Also I wouldn't be surprised if various scripts (dkms?) expected the
> kernel packages to
> start with "linux-image-".
> 
> Riku
> --
> To unsubscribe from this list: send the line "unsubscribe
> linux-kbuild" in the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2017-03-21 17:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-13 22:21 [PATCH] scripts: package: KDEB_SOURCENAME in .deb names Joe Konno
2017-03-14  8:49 ` Riku Voipio
2017-03-14 15:47   ` Joe Konno
2017-03-21  8:34     ` Riku Voipio
2017-03-21 17:01       ` Joe Konno

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.