All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kbuild: add workaround for Debian make-kpkg
@ 2019-03-06 16:00 Masahiro Yamada
  2019-03-06 20:59 ` Ben Hutchings
  2019-03-06 21:01 ` Ben Hutchings
  0 siblings, 2 replies; 8+ messages in thread
From: Masahiro Yamada @ 2019-03-06 16:00 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Liz Zhang, Lili Deng, Ben Hutchings, Riku Voipio,
	Masahiro Yamada, Michal Marek, linux-kernel

Since commit 3812b8c5c5d5 ("kbuild: make -r/-R effective in top
Makefile for old Make versions"), make-kpkg is not working.

make-kpkg directly includes the top Makefile of Linux kernel, and
appends some debian_* targets.

  /usr/share/kernel-package/ruleset/kernel_version.mk:

    # Include the kernel makefile
    override dot-config := 1
    include Makefile
    dot-config := 1

I did not know the kernel Makefile was used in that way, and it is
hard to guarantee the behavior when the kernel Makefile is included
by another Makefile from a different project.

Looks like Debian Stretch stopped providing make-kpkg (except PowerPC).
Maybe it is obsolete and being replaced with 'make deb-pkg' etc.
but still widely used.

This commit adds a workaround; if the top Makefile is included by
another Makefile, skip sub-make in order to make the main part visible.
'MAKEFLAGS += -rR' does not become effective for GNU Make < 4.0, but
Debian/Ubuntu is already using newer versions.

The effect of this commit:

  Debian 8 (Jessie)  : Fixed
  Debian 9 (Stretch) : make-kpkg (kernel-package) is not provided
  Ubuntu 14.04 LTS   : NOT Fixed
  Ubuntu 16.04 LTS   : Fixed
  Ubuntu 18.04 LTS   : Fixed

This commit cannot fix Ubuntu 14.04 because it installs GNU Make 3.81,
but its support will end in Apr 2019, which is before the Linux v5.1
release.

I added warning so that nobody would try to include the top Makefile.

Fixes: 3812b8c5c5d5 ("kbuild: make -r/-R effective in top Makefile for old Make versions")
Reported-by: Liz Zhang <lizzha@microsoft.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Lili Deng <v-lide@microsoft.com>
---

 Makefile | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/Makefile b/Makefile
index ef4b32c..925d870 100644
--- a/Makefile
+++ b/Makefile
@@ -31,6 +31,16 @@ _all:
 # descending is started. They are now explicitly listed as the
 # prepare rule.
 
+# Ugly workaround for Debian make-kpkg:
+# make-kpkg directly includes the top Makefile of Linux kernel. In such a case,
+# skip sub-make to support debian_* targets in ruleset/kernel_version.mk, but
+# displays warning to discourage such abusage.
+ifneq ($(word 2, $(MAKEFILE_LIST)),)
+$(warning Do not include top Makefile of Linux Kernel)
+sub-make-done := 1
+MAKEFLAGS += -rR
+endif
+
 ifneq ($(sub-make-done),1)
 
 # Do not use make's built-in rules and variables
-- 
2.7.4


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

* Re: [PATCH] kbuild: add workaround for Debian make-kpkg
  2019-03-06 16:00 [PATCH] kbuild: add workaround for Debian make-kpkg Masahiro Yamada
@ 2019-03-06 20:59 ` Ben Hutchings
  2019-03-06 21:01 ` Ben Hutchings
  1 sibling, 0 replies; 8+ messages in thread
From: Ben Hutchings @ 2019-03-06 20:59 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild
  Cc: Liz Zhang, Lili Deng, Riku Voipio, Michal Marek, linux-kernel,
	Manoj Srivastava

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

kernel-package is maintained by Manoj Srivastava (cc'd), not by the
Debian kernel team.

On Thu, 2019-03-07 at 01:00 +0900, Masahiro Yamada wrote:
> Since commit 3812b8c5c5d5 ("kbuild: make -r/-R effective in top
> Makefile for old Make versions"), make-kpkg is not working.
> 
> make-kpkg directly includes the top Makefile of Linux kernel, and
> appends some debian_* targets.
> 
>   /usr/share/kernel-package/ruleset/kernel_version.mk:
> 
>     # Include the kernel makefile
>     override dot-config := 1
>     include Makefile
>     dot-config := 1
> 
> I did not know the kernel Makefile was used in that way, and it is
> hard to guarantee the behavior when the kernel Makefile is included
> by another Makefile from a different project.
> 
> Looks like Debian Stretch stopped providing make-kpkg (except PowerPC).

kernel-package is not included in stretch at all.  I'm not sure where
you're seeing it as being present on powerpc - that architecture wasn't
included in the stretch release.

> Maybe it is obsolete and being replaced with 'make deb-pkg' etc.
> but still widely used.
[...]

kernel-package is currently planned to be included in the next release,
though I'm not sure whether it should be.

There is another bug report about kernel-package with current kernel
versions <https://bugs.debian.org/890817> but I don't know whether it
has been worked around already.

Ben.

-- 
Ben Hutchings
friends: People who know you well, but like you anyway.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] kbuild: add workaround for Debian make-kpkg
  2019-03-06 16:00 [PATCH] kbuild: add workaround for Debian make-kpkg Masahiro Yamada
  2019-03-06 20:59 ` Ben Hutchings
@ 2019-03-06 21:01 ` Ben Hutchings
  2019-03-07  4:03   ` Masahiro Yamada
  1 sibling, 1 reply; 8+ messages in thread
From: Ben Hutchings @ 2019-03-06 21:01 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild
  Cc: Liz Zhang, Lili Deng, Riku Voipio, Michal Marek, linux-kernel,
	Manoj Srivastava

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

[Trying again with an alternate address for Manoj.]

kernel-package is maintained by Manoj Srivastava (cc'd), not by the
Debian kernel team.

On Thu, 2019-03-07 at 01:00 +0900, Masahiro Yamada wrote:
> Since commit 3812b8c5c5d5 ("kbuild: make -r/-R effective in top
> Makefile for old Make versions"), make-kpkg is not working.
> 
> make-kpkg directly includes the top Makefile of Linux kernel, and
> appends some debian_* targets.
> 
>   /usr/share/kernel-package/ruleset/kernel_version.mk:
> 
>     # Include the kernel makefile
>     override dot-config := 1
>     include Makefile
>     dot-config := 1
> 
> I did not know the kernel Makefile was used in that way, and it is
> hard to guarantee the behavior when the kernel Makefile is included
> by another Makefile from a different project.
> 
> Looks like Debian Stretch stopped providing make-kpkg (except
> PowerPC).

kernel-package is not included in stretch at all.  I'm not sure where
you're seeing it as being present on powerpc - that architecture wasn't
included in the stretch release.

> Maybe it is obsolete and being replaced with 'make deb-pkg' etc.
> but still widely used.
[...]

kernel-package is currently planned to be included in the next release,
though I'm not sure whether it should be.

There is another bug report about kernel-package with current kernel
versions <https://bugs.debian.org/890817> but I don't know whether it
has been worked around already.

Ben.

-- 
Ben Hutchings
friends: People who know you well, but like you anyway.



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] kbuild: add workaround for Debian make-kpkg
  2019-03-06 21:01 ` Ben Hutchings
@ 2019-03-07  4:03   ` Masahiro Yamada
  2019-03-07  6:36     ` Ben Hutchings
  0 siblings, 1 reply; 8+ messages in thread
From: Masahiro Yamada @ 2019-03-07  4:03 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: Linux Kbuild mailing list, Liz Zhang, Lili Deng, Riku Voipio,
	Michal Marek, Linux Kernel Mailing List, Manoj Srivastava

On Thu, Mar 7, 2019 at 6:02 AM Ben Hutchings <ben@decadent.org.uk> wrote:
>
> [Trying again with an alternate address for Manoj.]
>
> kernel-package is maintained by Manoj Srivastava (cc'd), not by the
> Debian kernel team.
>
> On Thu, 2019-03-07 at 01:00 +0900, Masahiro Yamada wrote:
> > Since commit 3812b8c5c5d5 ("kbuild: make -r/-R effective in top
> > Makefile for old Make versions"), make-kpkg is not working.
> >
> > make-kpkg directly includes the top Makefile of Linux kernel, and
> > appends some debian_* targets.
> >
> >   /usr/share/kernel-package/ruleset/kernel_version.mk:
> >
> >     # Include the kernel makefile
> >     override dot-config := 1
> >     include Makefile
> >     dot-config := 1
> >
> > I did not know the kernel Makefile was used in that way, and it is
> > hard to guarantee the behavior when the kernel Makefile is included
> > by another Makefile from a different project.
> >
> > Looks like Debian Stretch stopped providing make-kpkg (except
> > PowerPC).
>
> kernel-package is not included in stretch at all.  I'm not sure where
> you're seeing it as being present on powerpc - that architecture wasn't
> included in the stretch release.


Actually, I have not checked the powerpc part by myself.


I just read the following page:

https://unix.stackexchange.com/questions/238469/difference-between-make-kpkg-and-make-deb-pkg


"make-kpkg is included in wheezy and jessie but stretch (current
stable) only contains it for powerpc.

Powerpc is no longer supported in buster (testing)"



I will drop the PowerPC part.




> > Maybe it is obsolete and being replaced with 'make deb-pkg' etc.
> > but still widely used.
> [...]
>
> kernel-package is currently planned to be included in the next release,
> though I'm not sure whether it should be.

Hmm, OK.

I checked debian:buster in Docker,
and I see it.


root@3382de16960a:/home/foo# apt-file search  make-kpkg
kernel-package: /usr/bin/make-kpkg
kernel-package: /usr/share/man/man1/make-kpkg.1.gz
zsh-common: /usr/share/zsh/functions/Completion/Debian/_make-kpkg




If make-kpkg will still be included in the future Debian releases,
I'd like to change make-kpkg to make it work more reliably.


The git URL in the control file
"https://anonscm.debian.org/git/users/srivasta/debian/kernel-package.git"
seems stale.

Anyway, I found it in a new place:

$ git clone  https://salsa.debian.org/srivasta/kernel-package


Hmm, the last commit was three years ago.

So, it is almost unmaintained, I guess...


> There is another bug report about kernel-package with current kernel
> versions <https://bugs.debian.org/890817> but I don't know whether it
> has been worked around already.

Probably, not fixed.

It is not stalled actually.
I guess make-kpkg is hiding messages sent to stdout for some reasons.
If you continue pressing "Enter" key,
it will move on to the build stage.

I will take a look if it should be maintained.



Anyway, I want to hear from Manoj.


--
Best Regards
Masahiro Yamada

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

* Re: [PATCH] kbuild: add workaround for Debian make-kpkg
  2019-03-07  4:03   ` Masahiro Yamada
@ 2019-03-07  6:36     ` Ben Hutchings
       [not found]       ` <CABkpOEUqJWn62VZoTA5UEnbDieiYR9y3diRQhZuOVe6hOoBNhA@mail.gmail.com>
  0 siblings, 1 reply; 8+ messages in thread
From: Ben Hutchings @ 2019-03-07  6:36 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Linux Kbuild mailing list, Liz Zhang, Lili Deng, Riku Voipio,
	Michal Marek, Linux Kernel Mailing List, Manoj Srivastava

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

On Thu, 2019-03-07 at 13:03 +0900, Masahiro Yamada wrote:
[...]
> If make-kpkg will still be included in the future Debian releases,
> I'd like to change make-kpkg to make it work more reliably.
> 
> 
> The git URL in the control file
> "https://anonscm.debian.org/git/users/srivasta/debian/kernel-package.git"
> seems stale.
> 
> Anyway, I found it in a new place:
> 
> $ git clone  https://salsa.debian.org/srivasta/kernel-package
> 
> 
> Hmm, the last commit was three years ago.
> 
> So, it is almost unmaintained, I guess...
[...]

Yes, though there was a more recent bug fix by another Debian
developer:
https://tracker.debian.org/news/857223/accepted-kernel-package-13018nmu1-source-into-unstable/

Ben.

-- 
Ben Hutchings
friends: People who know you well, but like you anyway.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] kbuild: add workaround for Debian make-kpkg
       [not found]       ` <CABkpOEUqJWn62VZoTA5UEnbDieiYR9y3diRQhZuOVe6hOoBNhA@mail.gmail.com>
@ 2019-03-07 21:56         ` Ben Hutchings
  2019-03-08  6:42           ` Masahiro Yamada
  0 siblings, 1 reply; 8+ messages in thread
From: Ben Hutchings @ 2019-03-07 21:56 UTC (permalink / raw)
  To: Manoj Srivastava
  Cc: Masahiro Yamada, Linux Kbuild mailing list, Liz Zhang, Lili Deng,
	Riku Voipio, Michal Marek, Linux Kernel Mailing List

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

On Wed, 2019-03-06 at 22:48 -0800, Manoj Srivastava wrote:
> Hi,
> 
>   Does this have any users? I can take a stand at making it work, but I am
> unsure of there are enough people interested in make-kpkg anymore to make
> it worthwhile.
> 
>   There is a man pager that might be of minor interest, but that can be
> taken over by the kernel team if they want
[...]

I assume you're referring to kernel-img.conf.  I would be happy to add
that to linux-base, with some clarification of which settings are
understood by which packages.

I take it that you don't want kernel-package to be included in buster,
so can you open an RC bug to say so?

Ben.

-- 
Ben Hutchings
friends: People who know you well, but like you anyway.



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] kbuild: add workaround for Debian make-kpkg
  2019-03-07 21:56         ` Ben Hutchings
@ 2019-03-08  6:42           ` Masahiro Yamada
  2019-03-09 20:32             ` Ben Hutchings
  0 siblings, 1 reply; 8+ messages in thread
From: Masahiro Yamada @ 2019-03-08  6:42 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: Manoj Srivastava, Linux Kbuild mailing list, Liz Zhang,
	Lili Deng, Riku Voipio, Michal Marek, Linux Kernel Mailing List

On Fri, Mar 8, 2019 at 6:56 AM Ben Hutchings <ben@decadent.org.uk> wrote:
>
> On Wed, 2019-03-06 at 22:48 -0800, Manoj Srivastava wrote:
> > Hi,
> >
> >   Does this have any users?

Recently, I received a regression report.
So, yes. There are users.


> > I can take a stand at making it work, but I am
> > unsure of there are enough people interested in make-kpkg anymore to make
> > it worthwhile.
> >
> >   There is a man pager that might be of minor interest, but that can be
> > taken over by the kernel team if they want

I do not want to maintain the dying package.



> [...]
>
> I assume you're referring to kernel-img.conf.  I would be happy to add
> that to linux-base, with some clarification of which settings are
> understood by which packages.
>
> I take it that you don't want kernel-package to be included in buster,
> so can you open an RC bug to say so?

Also, could you make sure it won't come back to bullseye or later ?

How about Ubuntu? Is it out of your control?



> Ben.
>
> --
> Ben Hutchings
> friends: People who know you well, but like you anyway.
>
>


-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH] kbuild: add workaround for Debian make-kpkg
  2019-03-08  6:42           ` Masahiro Yamada
@ 2019-03-09 20:32             ` Ben Hutchings
  0 siblings, 0 replies; 8+ messages in thread
From: Ben Hutchings @ 2019-03-09 20:32 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Manoj Srivastava, Linux Kbuild mailing list, Liz Zhang,
	Lili Deng, Riku Voipio, Michal Marek, Linux Kernel Mailing List

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

On Fri, 2019-03-08 at 15:42 +0900, Masahiro Yamada wrote:
> On Fri, Mar 8, 2019 at 6:56 AM Ben Hutchings <ben@decadent.org.uk> wrote:
[...]
> > I take it that you don't want kernel-package to be included in buster,
> > so can you open an RC bug to say so?
> 
> Also, could you make sure it won't come back to bullseye or later ?

An RC (release-critical) bug will normally block a package from being
considered for any future release.

> How about Ubuntu? Is it out of your control?

Ubuntu's release management is independent of Debian's.  I don't know
whether they consider RC bugs in Debian.

Ben.

-- 
Ben Hutchings
Knowledge is power.  France is bacon.



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2019-03-09 20:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-06 16:00 [PATCH] kbuild: add workaround for Debian make-kpkg Masahiro Yamada
2019-03-06 20:59 ` Ben Hutchings
2019-03-06 21:01 ` Ben Hutchings
2019-03-07  4:03   ` Masahiro Yamada
2019-03-07  6:36     ` Ben Hutchings
     [not found]       ` <CABkpOEUqJWn62VZoTA5UEnbDieiYR9y3diRQhZuOVe6hOoBNhA@mail.gmail.com>
2019-03-07 21:56         ` Ben Hutchings
2019-03-08  6:42           ` Masahiro Yamada
2019-03-09 20:32             ` Ben Hutchings

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.