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.
This commit is contained in:
Ben Hutchings 2018-09-01 17:18:20 +01:00
parent 5ad4d97be9
commit cbebd8c763
931 changed files with 250 additions and 454 deletions

View File

@ -86,6 +86,62 @@ class Gencontrol(Base):
# Prepare to generate debian/tests/control
self.tests_control = None
self.installer_packages = {}
if os.getenv('DEBIAN_KERNEL_DISABLE_INSTALLER'):
if self.changelog[0].distribution == 'UNRELEASED':
import warnings
warnings.warn('Disable installer modules on request (DEBIAN_KERNEL_DISABLE_INSTALLER set)')
else:
raise RuntimeError('Unable to disable installer modules in release build (DEBIAN_KERNEL_DISABLE_INSTALLER set)')
elif self.config.merge('packages').get('installer', True):
# Add udebs using kernel-wedge
kw_env = os.environ.copy()
kw_env['KW_DEFCONFIG_DIR'] = 'debian/installer'
kw_env['KW_CONFIG_DIR'] = 'debian/installer'
kw_proc = subprocess.Popen(
['kernel-wedge', 'gen-control', vars['abiname']],
stdout=subprocess.PIPE,
env=kw_env)
if not isinstance(kw_proc.stdout, io.IOBase):
udeb_packages = read_control(io.open(kw_proc.stdout.fileno(), closefd=False))
else:
udeb_packages = read_control(io.TextIOWrapper(kw_proc.stdout))
kw_proc.wait()
if kw_proc.returncode != 0:
raise RuntimeError('kernel-wedge exited with code %d' %
kw_proc.returncode)
# All architectures that have some installer udebs
arches = set()
for package in udeb_packages:
arches.update(package['Architecture'])
# Code-signing status for those architectures
# If we're going to build signed udebs later, don't actually
# generate udebs. Just test that we *can* build, so we find
# configuration errors before building linux-signed.
build_signed = {}
for arch in arches:
build_signed[arch] = (self.config.merge('build', arch)
.get('signed-code', False))
for package in udeb_packages:
# kernel-wedge currently chokes on Build-Profiles so add it now
if any(build_signed[arch] for arch in package['Architecture']):
assert all(build_signed[arch]
for arch in package['Architecture'])
# XXX This is a hack to exclude the udebs from
# the package list while still being able to
# convince debhelper and kernel-wedge to go
# part way to building them.
package['Build-Profiles'] = '<pkg.linux.udeb-unsigned-test-build>'
else:
package['Build-Profiles'] = '<!stage1>'
for arch in package['Architecture']:
self.installer_packages.setdefault(arch, []).append(package)
def do_main_makefile(self, makefile, makeflags, extra):
fs_enabled = [featureset
for featureset in self.config['base', ]['featuresets']
@ -220,54 +276,13 @@ class Gencontrol(Base):
["$(MAKE) -f debian/rules.real install-libc-dev_%s %s" %
(arch, makeflags)])
if os.getenv('DEBIAN_KERNEL_DISABLE_INSTALLER'):
if self.changelog[0].distribution == 'UNRELEASED':
import warnings
warnings.warn('Disable installer modules on request (DEBIAN_KERNEL_DISABLE_INSTALLER set)')
else:
raise RuntimeError('Unable to disable installer modules in release build (DEBIAN_KERNEL_DISABLE_INSTALLER set)')
elif self.config.merge('packages').get('installer', True):
# Add udebs using kernel-wedge
installer_def_dir = 'debian/installer'
installer_arch_dir = os.path.join(installer_def_dir, arch)
if os.path.isdir(installer_arch_dir):
kw_env = os.environ.copy()
kw_env['KW_DEFCONFIG_DIR'] = installer_def_dir
kw_env['KW_CONFIG_DIR'] = installer_arch_dir
kw_proc = subprocess.Popen(
['kernel-wedge', 'gen-control', vars['abiname']],
stdout=subprocess.PIPE,
env=kw_env)
if not isinstance(kw_proc.stdout, io.IOBase):
udeb_packages = read_control(io.open(kw_proc.stdout.fileno(), closefd=False))
else:
udeb_packages = read_control(io.TextIOWrapper(kw_proc.stdout))
kw_proc.wait()
if kw_proc.returncode != 0:
raise RuntimeError('kernel-wedge exited with code %d' %
kw_proc.returncode)
# If we're going to build signed udebs later, don't actually
# generate udebs. Just test that we *can* build, so we find
# configuration errors before building linux-signed.
# kernel-wedge currently chokes on Build-Profiles so add it now
for package in udeb_packages:
if build_signed:
# XXX This is a hack to exclude the udebs from
# the package list while still being able to
# convince debhelper and kernel-wedge to go
# part way to building them.
package['Build-Profiles'] = '<pkg.linux.udeb-unsigned-test-build>'
else:
package['Build-Profiles'] = '<!stage1>'
udeb_packages = self.installer_packages.get(arch, [])
if udeb_packages:
merge_packages(packages, udeb_packages, arch)
# These packages must be built after the per-flavour/
# per-featureset packages. Also, this won't work
# correctly with an empty package list.
if udeb_packages:
makefile.add(
'binary-arch_%s' % arch,
cmds=["$(MAKE) -f debian/rules.real install-udeb_%s %s "

View File

@ -54,6 +54,37 @@ class Gencontrol(Base):
'-v%(imagebinaryversion)s -DBuilt-Using="linux (= %(imagesourceversion)s)"' % vars)
makeflags['PACKAGE_VERSION'] = vars['imagebinaryversion']
self.installer_packages = {}
if os.getenv('DEBIAN_KERNEL_DISABLE_INSTALLER'):
if self.changelog[0].distribution == 'UNRELEASED':
import warnings
warnings.warn('Disable installer modules on request (DEBIAN_KERNEL_DISABLE_INSTALLER set)')
else:
raise RuntimeError('Unable to disable installer modules in release build (DEBIAN_KERNEL_DISABLE_INSTALLER set)')
elif self.config.merge('packages').get('installer', True):
# Add udebs using kernel-wedge
kw_env = os.environ.copy()
kw_env['KW_DEFCONFIG_DIR'] = 'debian/installer'
kw_env['KW_CONFIG_DIR'] = 'debian/installer'
kw_proc = subprocess.Popen(
['kernel-wedge', 'gen-control', vars['abiname']],
stdout=subprocess.PIPE,
env=kw_env)
if not isinstance(kw_proc.stdout, io.IOBase):
udeb_packages = read_control(io.open(kw_proc.stdout.fileno(), closefd=False))
else:
udeb_packages = read_control(io.TextIOWrapper(kw_proc.stdout))
kw_proc.wait()
if kw_proc.returncode != 0:
raise RuntimeError('kernel-wedge exited with code %d' %
kw_proc.returncode)
for package in udeb_packages:
for arch in package['Architecture']:
if self.config.merge('build', arch).get('signed-code', False):
self.installer_packages.setdefault(arch, []).append(package)
def do_main_packages(self, packages, vars, makeflags, extra):
# Assume that arch:all packages do not get binNMU'd
packages['source']['Build-Depends'].append(
@ -77,34 +108,8 @@ class Gencontrol(Base):
self.config['version', ]['abiname_base'] + abiname_part
def do_arch_packages(self, packages, makefile, arch, vars, makeflags, extra):
if os.getenv('DEBIAN_KERNEL_DISABLE_INSTALLER'):
if self.changelog[0].distribution == 'UNRELEASED':
import warnings
warnings.warn('Disable installer modules on request (DEBIAN_KERNEL_DISABLE_INSTALLER set)')
else:
raise RuntimeError('Unable to disable installer modules in release build (DEBIAN_KERNEL_DISABLE_INSTALLER set)')
elif (self.config.merge('packages').get('installer', True) and
self.config.merge('build', arch).get('signed-code', False)):
# Add udebs using kernel-wedge
installer_def_dir = 'debian/installer'
installer_arch_dir = os.path.join(installer_def_dir, arch)
if os.path.isdir(installer_arch_dir):
kw_env = os.environ.copy()
kw_env['KW_DEFCONFIG_DIR'] = installer_def_dir
kw_env['KW_CONFIG_DIR'] = installer_arch_dir
kw_proc = subprocess.Popen(
['kernel-wedge', 'gen-control', vars['abiname']],
stdout=subprocess.PIPE,
env=kw_env)
if not isinstance(kw_proc.stdout, io.IOBase):
udeb_packages = read_control(io.open(kw_proc.stdout.fileno(), closefd=False))
else:
udeb_packages = read_control(io.TextIOWrapper(kw_proc.stdout))
kw_proc.wait()
if kw_proc.returncode != 0:
raise RuntimeError('kernel-wedge exited with code %d' %
kw_proc.returncode)
udeb_packages = self.installer_packages.get(arch, [])
if udeb_packages:
merge_packages(packages, udeb_packages, arch)
# These packages must be built after the per-flavour/

1
debian/changelog vendored
View File

@ -9,6 +9,7 @@ linux (4.19~rc1-1~exp1) UNRELEASED; urgency=medium
* [hppa] debian/control: Simplify build-dependencies for 64-bit toolchain
* Compile with gcc-8 on all architectures
* [x86] Allow generating user-space headers without a compiler
* udeb: Merge configuration directories and files across architectures
-- Ben Hutchings <ben@decadent.org.uk> Mon, 27 Aug 2018 14:36:54 +0100

View File

@ -1,2 +0,0 @@
# arch version flavour installedname suffix build-depends
alpha - alpha-generic - y -

View File

@ -1,22 +0,0 @@
# This file is used to build up the control file. The kernel version and
# "-di" are appended to the package names. Section can be left out. So can
# architecture, which is derived from the files in the modules directory.
# It overwrites specifications from /usr/share/kernel-wedge/package-list.
#
Package: kernel-image
Package: usb-storage-modules
Depends: kernel-image, scsi-modules, usb-modules
Package: pata-modules
Depends: kernel-image, ata-modules, scsi-core-modules
Package: fb-modules
Depends: kernel-image, i2c-modules
Package: srm-modules
Depends: kernel-image
Priority: standard
Description: SRM modules
This package contains the srm_env module which provides access to the SRM
environment.

View File

@ -1,3 +0,0 @@
* The 2.6 kernel is missing a lot of modules, need to get a list of all
modules included in the udebs, and compare vs. the full module list and
add missing stuff.

View File

@ -1,2 +0,0 @@
# arch version flavour installedname suffix build-depends
amd64 - amd64 - - -

View File

@ -1,14 +0,0 @@
# This file is used to build up the control file. The kernel version and
# "-di" are appended to the package names. Section can be left out. So can
# architecture, which is derived from the files in the modules directory.
# It overwrites specifications from /usr/share/kernel-wedge/package-list.
#
Package: fat-modules
Priority: standard
Package: scsi-modules
Depends: kernel-image, scsi-core-modules, cdrom-core-modules, core-modules, ata-modules
Package: kernel-image
Provides: zlib-modules

View File

@ -1,2 +0,0 @@
# arch version flavour installedname suffix build-depends
arm64 - arm64 - - -

View File

@ -1,8 +0,0 @@
# This file is used to build up the control file. The kernel version and
# "-di" are appended to the package names. Section can be left out. So can
# architecture, which is derived from the files in the modules directory.
# It overwrites specifications from /usr/share/kernel-wedge/package-list.
#
Package: kernel-image
Provides: zlib-modules

View File

@ -1,2 +0,0 @@
# arch version flavour installedname suffix build-depends
armel - marvell - y -

View File

@ -1,14 +0,0 @@
# This file is used to build up the control file. The kernel version and
# "-di" are appended to the package names. Section can be left out. So can
# architecture, which is derived from the files in the modules directory.
# It overwrites specifications from /usr/share/kernel-wedge/package-list.
#
Package: kernel-image
Provides_marvell: rtc-modules
Provides_versatile: rtc-modules
Package: fb-modules
Depends: kernel-image, usb-modules
Package: jffs2-modules
Depends: kernel-image, zlib-modules, compress-modules, mtd-modules

View File

@ -1,2 +0,0 @@
# arch version flavour installedname suffix build-depends
armhf - armmp - - -

View File

@ -1,9 +0,0 @@
# This file is used to build up the control file. The kernel version and
# "-di" are appended to the package names. Section can be left out. So can
# architecture, which is derived from the files in the modules directory.
# It overwrites specifications from /usr/share/kernel-wedge/package-list.
#
Package: kernel-image
Package: pata-modules
Priority: optional

View File

@ -1,3 +0,0 @@
# arch version flavour installedname suffix build-depends
hppa - parisc - y -
hppa - parisc64-smp - y -

View File

@ -1,17 +0,0 @@
# This file is used to build up the control file. The kernel version and
# "-di" are appended to the package names. Section can be left out. So can
# architecture, which is derived from the files in the modules directory.
# It overwrites specifications from /usr/share/kernel-wedge/package-list.
#
Package: kernel-image
Provides_parisc64-smp: i2c-modules
Package: usb-storage-modules
Depends: kernel-image, scsi-modules, usb-modules
Package: pata-modules
Depends: kernel-image, ata-modules, scsi-core-modules
Package: fb-modules
Depends: kernel-image
Priority: standard

View File

@ -1,3 +0,0 @@
# arch version flavour installedname suffix build-depends
i386 - 686 - - -
i386 - 686-pae - - -

View File

@ -1,14 +0,0 @@
# This file is used to build up the control file. The kernel version and
# "-di" are appended to the package names. Section can be left out. So can
# architecture, which is derived from the files in the modules directory.
# It overwrites specifications from /usr/share/kernel-wedge/package-list.
#
Package: kernel-image
Provides: rtc-modules, zlib-modules
Package: fat-modules
Priority: standard
Package: fb-modules
Depends: kernel-image, i2c-modules

View File

@ -1,3 +0,0 @@
* The 2.6 kernel is missing a lot of modules, need to get a list of all
modules included in the udebs, and compare vs. the full module list and
add missing stuff.

View File

@ -1,2 +0,0 @@
# arch version flavour installedname suffix build-depends
ia64 - itanium - - -

View File

@ -1,34 +0,0 @@
# This file is used to build up the control file. The kernel version and
# "-di" are appended to the package names. Section can be left out. So can
# architecture, which is derived from the files in the modules directory.
# It overwrites specifications from /usr/share/kernel-wedge/package-list.
#
Package: fat-modules
Priority: standard
Package: ide-core-modules
Depends: kernel-image
Priority: standard
Description: IDE support
This package contains core IDE support for the kernel.
Package: ide-modules
Depends: kernel-image, ide-core-modules, sn-modules
Priority: standard
Description: IDE drivers
This package contains IDE drivers for the kernel.
Package: cdrom-core-modules
Depends: kernel-image, scsi-core-modules, ide-modules, isofs-modules
Package: serial-modules
Depends: kernel-image, pcmcia-modules, sn-modules
Package: sn-modules
Depends: kernel-image
Priority: extra
Description: SN modules
This package contains SN modules for Altix systems
Package: kernel-image
Provides: efi-modules, zlib-modules

34
debian/installer/kernel-versions vendored Normal file
View File

@ -0,0 +1,34 @@
# arch version flavour installedname suffix build-depends
alpha - alpha-generic - y -
amd64 - amd64 - - -
arm64 - arm64 - - -
armel - marvell - y -
armhf - armmp - - -
hppa - parisc - y -
hppa - parisc64-smp - y -
i386 - 686 - - -
i386 - 686-pae - - -
ia64 - itanium - - -
m68k - m68k - y -
mips - 4kc-malta - y -
mips - octeon - y -
mips64 - 5kc-malta - y -
mips64 - octeon - y -
mips64el - 5kc-malta - y -
mips64el - loongson-3 - y -
mips64el - octeon - y -
mips64r6 - mips64r6 - y -
mips64r6el - mips64r6el - y -
mipsel - 4kc-malta - y -
mipsel - loongson-3 - y -
mipsel - octeon - y -
mipsr6 - mips32r6 - y -
mipsr6el - mips32r6el - y -
powerpc - powerpc - - -
powerpc - powerpc64 - - -
ppc64 - powerpc64 - - -
ppc64el - powerpc64le - - -
s390x - s390x - - -
sh4 - sh7751r - y -
sh4 - sh7785lcr - y -
sparc64 - sparc64 - y -

View File

@ -1,2 +0,0 @@
# arch version flavour installedname suffix build-depends
m68k - m68k - y -

View File

@ -1,21 +0,0 @@
# This file is used to build up the control file. The kernel version and
# "-di" are appended to the package names. Section can be left out. So can
# architecture, which is derived from the files in the modules directory.
# It overwrites specifications from /usr/share/kernel-wedge/package-list.
#
Package: cdrom-core-modules
Depends: kernel-image, scsi-core-modules, ide-modules, isofs-modules
This package contains core CDROM support for the kernel.
Package: ide-core-modules
Depends: kernel-image
Priority: standard
Description: IDE support
This package contains core IDE support for the kernel.
Package: ide-modules
Depends: kernel-image, ide-core-modules
Priority: standard
Description: IDE drivers
This package contains IDE drivers for the kernel.

View File

@ -1,3 +0,0 @@
# arch version flavour installedname suffix build-depends
mips - 4kc-malta - y -
mips - octeon - y -

View File

@ -1,7 +0,0 @@
# This file is used to build up the control file. The kernel version and
# "-di" are appended to the package names. Section can be left out. So can
# architecture, which is derived from the files in the modules directory.
# It overwrites specifications from /usr/share/kernel-wedge/package-list.
#
Package: kernel-image
Provides: rtc-modules

View File

@ -1,3 +0,0 @@
# arch version flavour installedname suffix build-depends
mips64 - 5kc-malta - y -
mips64 - octeon - y -

View File

@ -1 +0,0 @@
../../mips/modules/mips

View File

@ -1 +0,0 @@
../../mips/modules/mips-4kc-malta

View File

@ -1 +0,0 @@
../../mips/modules/mips-octeon

View File

@ -1,7 +0,0 @@
# This file is used to build up the control file. The kernel version and
# "-di" are appended to the package names. Section can be left out. So can
# architecture, which is derived from the files in the modules directory.
# It overwrites specifications from /usr/share/kernel-wedge/package-list.
#
Package: kernel-image
Provides: rtc-modules

View File

@ -1,4 +0,0 @@
# arch version flavour installedname suffix build-depends
mips64el - 5kc-malta - y -
mips64el - loongson-3 - y -
mips64el - octeon - y -

View File

@ -1 +0,0 @@
../../mips/modules/mips-4kc-malta

View File

@ -1 +0,0 @@
../../mipsel/modules/mipsel-loongson-3

View File

@ -1 +0,0 @@
../../mips/modules/mips-octeon

View File

@ -1,8 +0,0 @@
# This file is used to build up the control file. The kernel version and
# "-di" are appended to the package names. Section can be left out. So can
# architecture, which is derived from the files in the modules directory.
# It overwrites specifications from /usr/share/kernel-wedge/package-list.
#
Package: kernel-image
Provides: rtc-modules
Provides_loongson-3: i2c-modules, rtc-modules

View File

@ -1,2 +0,0 @@
# arch version flavour installedname suffix build-depends
mips64r6 - mips64r6 - y -

View File

@ -1 +0,0 @@
../../mips/modules/mips

View File

@ -1,7 +0,0 @@
# This file is used to build up the control file. The kernel version and
# "-di" are appended to the package names. Section can be left out. So can
# architecture, which is derived from the files in the modules directory.
# It overwrites specifications from /usr/share/kernel-wedge/package-list.
#
Package: kernel-image
Provides: rtc-modules

View File

@ -1,2 +0,0 @@
# arch version flavour installedname suffix build-depends
mips64r6el - mips64r6el - y -

View File

@ -1 +0,0 @@
../../mips/modules/mips

View File

@ -1,7 +0,0 @@
# This file is used to build up the control file. The kernel version and
# "-di" are appended to the package names. Section can be left out. So can
# architecture, which is derived from the files in the modules directory.
# It overwrites specifications from /usr/share/kernel-wedge/package-list.
#
Package: kernel-image
Provides: rtc-modules

View File

@ -1,4 +0,0 @@
# arch version flavour installedname suffix build-depends
mipsel - 4kc-malta - y -
mipsel - loongson-3 - y -
mipsel - octeon - y -

View File

@ -1 +0,0 @@
../../mips/modules/mips-4kc-malta

View File

@ -1 +0,0 @@
../../mips/modules/mips-octeon

View File

@ -1,8 +0,0 @@
# This file is used to build up the control file. The kernel version and
# "-di" are appended to the package names. Section can be left out. So can
# architecture, which is derived from the files in the modules directory.
# It overwrites specifications from /usr/share/kernel-wedge/package-list.
#
Package: kernel-image
Provides: rtc-modules
Provides_loongson-3: i2c-modules, rtc-modules

View File

@ -1,2 +0,0 @@
# arch version flavour installedname suffix build-depends
mipsr6 - mips32r6 - y -

View File

@ -1 +0,0 @@
../../mips/modules/mips

View File

@ -1,7 +0,0 @@
# This file is used to build up the control file. The kernel version and
# "-di" are appended to the package names. Section can be left out. So can
# architecture, which is derived from the files in the modules directory.
# It overwrites specifications from /usr/share/kernel-wedge/package-list.
#
Package: kernel-image
Provides: rtc-modules

View File

@ -1,2 +0,0 @@
# arch version flavour installedname suffix build-depends
mipsr6el - mips32r6el - y -

View File

@ -1 +0,0 @@
../../mips/modules/mips

View File

@ -1,7 +0,0 @@
# This file is used to build up the control file. The kernel version and
# "-di" are appended to the package names. Section can be left out. So can
# architecture, which is derived from the files in the modules directory.
# It overwrites specifications from /usr/share/kernel-wedge/package-list.
#
Package: kernel-image
Provides: rtc-modules

Some files were not shown because too many files have changed in this diff Show More