Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #88865 > unrolled thread

Question about compiling the linux kernel

Started by"maria.shrivinski" <maria.shrivinski@proton.me>
First post2025-08-16 09:50 +0200
Last post2025-08-17 16:30 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.debian.kernel


Contents

  Question about compiling the linux kernel "maria.shrivinski" <maria.shrivinski@proton.me> - 2025-08-16 09:50 +0200
    Re: Question about compiling the linux kernel alessandro.ratti@protonmail.ch - 2025-08-16 19:40 +0200
      Re: Question about compiling the linux kernel Salvatore Bonaccorso <carnil@debian.org> - 2025-08-17 16:30 +0200

#88865 — Question about compiling the linux kernel

From"maria.shrivinski" <maria.shrivinski@proton.me>
Date2025-08-16 09:50 +0200
SubjectQuestion about compiling the linux kernel
Message-ID<LkjPP-7ZVH-15@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

When compiling the kernel with make -j `getconf _NPROCESSORS_ONLN` deb-pkg the resulting .deb packages are generated in the parent directory.

Is there a way to choose a specific directory where those packages will be placed?

I have researched this issue and found partial answers about modifying scripts/package/debian/rules or various makefiles, but nothing has worked so far.

Using environment variables like DESTDIR=/path/to/dir or OUTPUT_DIRECTORY=/path/to/dir with the make command also did not work.

Starting to think that this might be impossible. Anyone have an idea?
Thanks for your time!

[toc] | [next] | [standalone]


#88871

Fromalessandro.ratti@protonmail.ch
Date2025-08-16 19:40 +0200
Message-ID<Lkt2N-85Ux-15@gated-at.bofh.it>
In reply to#88865
On Saturday, August 16th, 2025 at 9:41 AM, maria.shrivinski <maria.shrivinski@proton.me> wrote:

Hello,

> When compiling the kernel with make -j `getconf _NPROCESSORS_ONLN` deb-pkg the resulting .deb packages are generated in the parent directory.
> Is there a way to choose a specific directory where those packages will be placed?
> 
> I have researched this issue and found partial answers about modifying scripts/package/debian/rules or various makefiles, but nothing has worked so far.
> 
> Using environment variables like DESTDIR=/path/to/dir or OUTPUT_DIRECTORY=/path/to/dir with the make command also did not work.
> 
> Starting to think that this might be impossible. Anyone have an idea?

I guess you're referring to the system found in the upstream kernel — a bit out of topic in this ML, isn't it? :P 

Anyway, here is how I would do it.
First you need to patch scripts/package/debian/rules with the following:

diff --git a/scripts/package/debian/rules b/scripts/package/debian/rules
index a417a7f8bbc1..a9826a62c4f2 100755
--- a/scripts/package/debian/rules
+++ b/scripts/package/debian/rules
@@ -58,7 +58,7 @@ define binary
        $(Q)dh_fixperms $(DH_OPTIONS)
        $(Q)dh_gencontrol $(DH_OPTIONS) -- -f$(call mk-files,$@)
        $(Q)dh_md5sums $(DH_OPTIONS)
-       $(Q)dh_builddeb $(DH_OPTIONS) -- $(addprefix -Z,$(KDEB_COMPRESS))
+       $(Q)dh_builddeb $(DH_OPTIONS) --destdir=$(ARTIFACTS_DIR) -- $(addprefix -Z,$(KDEB_COMPRESS))
 endef
 
 .PHONY: $(binary-targets)

Then, you can build the package with the following command:

export ARTIFACTS_DIR=$(mktemp -d)
make DPKG_FLAGS="--buildinfo-file=${ARTIFACTS_DIR}/vanilla-image.buildinfo --buildinfo-option=-u${ARTIFACTS_DIR} --changes-option=-u${ARTIFACTS_DIR}" -j $(nproc --all) bindeb-pkg

Please note the DPKG_FLAGS.

Hope it helps

Best regards
Alessandro

[toc] | [prev] | [next] | [standalone]


#88884

FromSalvatore Bonaccorso <carnil@debian.org>
Date2025-08-17 16:30 +0200
Message-ID<LkMyu-8iKl-3@gated-at.bofh.it>
In reply to#88871
Hi,

On Sat, Aug 16, 2025 at 05:39:00PM +0000, alessandro.ratti@protonmail.ch wrote:
> On Saturday, August 16th, 2025 at 9:41 AM, maria.shrivinski <maria.shrivinski@proton.me> wrote:
> 
> Hello,
> 
> > When compiling the kernel with make -j `getconf _NPROCESSORS_ONLN` deb-pkg the resulting .deb packages are generated in the parent directory.
> > Is there a way to choose a specific directory where those packages will be placed?
> > 
> > I have researched this issue and found partial answers about modifying scripts/package/debian/rules or various makefiles, but nothing has worked so far.
> > 
> > Using environment variables like DESTDIR=/path/to/dir or OUTPUT_DIRECTORY=/path/to/dir with the make command also did not work.
> > 
> > Starting to think that this might be impossible. Anyone have an idea?
> 
> I guess you're referring to the system found in the upstream kernel — a bit out of topic in this ML, isn't it? :P 

Additionally, maria, please do not cross-post the same question on
different Debian mailinglist. There was the same question in:
https://lists.debian.org/debian-devel/2025/08/msg00273.html
(which there is defintively offtopic though).

Regards,
Salvatore

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.kernel


csiph-web