All of lore.kernel.org
 help / color / mirror / Atom feed
* "make bindeb-pkg" fails with CONFIG_MODULES disabled
@ 2020-09-25 22:29 Josh Triplett
  2020-09-26  5:45 ` Masahiro Yamada
  0 siblings, 1 reply; 5+ messages in thread
From: Josh Triplett @ 2020-09-25 22:29 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, Michal Marek

With CONFIG_MODULES disabled, "make bindeb-pkg" fails in
scripts/package/builddeb with:

find: ‘Module.symvers’: No such file or directory

The deploy_kernel_headers function in scripts/package/builddeb calls:

find arch/$SRCARCH/include Module.symvers include scripts -type f

But find errors out if any of its command-line arguments doesn't exist.

This could be fixed by checking whether that file exists first, but if
CONFIG_MODULES is disabled, it doesn't really make sense to build the
linux-headers package at all. Perhaps that whole package could be
disabled when modules are disabled?

- Josh Triplett

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

* Re: "make bindeb-pkg" fails with CONFIG_MODULES disabled
  2020-09-25 22:29 "make bindeb-pkg" fails with CONFIG_MODULES disabled Josh Triplett
@ 2020-09-26  5:45 ` Masahiro Yamada
  2020-09-26  8:45   ` Josh Triplett
  0 siblings, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2020-09-26  5:45 UTC (permalink / raw)
  To: Josh Triplett; +Cc: Linux Kbuild mailing list, Michal Marek

On Sat, Sep 26, 2020 at 7:29 AM Josh Triplett <josh@joshtriplett.org> wrote:
>
> With CONFIG_MODULES disabled, "make bindeb-pkg" fails in
> scripts/package/builddeb with:
>
> find: ‘Module.symvers’: No such file or directory
>
> The deploy_kernel_headers function in scripts/package/builddeb calls:
>
> find arch/$SRCARCH/include Module.symvers include scripts -type f
>
> But find errors out if any of its command-line arguments doesn't exist.
>
> This could be fixed by checking whether that file exists first, but if
> CONFIG_MODULES is disabled, it doesn't really make sense to build the
> linux-headers package at all. Perhaps that whole package could be
> disabled when modules are disabled?

I agree.


How about something like the following?


diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 6df3c9f8b2da..8277144298a0 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -202,8 +202,10 @@ EOF
 done

 if [ "$ARCH" != "um" ]; then
-       deploy_kernel_headers debian/linux-headers
-       create_package linux-headers-$version debian/linux-headers
+       if is_enabled CONFIG_MODULES; then
+               deploy_kernel_headers debian/linux-headers
+               create_package linux-headers-$version debian/linux-headers
+       fi

        deploy_libc_headers debian/linux-libc-dev
        create_package linux-libc-dev debian/linux-libc-dev
diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index 48fbd3d0284a..88c5e25662bd 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -183,13 +183,6 @@ Description: Linux kernel, version $version
  This package contains the Linux kernel, modules and corresponding other
  files, version: $version.

-Package: $kernel_headers_packagename
-Architecture: $debarch
-Description: Linux kernel headers for $version on $debarch
- This package provides kernel header files for $version on $debarch
- .
- This is useful for people who need to build external modules
-
 Package: linux-libc-dev
 Section: devel
 Provides: linux-kernel-headers
@@ -200,6 +193,17 @@ Description: Linux support headers for userspace
development
 Multi-Arch: same
 EOF

+if is_enabled CONFIG_MODULES; then
+cat <<EOF >> debian/control
+Package: $kernel_headers_packagename
+Architecture: $debarch
+Description: Linux kernel headers for $version on $debarch
+ This package provides kernel header files for $version on $debarch
+ .
+ This is useful for people who need to build external modules
+EOF
+fi
+
 if is_enabled CONFIG_DEBUG_INFO; then
 cat <<EOF >> debian/control






-- 
Best Regards
Masahiro Yamada

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

* Re: "make bindeb-pkg" fails with CONFIG_MODULES disabled
  2020-09-26  5:45 ` Masahiro Yamada
@ 2020-09-26  8:45   ` Josh Triplett
  2020-10-13 16:48     ` Masahiro Yamada
  0 siblings, 1 reply; 5+ messages in thread
From: Josh Triplett @ 2020-09-26  8:45 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Linux Kbuild mailing list, Michal Marek

On Sat, Sep 26, 2020 at 02:45:38PM +0900, Masahiro Yamada wrote:
> On Sat, Sep 26, 2020 at 7:29 AM Josh Triplett <josh@joshtriplett.org> wrote:
> >
> > With CONFIG_MODULES disabled, "make bindeb-pkg" fails in
> > scripts/package/builddeb with:
> >
> > find: ‘Module.symvers’: No such file or directory
> >
> > The deploy_kernel_headers function in scripts/package/builddeb calls:
> >
> > find arch/$SRCARCH/include Module.symvers include scripts -type f
> >
> > But find errors out if any of its command-line arguments doesn't exist.
> >
> > This could be fixed by checking whether that file exists first, but if
> > CONFIG_MODULES is disabled, it doesn't really make sense to build the
> > linux-headers package at all. Perhaps that whole package could be
> > disabled when modules are disabled?
> 
> I agree.
> 
> 
> How about something like the following?

That looks good to me.

(It would be nice, as well, to have some conditional wrapped around the
linux-libc-dev package. I had a patch for that a while ago at
https://lore.kernel.org/lkml/b45738b05bb396e175a36f67b02fa01de4c7472f.1583912084.git.josh@joshtriplett.org/
, but that's probably not the ideal way to do it. I'd love to see a way
to disable that extra deb, though, as it adds time to the deb build
process for a package that most people looking to build a deb won't
need or install.)

> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index 6df3c9f8b2da..8277144298a0 100755
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -202,8 +202,10 @@ EOF
>  done
> 
>  if [ "$ARCH" != "um" ]; then
> -       deploy_kernel_headers debian/linux-headers
> -       create_package linux-headers-$version debian/linux-headers
> +       if is_enabled CONFIG_MODULES; then
> +               deploy_kernel_headers debian/linux-headers
> +               create_package linux-headers-$version debian/linux-headers
> +       fi
> 
>         deploy_libc_headers debian/linux-libc-dev
>         create_package linux-libc-dev debian/linux-libc-dev
> diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
> index 48fbd3d0284a..88c5e25662bd 100755
> --- a/scripts/package/mkdebian
> +++ b/scripts/package/mkdebian
> @@ -183,13 +183,6 @@ Description: Linux kernel, version $version
>   This package contains the Linux kernel, modules and corresponding other
>   files, version: $version.
> 
> -Package: $kernel_headers_packagename
> -Architecture: $debarch
> -Description: Linux kernel headers for $version on $debarch
> - This package provides kernel header files for $version on $debarch
> - .
> - This is useful for people who need to build external modules
> -
>  Package: linux-libc-dev
>  Section: devel
>  Provides: linux-kernel-headers
> @@ -200,6 +193,17 @@ Description: Linux support headers for userspace
> development
>  Multi-Arch: same
>  EOF
> 
> +if is_enabled CONFIG_MODULES; then
> +cat <<EOF >> debian/control
> +Package: $kernel_headers_packagename
> +Architecture: $debarch
> +Description: Linux kernel headers for $version on $debarch
> + This package provides kernel header files for $version on $debarch
> + .
> + This is useful for people who need to build external modules
> +EOF
> +fi
> +
>  if is_enabled CONFIG_DEBUG_INFO; then
>  cat <<EOF >> debian/control
> 
> 
> 
> 
> 
> 
> -- 
> Best Regards
> Masahiro Yamada

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

* Re: "make bindeb-pkg" fails with CONFIG_MODULES disabled
  2020-09-26  8:45   ` Josh Triplett
@ 2020-10-13 16:48     ` Masahiro Yamada
  2020-10-20 17:21       ` Josh Triplett
  0 siblings, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2020-10-13 16:48 UTC (permalink / raw)
  To: Josh Triplett; +Cc: Linux Kbuild mailing list, Michal Marek

On Sat, Sep 26, 2020 at 5:45 PM Josh Triplett <josh@joshtriplett.org> wrote:
>
> On Sat, Sep 26, 2020 at 02:45:38PM +0900, Masahiro Yamada wrote:
> > On Sat, Sep 26, 2020 at 7:29 AM Josh Triplett <josh@joshtriplett.org> wrote:
> > >
> > > With CONFIG_MODULES disabled, "make bindeb-pkg" fails in
> > > scripts/package/builddeb with:
> > >
> > > find: ‘Module.symvers’: No such file or directory
> > >
> > > The deploy_kernel_headers function in scripts/package/builddeb calls:
> > >
> > > find arch/$SRCARCH/include Module.symvers include scripts -type f
> > >
> > > But find errors out if any of its command-line arguments doesn't exist.
> > >
> > > This could be fixed by checking whether that file exists first, but if
> > > CONFIG_MODULES is disabled, it doesn't really make sense to build the
> > > linux-headers package at all. Perhaps that whole package could be
> > > disabled when modules are disabled?
> >
> > I agree.
> >
> >
> > How about something like the following?
>
> That looks good to me.
>
> (It would be nice, as well, to have some conditional wrapped around the
> linux-libc-dev package. I had a patch for that a while ago at
> https://lore.kernel.org/lkml/b45738b05bb396e175a36f67b02fa01de4c7472f.1583912084.git.josh@joshtriplett.org/
> , but that's probably not the ideal way to do it. I'd love to see a way
> to disable that extra deb, though, as it adds time to the deb build
> process for a package that most people looking to build a deb won't
> need or install.)

I am skeptical about this approach.


I think the ideal way would be
to support individual binary package build in dpkg-buildpackage.

I do not know if it has been already achieved, or
it is a planned feature.





> > diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> > index 6df3c9f8b2da..8277144298a0 100755
> > --- a/scripts/package/builddeb
> > +++ b/scripts/package/builddeb
> > @@ -202,8 +202,10 @@ EOF
> >  done
> >
> >  if [ "$ARCH" != "um" ]; then
> > -       deploy_kernel_headers debian/linux-headers
> > -       create_package linux-headers-$version debian/linux-headers
> > +       if is_enabled CONFIG_MODULES; then
> > +               deploy_kernel_headers debian/linux-headers
> > +               create_package linux-headers-$version debian/linux-headers
> > +       fi
> >
> >         deploy_libc_headers debian/linux-libc-dev
> >         create_package linux-libc-dev debian/linux-libc-dev
> > diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
> > index 48fbd3d0284a..88c5e25662bd 100755
> > --- a/scripts/package/mkdebian
> > +++ b/scripts/package/mkdebian
> > @@ -183,13 +183,6 @@ Description: Linux kernel, version $version
> >   This package contains the Linux kernel, modules and corresponding other
> >   files, version: $version.
> >
> > -Package: $kernel_headers_packagename
> > -Architecture: $debarch
> > -Description: Linux kernel headers for $version on $debarch
> > - This package provides kernel header files for $version on $debarch
> > - .
> > - This is useful for people who need to build external modules
> > -
> >  Package: linux-libc-dev
> >  Section: devel
> >  Provides: linux-kernel-headers
> > @@ -200,6 +193,17 @@ Description: Linux support headers for userspace
> > development
> >  Multi-Arch: same
> >  EOF
> >
> > +if is_enabled CONFIG_MODULES; then
> > +cat <<EOF >> debian/control
> > +Package: $kernel_headers_packagename
> > +Architecture: $debarch
> > +Description: Linux kernel headers for $version on $debarch
> > + This package provides kernel header files for $version on $debarch
> > + .
> > + This is useful for people who need to build external modules
> > +EOF
> > +fi
> > +
> >  if is_enabled CONFIG_DEBUG_INFO; then
> >  cat <<EOF >> debian/control
> >
> >
> >
> >
> >
> >
> > --
> > Best Regards
> > Masahiro Yamada



--
Best Regards
Masahiro Yamada

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

* Re: "make bindeb-pkg" fails with CONFIG_MODULES disabled
  2020-10-13 16:48     ` Masahiro Yamada
@ 2020-10-20 17:21       ` Josh Triplett
  0 siblings, 0 replies; 5+ messages in thread
From: Josh Triplett @ 2020-10-20 17:21 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Linux Kbuild mailing list, Michal Marek

On Wed, Oct 14, 2020 at 01:48:28AM +0900, Masahiro Yamada wrote:
> On Sat, Sep 26, 2020 at 5:45 PM Josh Triplett <josh@joshtriplett.org> wrote:
> >
> > On Sat, Sep 26, 2020 at 02:45:38PM +0900, Masahiro Yamada wrote:
> > > On Sat, Sep 26, 2020 at 7:29 AM Josh Triplett <josh@joshtriplett.org> wrote:
> > > >
> > > > With CONFIG_MODULES disabled, "make bindeb-pkg" fails in
> > > > scripts/package/builddeb with:
> > > >
> > > > find: ‘Module.symvers’: No such file or directory
> > > >
> > > > The deploy_kernel_headers function in scripts/package/builddeb calls:
> > > >
> > > > find arch/$SRCARCH/include Module.symvers include scripts -type f
> > > >
> > > > But find errors out if any of its command-line arguments doesn't exist.
> > > >
> > > > This could be fixed by checking whether that file exists first, but if
> > > > CONFIG_MODULES is disabled, it doesn't really make sense to build the
> > > > linux-headers package at all. Perhaps that whole package could be
> > > > disabled when modules are disabled?
> > >
> > > I agree.
> > >
> > >
> > > How about something like the following?
> >
> > That looks good to me.
> >
> > (It would be nice, as well, to have some conditional wrapped around the
> > linux-libc-dev package. I had a patch for that a while ago at
> > https://lore.kernel.org/lkml/b45738b05bb396e175a36f67b02fa01de4c7472f.1583912084.git.josh@joshtriplett.org/
> > , but that's probably not the ideal way to do it. I'd love to see a way
> > to disable that extra deb, though, as it adds time to the deb build
> > process for a package that most people looking to build a deb won't
> > need or install.)
> 
> I am skeptical about this approach.
> 
> 
> I think the ideal way would be
> to support individual binary package build in dpkg-buildpackage.
> 
> I do not know if it has been already achieved, or
> it is a planned feature.

Given the way Debian packages are built, that's not really an option.
There are targets in debian/rules to build arch-specific and
arch-independent packages, but not targets to build individual binary
packages.

Are you more concerned about avoiding the code conditionally generating
the control file, or about avoiding the code that has to pass the
controlling environment variable down through build steps?

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

end of thread, other threads:[~2020-10-20 17:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-25 22:29 "make bindeb-pkg" fails with CONFIG_MODULES disabled Josh Triplett
2020-09-26  5:45 ` Masahiro Yamada
2020-09-26  8:45   ` Josh Triplett
2020-10-13 16:48     ` Masahiro Yamada
2020-10-20 17:21       ` Josh Triplett

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.