Commit Graph

287 Commits

Author SHA1 Message Date
Bastian Blank 413fadb4aa Factor out debug info disable flag 2020-09-05 09:18:19 +02:00
Bastian Blank 4899f5039c Factor out installer modules disable flag 2020-09-05 09:18:19 +02:00
Ben Hutchings 8f20d53908 [armel/marvell,sh4] linux-image: Recommend apparmor, like all other configs
The "recommends" field set in the [image] section for these
configurations overrode the field at the top level.  We want
gencontrol.py to concatenate the relations in this section at all
levels.

The ConfigCore.get_merge method supports doing this, but only with
list fields So we need to specify in the config schema that these
fields are comma-separated lists.
2019-04-22 00:30:48 +01:00
Ben Hutchings dcd90f6ce7 debian/control: Assert that linux-{image,headers} templates describe 1 package
We only process the first package found in these templates so fail
if there are more.
2019-03-11 00:43:51 +00:00
Ben Hutchings 14ab885d53 debian/bin/gencontrol.py: Remove unused code for extra package templates 2019-03-11 00:43:41 +00:00
Ben Hutchings 96e3ed26a7 debian/bin/gencontrol.py: Add rules to build debian/build/config.*
It is no longer possible to run the "setup" rules without a compiler,
because Kconfig symbols can depend on compiler properties.  Add a way
to invoke just the first step of setup, which merges the kconfig files
and overrides together.
2019-03-05 19:11:48 +00:00
Ben Hutchings 09f2b8df70 gencontrol: Introduce and use arch/featureset/flavour iterator functions 2019-03-05 19:11:48 +00:00
Luca Boccassi 380ff19d50 Don't add linux-source to d/control when source: false
With the recent refactor, setting source: false in debian/config/defines
is no longer enough to disable the linux-source-$ver package build, as
dh_listpackages is used to determine what is built.
Do not add linux-source-$ver to d/control if it is disabled.
2019-01-18 20:57:32 +00:00
Ben Hutchings 80c2596a7c Add pkg.linux.nokernel build profile that excludes kernel image/header packages
This should mostly be useful for testing changes that only affect
the userland packages.
2019-01-01 19:27:10 +00:00
Ben Hutchings fdd6dadb4a Use dh_listpackages to determine which packages to build
The packages we should build are restricted by:

* Package configuration in debian/config (limits which binary packages are
  included in debian/control)
* Architecture (specified per package in debian/templates/control.* and
  then in debian/control)
* Build profile (specified per package in debian/templates/control.* and
  then in debian/control)

The logic for these restrictions is currently repeated in
debian/rules.real, but sometimes it becomes inconsistent with
debian/control (as with my recent changes for libbpf).

dh_listpackages reads debian/control and filters it by the current
host architecture and build profiles, so that it reliably reports
which packages we should build.

Therefore:

* Replace the logic in debian/rules.real with checks for package names
  in the output of dh_listpackages
* Remove the redundant flag variables passed by debian/rules and
  debian/rules.gen
* Remove the special-casing of stage1 in debian/rules and
  debian/rules.gen
2019-01-01 18:29:56 +00:00
Ben Hutchings f8450c79c8 Fix pycodestyle "inalid escape sequence" warnings 2018-12-28 15:35:50 +00:00
Ben Hutchings a54c09f109 Fix pycodestyle "line break after binary operator" warnings 2018-12-28 15:35:38 +00:00
Ben Hutchings be3a9537f5 Move generation of CONFIG_BUILD_SALT to gencontrol.py
CONFIG_DEBUG_INFO and CONFIG_MODULE_SIG are added in gencontrol.py,
so be consistent with that.

This unfortunately requires some ugly escaping of quotes.
2018-10-14 21:37:57 +01:00
Ben Hutchings 3fedd6e488 debian/bin/gencontrol.py: Delete code that enumerates Debian revisions
Gencontrol.parse_changelog() makes a list of all Debian versions with
the same upstream version, but doesn't use it.  This is left over from
the old multiple-series patch system which was removed in 2012.
2018-10-03 01:28:18 +01:00
Ben Hutchings 91fad79906 Add Python static checks and unit tests to autopkgtest tests 2018-10-01 23:10:03 +01:00
Ben Hutchings 5ac818997a debian/bin/gencontrol.py, debian/templates: Rename tests/control template
The current template is for running selftests against a kernel image,
so s/main/image/.
2018-10-01 23:09:51 +01:00
Ben Hutchings 8cafaf07ae debian/bin, debian/lib/python: Delete write-only vars reported by pyflakes 2018-10-01 21:50:59 +01:00
Ben Hutchings 169ec06045 debian/bin, debian/lib/python: Clean up imports based on pyflakes report
- Add explicit imports for all needed modules, rather than indirectly
  (accidentally!) importing them with "from ... import *"
- Replace all "from ... import *" statements, which inhibit static
  checking, with explicit lists of names to import
- Delete the remaining unneeded imports reported by pyflakes
2018-10-01 21:45:55 +01:00
Ben Hutchings 9cfb948048 debian/bin, debian/rules.real: Add symlink to Python package directory instead of editing path
This fixes one of the remaining classes of pycodestyle errors.
2018-10-01 21:41:58 +01:00
Ben Hutchings af0098b10a debian/bin, debian/lib/python: Fix most errors reported by pycodestyle
Fix coding style violations reported by pycodestyle.  This is
mostly a matter of reformatting code, particularly to eliminate
over-long lines.  I also rename one variable ("l" is considered
visually ambiguous) and change a bare "except" to explicitly
catch all exceptions.

There are three types of error or warning remaining:

- debian/bin/...: E402 module level import not at top of file
  Scripts in debian/bin need to modify the import path before
  importing from debian/lib/python.
- E127 continuation line over-indented for visual indent
  This seems to be a false positive.  pycodestyle doesn't seem to be
  happy with any level of indent (including 0) on a continuation line
  in a "with" statement.
- debian/lib/python/debian_linux/debian.py:15:2: W291 trailing whitespace
  This is a false positive.  The trailing spaces are in a long
  string and are intentional.
2018-10-01 21:41:23 +01:00
Ben Hutchings cbebd8c763 udeb: Merge configuration directories and files across architectures
Merge the configuration and default-configuration directories,
using per-architecture overrides in package-list.

This requires a newer version of kernel-wedge to support
Depends_<arch> properly.

The only immediate change to debian/control is to remove the
different description for nic-modules on sparc64.
2018-09-03 18:01:21 +01:00
Ben Hutchings 6033fc28e8 debian/bin: Change "#!/usr/bin/env python3" to "#!/usr/bin/python3" 2018-08-25 23:19:09 +01:00
Ben Hutchings a14e37b110 Move config files from linux-source to an arch-dependent linux-config package
In Linux 4.18, various compiler version and feature tests are invoked
via kconfig rather than via kbuild.  This means that we generally
cannot generate kconfig files for foreign architectures.

Move the config files to a new linux-config-<version> package which is
arch-dependent (and also M-A: same).

Make linux-config-<version> and linux-source-<version> recommend each
other.
2018-07-03 15:12:33 +01:00
Ben Hutchings ae6ef24f0d Fix linux-{doc,manual,source,support} package names in rules.real
I only fixed the control file before.

(cherry picked from commit 146c11a13da5643966cd6d07f437b183dc34a19e)
2018-07-02 00:08:22 +01:00
Ben Hutchings 3ff18afde5 debian/bin/gencontrol.py: Remove check for old [packages]tools config field
This was split into tools-versioned and tools-unversioned.
2018-06-26 22:27:55 +01:00
Luca Boccassi b3be450737 Add build profile and config/defines for disabling linux-source
Add a new "pkg.linux.nosource" to let users disable building the
linux-source-* package, and allow to set "source: false" to modify
the default behaviour when no rofile is used.
When doing development builds this can save up to 15 minutes of build
time, especially on IO-strapped build workers.
2018-05-08 19:17:15 +01:00
Ben Hutchings 29c80ea278 Fix building only versioned tools packages
Modifying makeflags in do_main_makefile() only affects the
build-indep/binary-indep rules!
2018-05-08 16:59:02 +01:00
Ben Hutchings 114088708f Fix linux-doc, linux-manual, linux-source, linux-support package names
We don't want to include "-4.9" in them twice.  Add a "source_basename"
template variable that excludes any version suffix in the source package
name.

(cherry picked from commit f3c51efdd6e9d0ce32ee5a0f998fdcda930a715c)

For master, nothing is immediately broken without this.  Also we have
no longer build a linux-manual package.  Change the changelog text
accordingly.
2018-04-29 21:19:11 +01:00
Ben Hutchings 7b34ddf467 Add support for building only versioned tools packages
We already had support for disabling the tools build, used by
src:linux-grsec.  However in this case, where we're using a different
based version to src:linux, we do still need to build the versioned
tools packages (linux-kbuild-4.9 and linux-perf-4.9).  Split the
control template, config setting and rules accordingly.

(cherry picked from commit cb62c945f27ddee476631fa85c6aa67e50ed3bee)
2018-04-29 21:16:01 +01:00
Ben Hutchings f78b896b8b debian/lib/python/debian_linux/gencontrol.py: Allow uploads to *-security with a simple revision 2018-04-28 21:42:12 +01:00
Ben Hutchings 083ddaa564 Add support for compilers installed outside the default PATH
The obvious way to do this is to edit the PATH in .kernelvariables.
But this obvious way doesn't work due to a bug in make (#895835).

(cherry picked from commit 4c6213fbbbff44710dda2091a7b26e0f0ea0a610)
2018-04-16 23:15:33 +01:00
Ben Hutchings 3b3e6ad4cb Use a dummy build profile for udebs that we test-build before signing
debhelper no longer fully trusts the package list specified with -p,
but only processes packages that are listed in debian/control and
enabled in the current build profile.  This breaks the test build of
udebs that we build for real after code signing.

Work around this by adding the udebs to the control file, conditional
on a new build profile (pkg.linux.udeb-unsigned-test-build).  Override
the build profile during the test build.
2018-04-08 10:31:20 +02:00
Ben Hutchings be394a26da Add template source package to support code signing 2018-04-08 10:31:20 +02:00
Ben Hutchings a25eb38372 debian/config: Rename [build]signed-modules setting to signed-code
This setting controls code signing in general, not just modules.
2018-04-08 10:30:49 +02:00
Ben Hutchings 2629671100 debian/bin/gencontrol.py: Set encoding to UTF-8 globally
I just made this change for firmware-nonfree, for which I wrote:

    We open some, but not all, files with an explicit UTF-8 encoding.  One
    of the open calls that I missed has just caused gencontrol.py to fail
    instead a pbuilder environment.  Instead of continuing to set an
    explicit encoding for each open call, use locale.setlocale to set it
    globally.

I haven't hit such a problem here, but let's do it anyway.

Keep using explicit encodings in debian/lib for now, since we can't
assume all calling programs will set the locale.
2017-10-20 02:56:35 +01:00
Ben Hutchings 9fe724d67d linux-image-dbg: Override lintian errors for vDSOs
It currently reports errors binary-from-other-architecture and
shlib-without-PT_GNU_STACK-section, which are false positives.
2017-10-01 15:23:01 +01:00
Ben Hutchings a1b309111a Rename lintian-overrides template files to be consistent 2017-10-01 01:36:27 +01:00
Ben Hutchings 06c36b3662 debian/control: Move many build dependencies to Build-Depends-Arch field 2017-09-30 14:09:54 +01:00
Roger Shimizu 8d9993070b buildcheck.py: Add check for uncompressed Image size
Currently only armel/marvell flavour need this check
2017-09-02 00:30:02 +09:00
Ben Hutchings b4b1be4c52 Move debug symbols back to the main archive
dak currently allows a binary upload to include debug symbol packages
that don't appear in the overrides file or the Binary field of the
changes file, so long as they have the appropriate
'Auto-Built-Package' field and their name matches another binary
package in the upload plus the '-dbgsym' suffix.

For architectures with code signing enabled, our binary uploads never
match this condition as the corresponding binary package has the
'-unsigned' suffix and the debug symbols package does not.  Since we
do list the debug symbol packages in the Binary field, they do get
added to the overrides file when accepted through the NEW queue, but
they are automatically pruned from there some time later.  Later
uploads then have to go through NEW even though they are not
introducing new binary packages.  This would be a big problem for
stable security updates.

For now, move debug symbols back to the main archive with the old
'-dbg' suffix.  Keep them enabled for all architectures.
2017-04-16 18:53:35 +01:00
Ben Hutchings 97dc926bb7 Revert "Remove debug symbol packages from debian/control to work around dak bug"
This reverts commit 99d37f9b16, which
caused most binary uploads to be rejected.  dak's allows upload of
debug symbol packages not listed in the Binary field only if there is
a corresponding binary package without the -dbgsym suffix, which is
not the case on architectures where we use a -unsigned suffix.
2017-01-12 15:44:11 +00:00
Ben Hutchings 99d37f9b16 Remove debug symbol packages from debian/control to work around dak bug
Any packages listed in debian/control that are not installed in the
main archive will always be seen as NEW.  This might be fixable by
archive configuration changes, but for now we'll generate them in a
similar way to debhelper.
2017-01-07 21:48:47 +00:00
Ben Hutchings aa27137298 [amd64] Remove xen-linux-system-<version> package
Since there are no amd64 kernel configurations without Xen dom0
support, these meta-packages don't provide much value any more.
2016-12-04 16:21:18 +00:00
Ben Hutchings eeb496a241 linux-headers-common: Make these packages architecture-independent
Include headers for all architectures that we build a kernel for.
This allows co-installation of per-flavour header packages for
multiple Debian architectures, and fixes the problem of arm64 headers
depending on arm headers that we did not include.
2016-12-01 20:08:30 +00:00
Ben Hutchings be7e4761f8 debian/bin/gencontrol.py: Fix cross-build-dependencies if invoked under dpkg-buildpackage
By default dpkg-architecture lets the current environment override the
architecture specified by the -a option.  We mustn't let that happen
here as we are considering all architectures.  Use the -f option to
force use of our specified architecture.
2016-09-26 22:31:21 +01:00
Ben Hutchings 6d39ffde84 Change names and descriptions of debug symbol packages to match debhelper 2016-07-14 11:42:15 +01:00
Ben Hutchings 0aceb8739a debian/control: Fix build-dependencies for cross-building
The current cross-compiler packages don't set the Multi-Arch field, so
specify that the cross-compiler package must be native, rather than any
architecture.

flex doesn't support multi-arch, and this would require splitting it
(#611230, #761449).  Force use of the native package for now.

openssl doesn't support multi-arch but probably easily could (#827028).
Force use of the native package for now.

We need the native libssl-dev while building the kernel itself and the
host libssl-dev while building tools for linux-kbuild.

Document the state of cross-building in README.source.
2016-06-13 02:02:54 +01:00
Ben Hutchings 72f58e83ea linux-image: Add '-unsigned' suffix to packages with modules that will later be signed 2016-06-10 14:47:47 +01:00
Ben Hutchings 5a1dc12690 udeb: Drop packages for modules that will later be signed
These packages will be taken over by src:linux-signed.  Still do
everything but building the packages so we find configuration
errors before building linux-signed.
2016-06-10 02:54:44 +01:00
Ben Hutchings fb5d796272 Move merge_packages function from debian/bin/gencontrol.py to gencontrol module
linux-signed will use this function in future.
2016-06-08 23:24:07 +01:00