History log of /linux-6.15/scripts/package/debian/rules (Results 1 – 15 of 15)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: v6.15, v6.15-rc7, v6.15-rc6, v6.15-rc5, v6.15-rc4, v6.15-rc3, v6.15-rc2, v6.15-rc1, v6.14, v6.14-rc7
# 62604063 14-Mar-2025 Alexandru Gagniuc <[email protected]>

kbuild: deb-pkg: don't set KBUILD_BUILD_VERSION unconditionally

In ThinPro, we use the convention <upstream_ver>+hp<patchlevel> for
the kernel package. This does not have a dash in the name or versi

kbuild: deb-pkg: don't set KBUILD_BUILD_VERSION unconditionally

In ThinPro, we use the convention <upstream_ver>+hp<patchlevel> for
the kernel package. This does not have a dash in the name or version.
This is built by editing ".version" before a build, and setting
EXTRAVERSION="+hp" and KDEB_PKGVERSION make variables:

echo 68 > .version
make -j<n> EXTRAVERSION="+hp" bindeb-pkg KDEB_PKGVERSION=6.12.2+hp69

.deb name: linux-image-6.12.2+hp_6.12.2+hp69_amd64.deb

Since commit 7d4f07d5cb71 ("kbuild: deb-pkg: squash
scripts/package/deb-build-option to debian/rules"), this no longer
works. The deb build logic changed, even though, the commit message
implies that the logic should be unmodified.

Before, KBUILD_BUILD_VERSION was not set if the KDEB_PKGVERSION did
not contain a dash. After the change KBUILD_BUILD_VERSION is always
set to KDEB_PKGVERSION. Since this determines UTS_VERSION, the uname
output to look off:

(now) uname -a: version 6.12.2+hp ... #6.12.2+hp69
(expected) uname -a: version 6.12.2+hp ... #69

Update the debian/rules logic to restore the original behavior.

Fixes: 7d4f07d5cb71 ("kbuild: deb-pkg: squash scripts/package/deb-build-option to debian/rules")
Signed-off-by: Alexandru Gagniuc <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>

show more ...


# a7a05b1b 14-Mar-2025 Masahiro Yamada <[email protected]>

kbuild: deb-pkg: add comment about future removal of KDEB_COMPRESS

'man dpkg-deb' describes as follows:

DPKG_DEB_COMPRESSOR_TYPE
Sets the compressor type to use (since dpkg 1.21.10).

kbuild: deb-pkg: add comment about future removal of KDEB_COMPRESS

'man dpkg-deb' describes as follows:

DPKG_DEB_COMPRESSOR_TYPE
Sets the compressor type to use (since dpkg 1.21.10).

The -Z option overrides this value.

When commit 1a7f0a34ea7d ("builddeb: allow selection of .deb compressor")
was applied, dpkg-deb did not support this environment variable.

Later, dpkg commit c10aeffc6d71 ("dpkg-deb: Add support for
DPKG_DEB_COMPRESSOR_TYPE/LEVEL") introduced support for
DPKG_DEB_COMPRESSOR_TYPE, which provides the same functionality as
KDEB_COMPRESS.

KDEB_COMPRESS is still useful for users of older dpkg versions, but I
would like to remove this redundant functionality in the future.

This commit adds comments to notify users of the planned removal and to
encourage migration to DPKG_DEB_COMPRESSOR_TYPE where possible.

Signed-off-by: Masahiro Yamada <[email protected]>

show more ...


Revision tags: v6.14-rc6, v6.14-rc5, v6.14-rc4, v6.14-rc3, v6.14-rc2, v6.14-rc1, v6.13, v6.13-rc7, v6.13-rc6, v6.13-rc5, v6.13-rc4, v6.13-rc3, v6.13-rc2, v6.13-rc1, v6.12, v6.12-rc7, v6.12-rc6, v6.12-rc5, v6.12-rc4, v6.12-rc3, v6.12-rc2, v6.12-rc1, v6.11, v6.11-rc7, v6.11-rc6, v6.11-rc5, v6.11-rc4, v6.11-rc3, v6.11-rc2, v6.11-rc1, v6.10, v6.10-rc7, v6.10-rc6, v6.10-rc5, v6.10-rc4, v6.10-rc3, v6.10-rc2, v6.10-rc1, v6.9, v6.9-rc7, v6.9-rc6, v6.9-rc5, v6.9-rc4, v6.9-rc3, v6.9-rc2, v6.9-rc1, v6.8, v6.8-rc7, v6.8-rc6, v6.8-rc5, v6.8-rc4, v6.8-rc3, v6.8-rc2, v6.8-rc1
# f96beb84 13-Jan-2024 Masahiro Yamada <[email protected]>

kbuild: deb-pkg: call more misc debhelper commands

Use dh_prep instead of removing old build directories manually.

Use dh_clean instead of removing build directories and debian/files
manually.

Cal

kbuild: deb-pkg: call more misc debhelper commands

Use dh_prep instead of removing old build directories manually.

Use dh_clean instead of removing build directories and debian/files
manually.

Call dh_testdir and dh_testroot for preliminary checks.

Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>

show more ...


# 1d7bae8f 13-Jan-2024 Masahiro Yamada <[email protected]>

kbuild: deb-pkg: build binary-arch in parallel

'make deb-pkg' builds build-arch in parallel, but binary-arch serially.

Given that all binary packages are independent of one another, they can
be bui

kbuild: deb-pkg: build binary-arch in parallel

'make deb-pkg' builds build-arch in parallel, but binary-arch serially.

Given that all binary packages are independent of one another, they can
be built in parallel.

I am uncertain whether debian/files is robust against a race condition.
Just in case, make dh_gencontrol (dpkg-gencontrol) output to separate
debian/*.files, which are then concatenated into debian/files.

Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>

show more ...


# caf400c8 13-Jan-2024 Masahiro Yamada <[email protected]>

kbuild: deb-pkg: make debian/rules quiet for 'make deb-pkg'

Add $(Q) to the commands in debian/rules to make them quiet when the
package built is initiated by 'make deb-pkg' or when the 'terse' tag

kbuild: deb-pkg: make debian/rules quiet for 'make deb-pkg'

Add $(Q) to the commands in debian/rules to make them quiet when the
package built is initiated by 'make deb-pkg' or when the 'terse' tag
is set to DEB_BUILD_OPTIONS.

Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>

show more ...


# cc3df32c 13-Jan-2024 Masahiro Yamada <[email protected]>

kbuild: deb-pkg: show verbose log for direct package builds

When the Debian package build is initiated by Kbuild ('make deb-pkg'
or 'make bindeb-pkg'), the log messages are displayed in the short
fo

kbuild: deb-pkg: show verbose log for direct package builds

When the Debian package build is initiated by Kbuild ('make deb-pkg'
or 'make bindeb-pkg'), the log messages are displayed in the short
form, which is the Kbuild default.

Otherwise, let's show verbose messages (unless the 'terse' tag is set
in DEB_BUILD_OPTION), as suggested by Debian Policy: "The package build
should be as verbose as reasonably possible, except where the terse tag
is included in DEB_BUILD_OPTIONS." [1]

This is what the Debian kernel also does. [2]

[1]: https://www.debian.org/doc/debian-policy/ch-source.html#main-building-script-debian-rules
[2]: https://salsa.debian.org/kernel-team/linux/-/blob/debian/6.7-1_exp1/debian/rules.real#L36

Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>

show more ...


Revision tags: v6.7, v6.7-rc8
# 1b5e9465 30-Dec-2023 Masahiro Yamada <[email protected]>

kbuild: deb-pkg: move 'make headers' to build-arch

Strictly speaking, 'make headers' should be a part of build-arch
instead of binary-arch.

'make headers' constructs ready-to-copy UAPI headers in t

kbuild: deb-pkg: move 'make headers' to build-arch

Strictly speaking, 'make headers' should be a part of build-arch
instead of binary-arch.

'make headers' constructs ready-to-copy UAPI headers in the kernel
directory.

Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>

show more ...


# 5e73758b 26-Dec-2023 Masahiro Yamada <[email protected]>

kbuild: deb-pkg: use more debhelper commands in builddeb

Commit 36862e14e316 ("kbuild: deb-pkg: use dh_listpackages to know
enabled packages") started to require the debhelper tool suite.

Use more

kbuild: deb-pkg: use more debhelper commands in builddeb

Commit 36862e14e316 ("kbuild: deb-pkg: use dh_listpackages to know
enabled packages") started to require the debhelper tool suite.

Use more dh_* commands in create_package():

- dh_installdocs to install copyright
- dh_installchangelogs to install changelog
- dh_compress to compress changelog
- dh_fixperms to replace the raw chmod command
- dh_gencontrol to replace the raw dpkg-gencontrol command
- dh_md5sums to record the md5sum of included files
- dh_builddeb to replace the raw dpkg-deb command

Set DEB_RULES_REQUIRES_ROOT to 'no' in case debian/rules is executed
directly.

Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>

show more ...


# 68e262f8 26-Dec-2023 Masahiro Yamada <[email protected]>

kbuild: deb-pkg: remove unneeded '-f $srctree/Makefile' in debian/rules

This is unneeded because the Makefile in the output directory wraps
the top-level Makefile in the srctree.

Just run $(MAKE) i

kbuild: deb-pkg: remove unneeded '-f $srctree/Makefile' in debian/rules

This is unneeded because the Makefile in the output directory wraps
the top-level Makefile in the srctree.

Just run $(MAKE) irrespective of the build location.

Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>

show more ...


# eaf80f7f 26-Dec-2023 Masahiro Yamada <[email protected]>

kbuild: deb-pkg: allow to run debian/rules from output directory

'make O=... deb-pkg' creates the debian directory in the output
directory. However, currently it is impossible to run debian/rules
cr

kbuild: deb-pkg: allow to run debian/rules from output directory

'make O=... deb-pkg' creates the debian directory in the output
directory. However, currently it is impossible to run debian/rules
created in the separate output directory.

This commit delays the $(srctree) expansion by escaping '$' and by
quoting the entire command, making it possible to run debian/rules in
the output directory.

Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>

show more ...


# 159956f3 26-Dec-2023 Masahiro Yamada <[email protected]>

kbuild: deb-pkg: set DEB_* variables if debian/rules is directly executed

Since commit 491b146d4c13 ("kbuild: builddeb: Eliminate debian/arch
use"), direct execution of debian/rules results in the f

kbuild: deb-pkg: set DEB_* variables if debian/rules is directly executed

Since commit 491b146d4c13 ("kbuild: builddeb: Eliminate debian/arch
use"), direct execution of debian/rules results in the following error:

dpkg-architecture: error: unknown option 'DEB_HOST_MULTIARCH'

The current code:

dpkg-architecture -a$DEB_HOST_ARCH -qDEB_HOST_MULTIARCH

... does not look sensible because:

- For this code to work correctly, DEB_HOST_ARCH must be pre-defined,
which is true when the packages are built via dpkg-buildpackage.
In this case, DEB_HOST_MULTIARCH is also likely defined, hence there
is no need to query DEB_HOST_MULTIARCH in the first place.

- If DEB_HOST_MULTIARCH is undefined, DEB_HOST_ARCH is likely undefined
too. So, you cannot query DEB_HOST_MULTIARCH in this way. This is
mostly the case where debian/rules is directly executed.

When debian/rules is directly executed, querying DEB_HOST_MUCHARCH is
not enough because we need to know DEB_{BUILD,HOST}_GNU_TYPE as well.

All DEB_* variables are defined when the package build is initiated by
dpkg-buildpackage, but otherwise, let's call dpkg-architecture to set
all DEB_* environment variables.

This requires dpkg 1.20.6 or newer because --print-format option
was added in dpkg commit 7c54fa2b232e ("dpkg-architecture: Add a
--print-format option").

Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>

show more ...


# 7d4f07d5 26-Dec-2023 Masahiro Yamada <[email protected]>

kbuild: deb-pkg: squash scripts/package/deb-build-option to debian/rules

The binary-arch target needs to use the same CROSS_COMPILE as used in
build-arch; otherwise, 'make run-command' may attempt t

kbuild: deb-pkg: squash scripts/package/deb-build-option to debian/rules

The binary-arch target needs to use the same CROSS_COMPILE as used in
build-arch; otherwise, 'make run-command' may attempt to resync the
.config file.

Squash scripts/package/deb-build-option into debian/rules, as it is a
small amount of code.

Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>

show more ...


# 466e6fc4 26-Dec-2023 Masahiro Yamada <[email protected]>

kbuild: deb-pkg: factor out common Make options in debian/rules

This avoids code duplication between binary-arch and built-arch.

Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: N

kbuild: deb-pkg: factor out common Make options in debian/rules

This avoids code duplication between binary-arch and built-arch.

Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>

show more ...


Revision tags: v6.7-rc7, v6.7-rc6, v6.7-rc5, v6.7-rc4, v6.7-rc3, v6.7-rc2, v6.7-rc1, v6.6, v6.6-rc7, v6.6-rc6, v6.6-rc5, v6.6-rc4, v6.6-rc3, v6.6-rc2, v6.6-rc1, v6.5
# ed79c34d 20-Aug-2023 Masahiro Yamada <[email protected]>

kbuild: deb-pkg: support DEB_BUILD_OPTIONS=parallel=N in debian/rules

'make srcdeb-pkg' generates a source package, which you can build
later by using dpkg-buildpackage.

In older dpkg versions, 'dp

kbuild: deb-pkg: support DEB_BUILD_OPTIONS=parallel=N in debian/rules

'make srcdeb-pkg' generates a source package, which you can build
later by using dpkg-buildpackage.

In older dpkg versions, 'dpkg-buildpackage --jobs=N' sets not only
DEB_BUILD_OPTIONS but also MAKEFLAGS. Hence, passing -j or --jobs
to dpkg-buildpackage was enough for kicking the parallel execution.

The behavior was changed by commit 1d0ea9b2ba3f ("dpkg-buildpackage:
Change -j, --jobs semantics to non-force mode") of dpkg project. [1]

Since then, 'dpkg-buildpackage --jobs=N' sets only DEB_BUILD_OPTIONS,
which is not parsed by the current debian/rules. To build the package
in parallel, you need to pass the alternative --jobs-force option or
set the MAKEFLAGS environment variable.

Debian policy [2] suggests the following code snippet for debian/rules.

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
MAKEFLAGS += -j$(NUMJOBS)
endif

I tweaked the code to filter out parallel=1 and passed --jobs=1 to
dpkg-buildpackage from scripts/Makefile.package. It is needed to force
'make deb-pkg' without the -j option to run in serial. Please note that
dpkg-buildpackage sets parallel=<nproc> in DEB_BUILD_OPTIONS by default
(that is, --jobs=auto is the default) and --jobs=1 is needed to restore
the serial execution. When dpkg-buildpackage is invoked from Kbuild,
the number of jobs is inherited from the top level Makefile. Passing
--jobs=1 to dpkg-buildpackage allows debian/rules to skip parsing
DEB_BUILD_OPTIONS.

[1] https://salsa.debian.org/dpkg-team/dpkg/-/commit/1d0ea9b2ba3f6a2de5b1a6ff55f3df7b71f73db6
[2] https://www.debian.org/doc/debian-policy/ch-source.html#s-debianrules-options

Reported-by: Bastian Germann <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>

show more ...


Revision tags: v6.5-rc7, v6.5-rc6, v6.5-rc5
# d9287ea8 01-Aug-2023 Masahiro Yamada <[email protected]>

kbuild: deb-pkg: split debian/rules

debian/rules is generated by shell, but the escape sequence (\$) is
unreadable.

debian/rules embeds only two variables (ARCH and KERNELRELEASE).

Split them out

kbuild: deb-pkg: split debian/rules

debian/rules is generated by shell, but the escape sequence (\$) is
unreadable.

debian/rules embeds only two variables (ARCH and KERNELRELEASE).

Split them out to debian/rules.vars, and check-in the rest of Makefile
code to scripts/package/debian/rules.

Signed-off-by: Masahiro Yamada <[email protected]>
Tested-by: Nathan Chancellor <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>

show more ...