[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Question about compiling the linux kernel



On Sat, Aug 16, 2025 at 07:38:57AM +0000, maria.shrivinski wrote:
> When compiling the kernel with make -j `getconf _NPROCESSORS_ONLN` deb-pkg the resulting .deb packages are generated in the parent directory.

Note that "make deb-pkg" is part of the upstream linux kernel's build
infrastructure, and it's different from the mechanism used to build
the kernel packages which Debian and other Debian-derived stributions
ship.  So if you want to ask questions about the upstream Linux's
deb-pkg kbuild infrastructure, you might want to try sending your
question to linux-kbuild@vger.kernel.org.

For myself, what I do is to have a wrapper script around running "make
... deb-pkg".  So in my xfstests-bld[1] infrastructure, which is
optimized for file system developers, I have a kbuild script which can
be found here[2].

[1] https://github.com/tytso/xfstests-bld
[2] https://github.com/tytso/xfstests-bld/blob/master/kernel-build/kbuild

The way I use it is:

% install-kconfig
% kbuild
% gce-xfstests smoke
% kbuild --arch arm64
% gce-xfstests smoke

In my kernel sources, in .git/kconfig/config I have the following:

BLD_DIR=/build/ext4
KERN_ARCH=x86_64
BLD_DIR_32=/build/ext4-32
BLD_DIR_ARM64=/build/ext4-arm64
DO_DPKG=yes

This script is probably not ideal for you; it's optimized for a file
system developer's workflow.  See [3][4] for more details.  But you
could use these scripts as a starting point.

[3] https://github.com/tytso/xfstests-bld/blob/master/Documentation/00-index.md
[4] https://thunk.org/gce-xfstests

Cheers,

						- Ted


Reply to: