summaryrefslogtreecommitdiff
path: root/scripts/package/mkdebian
AgeCommit message (Collapse)Author
2020-10-14kbuild: deb-pkg: clean up package name variablesMasahiro Yamada
Hard-code the names of linux-headers and debug packages in the control file. The kernel package is different for ARCH=um. Change the code for better readability. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-10-14kbuild: deb-pkg: do not build linux-headers package if CONFIG_MODULES=nMasahiro Yamada
Since commit 269a535ca931 ("modpost: generate vmlinux.symvers and reuse it for the second modpost"), with CONFIG_MODULES disabled, "make deb-pkg" (or "make bindeb-pkg") fails with: find: ‘Module.symvers’: No such file or directory If CONFIG_MODULES is disabled, it doesn't really make sense to build the linux-headers package. Fixes: 269a535ca931 ("modpost: generate vmlinux.symvers and reuse it for the second modpost") Reported-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-10-10builddeb: Add support for all required debian/rules targetsGuillem Jover
These have been required by the Debian policy for a while, even though the tooling can detect and workaround their omission, but are a hard requirement when using rootless builds. [masahiro: The following Debian policy is particularly important for rootless builds: "Both binary-* targets should depend on the build target, or on the appropriate build-arch or build-indep target, so that the package is built if it has not been already." ] Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-10-09builddeb: Enable rootless buildsGuillem Jover
This makes it possible to build the Debian packages without requiring (pseudo-)root privileges, when the build drivers support this mode of operation. See-Also: /usr/share/doc/dpkg/rootless-builds.txt.gz Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-08-10kbuild: Replace HTTP links with HTTPS onesAlexander A. Klimov
Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: If not .svg: For each line: If doesn't contain `\bxmlns\b`: For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`: If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`: If both the HTTP and HTTPS versions return 200 OK and serve the same content: Replace HTTP with HTTPS. Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-03-30kbuild: deb-pkg: fix warning when CONFIG_DEBUG_INFO is unsetReinhard Karcher
Creating a Debian package without CONFIG_DEBUG_INFO produces a warning that no debug package was created. This patch excludes the debug package from the control file, if no debug package is created by this configuration. Signed-off-by: Reinhard Karcher <reinhard.karcher@gmx.net> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-01-04kbuild/deb-pkg: annotate libelf-dev dependency as :nativeArd Biesheuvel
Cross compiling the x86 kernel on a non-x86 build machine produces the following error when CONFIG_UNWINDER_ORC is enabled, regardless of whether libelf-dev is installed or not. dpkg-checkbuilddeps: error: Unmet build dependencies: libelf-dev dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting dpkg-buildpackage: warning: (Use -d flag to override.) Since this is a build time dependency for a build tool, we need to depend on the native version of libelf-dev so add the appropriate annotation. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2019-12-17scripts: package: mkdebian: add missing rsync dependencyEnrico Weigelt, metux IT consult
We've missed the dependency to rsync, so build fails on minimal containers. Fixes: 59b2bd05f5f4 ("kbuild: add 'headers' target to build up uapi headers in usr/include") Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2019-07-17builddeb: generate multi-arch friendly linux-libc-dev packageCedric Hombourger
Debian-based distributions place libc header files in a machine specific directory (/usr/include/<libc-machine>) instead of /usr/include/asm to support installation of the linux-libc-dev package from multiple architectures. Move headers installed by "make headers_install" accordingly using Debian's tuple from dpkg-architecture (stored in debian/arch). Signed-off-by: Cedric Hombourger <Cedric_Hombourger@mentor.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-03-17kbuild: deb-pkg: avoid implicit effectsArseny Maslennikov
* The man page for dpkg-source(1) notes: > -b, --build directory [format-specific-parameters] > Build a source package (--build since dpkg 1.17.14). > <...> > > dpkg-source will build the source package with the first > format found in this ordered list: the format indicated > with the --format command line option, the format > indicated in debian/source/format, “1.0”. The fallback > to “1.0” is deprecated and will be removed at some point > in the future, you should always document the desired > source format in debian/source/format. See section > SOURCE PACKAGE FORMATS for an extensive description of > the various source package formats. Thus it would be more foolproof to explicitly use 1.0 (as we always did) than to rely on dpkg-source's defaults. * In a similar vein, debian/rules is not made executable by mkdebian, and dpkg-source warns about that but still silently fixes the file. Let's be explicit once again. Signed-off-by: Arseny Maslennikov <ar@cs.msu.ru> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-03-14kbuild: pkg: grep include/config/auto.conf instead of $KCONFIG_CONFIGMasahiro Yamada
This will be a little more efficient since unset CONFIG options are stripped away from auto.conf, and we can hard-code the path to auto.conf since it is never overridden. include/config/kernel.release is generated before %pkg is run. So, it is guaranteed auto.conf is up-to-date. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-03-14kbuild: deb-pkg: add CONFIG_ prefix to kernel config optionsMasahiro Yamada
This might be a kind of bike-shed, but I personally prefer grep'able code. I often do 'git grep CONFIG_FOO' instead of 'git grep FOO' when I want to know where that CONFIG option is used. This makes code longer, but I hope this is acceptable level. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-03-14deb-pkg: generate correct build dependenciesRiku Voipio
bison/flex is now needed always for building for kconfig. Some build dependencies depend on kernel configuration, enable them as needed: - libelf-dev when UNWINDER_ORC is set - libssl-dev for SYSTEM_TRUSTED_KEYRING Since the libssl-dev is needed for extract_cert binary, denote with :native to install the libssl-dev for the build machines architecture, rather than for the architecture of the kernel being built. Tested-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Ben Hutchings <ben@decadent.org.uk> Acked-by: maximilian attems <maks@stro.at> [masahiro.yamada: change 'flex' to 'flex | flex:native' ] Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-02-20kbuild: pkg: use -f $(srctree)/Makefile to recurse to top MakefileMasahiro Yamada
'$(MAKE) KBUILD_SRC=' changes the working directory back and forth between objtree and srctree. It is better to recurse to the top-level Makefile directly. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-11-11kbuild: deb-pkg: fix too low build version numberMasahiro Yamada
Since commit b41d920acff8 ("kbuild: deb-pkg: split generating packaging and build"), the build version of the kernel contained in a deb package is too low by 1. Prior to the bad commit, the kernel was built first, then the number in .version file was read out, and written into the debian control file. Now, the debian control file is created before the kernel is actually compiled, which is causing the version number mismatch. Let the mkdebian script pass KBUILD_BUILD_VERSION=${revision} to require the build system to use the specified version number. Fixes: b41d920acff8 ("kbuild: deb-pkg: split generating packaging and build") Reported-by: Doug Smythies <dsmythies@telus.net> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Tested-by: Doug Smythies <dsmythies@telus.net>
2018-07-28builddeb: Add automatic support for sh{3,4}{,eb} architecturesBen Hutchings
Different generations of the SH architecture are not very compatible, so there are/were separate Debian ports for SH3 and SH4. Move the fallback out of the "case" statement, so that it will also be used in case we find some SH architecture version without a known mapping. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-07-28builddeb: Add automatic support for riscv* architecturesBen Hutchings
Debian currently only defines "riscv64", but it seems safe to assume that any 32-bit port will now be called "riscv32", also matching $UTS_MACHINE. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-07-28builddeb: Add automatic support for m68k architectureBen Hutchings
Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-07-28builddeb: Add automatic support for or1k architectureBen Hutchings
Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-07-28builddeb: Add automatic support for sparc64 architectureBen Hutchings
We currently label 64-bit kernel packages as sparc (32-bit), mostly because it was officially supported while sparc64 was not. Now neither is officially supported, so label these packages as sparc64. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-07-28builddeb: Add automatic support for mips{,64}r6{,el} architecturesBen Hutchings
MIPS R6 is not fully backward-compatible, so Debian has separate architecture names for userland built for R6. Label kernel packages accordingly. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-07-28builddeb: Add automatic support for mips64el architectureBen Hutchings
We currently label 64-bit little-endian kernel packages as mipsel (32-bit little-endian), mostly it was officially supported while mips64el (64-bit little-endian) was not. Now both are officially supported, so label these packages as mips64el. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-07-28builddeb: Add automatic support for ppc64 and powerpcspe architecturesBen Hutchings
We currently label 64-bit big-endian kernel packages as powerpc (32-bit), mostly because it was officially supported while ppc64 (64-bit big-endian) was not. Now neither is officially supported, so label these packages as ppc64. Debian also has a powerpcspe (32-bit with SPE) architecture. Label packages with a suitable configuration as powerpcspe. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-07-28builddeb: Introduce functions to simplify kconfig tests in set_debarchBen Hutchings
We now have many repetitive greps over the kernel config. Refactor them into functions. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-07-28builddeb: Drop check for 32-bit s390Ben Hutchings
s390 now only supports 64-bit configurations. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-07-28builddeb: Change architecture detection fallback to use dpkg-architectureBen Hutchings
We currently use dpkg --print-architecture, which reports the architecture of the build machine. We can make a better guess than this by asking dpkg-architecture what the host architecture, i.e. the default architecture for building packages, is. This is sensitive to environment variables such as CC and DEB_HOST_ARCH, which should already be set in a cross-build environment. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-07-28builddeb: Skip architecture detection when KBUILD_DEBARCH is setBen Hutchings
If KBUILD_DEBARCH is set then we will not use the result of architecture detection, and we may also warn unnecessarily. Move the check for KBUILD_DEBARCH further up to avoid this. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-05-17kbuild: deb-pkg improve maintainer address generationRiku Voipio
There is multiple issues with the genaration of maintainer string It uses DEBEMAIL and EMAIL enviroment variables, which may contain angle brackets, creating invalid maintainer strings. The documented KBUILD_BUILD_USER and KBUILD_BUILD_HOST variables are not used. Undocumented and uncommon NAME variable is used. Refactor the Maintainer string to: - use EMAIL or DEBEMAIL directly if they are in form "name <user@host>" - use KBUILD_BUILD_USER and KBUILD_BUILD_HOST if set before falling back to autodetection - no longer use NAME variable or the useless Anonymous string The logic is switched from multiline if/then/fi statements to compact shell variable substition commands. Reported-by: Mathieu Malaterre <malat@debian.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-04-07kbuild: deb-pkg: split generating packaging and buildRiku Voipio
Move debian/ directory generation out of builddeb to a new script, mkdebian. The package build commands are kept in builddeb, which is now an internal command called from debian/rules. With these changes in place, we can now use dpkg-buildpackage from deb-pkg and bindeb-pkg removing need for handrolled source/changes generation. This patch is based on the criticism of the current state of builddeb discussed on: https://patchwork.kernel.org/patch/9656403/ Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>