Merge install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain_image rules

The filename of the kernel image to be installed, and the stem of the
installed name, varies between architectures, so we define several
different rules to install it for different sets of architectures.
However the basic fact that we need to install this file in /boot does
not.

We also duplicate this name information in gencontrol.py and in
debian/config/{armel,armhf,sh4}/defines (used by buildcheck.py).

To address this:

* Define [image]install-stem and [build]image-file for each architecture
* Copy these settings to make-flags in gencontrol.py
* Copy [image]install-stem to the image-stem template variable in
  gencontrol.py
* Replace the per-architecture rules with a single rule using those
  make-flags

The per-architecture rules for ARM and PowerPC also installed DTB
and DTS files, respectively.  Include those commands in the single
rule with appropriate conditions around them.


svn path=/dists/trunk/linux/; revision=21253
This commit is contained in:
Ben Hutchings 2014-04-21 01:28:25 +00:00
parent 9b217501df
commit d37c253865
20 changed files with 78 additions and 45 deletions

View File

@ -118,11 +118,6 @@ class Gencontrol(Base):
def do_arch_setup(self, vars, makeflags, arch, extra):
config_base = self.config.merge('base', arch)
if config_base['kernel-arch'] in ['mips', 'parisc', 'powerpc']:
vars['image-stem'] = 'vmlinux'
else:
vars['image-stem'] = 'vmlinuz'
self._setup_makeflags(self.arch_makeflags, makeflags, config_base)
def do_arch_packages(self, packages, makefile, arch, vars, makeflags, extra):
@ -223,8 +218,13 @@ class Gencontrol(Base):
('override-host-type', 'OVERRIDE_HOST_TYPE', True),
)
flavour_makeflags_build = (
('image-file', 'IMAGE_FILE', True),
)
flavour_makeflags_image = (
('type', 'TYPE', False),
('install-stem', 'IMAGE_INSTALL_STEM', True),
)
flavour_makeflags_other = (
@ -234,6 +234,7 @@ class Gencontrol(Base):
def do_flavour_setup(self, vars, makeflags, arch, featureset, flavour, extra):
config_base = self.config.merge('base', arch, featureset, flavour)
config_build = self.config.merge('build', arch, featureset, flavour)
config_description = self.config.merge('description', arch, featureset, flavour)
config_image = self.config.merge('image', arch, featureset, flavour)
@ -245,8 +246,10 @@ class Gencontrol(Base):
if override_localversion is not None:
vars['localversion-image'] = vars['localversion_headers'] + '-' + override_localversion
vars['initramfs'] = 'YES' if config_image.get('initramfs', True) else ''
vars['image-stem'] = config_image.get('install-stem')
self._setup_makeflags(self.flavour_makeflags_base, makeflags, config_base)
self._setup_makeflags(self.flavour_makeflags_build, makeflags, config_build)
self._setup_makeflags(self.flavour_makeflags_image, makeflags, config_image)
self._setup_makeflags(self.flavour_makeflags_other, makeflags, vars)

View File

@ -2,8 +2,12 @@
flavours: alpha-generic alpha-smp alpha-legacy
kernel-arch: alpha
[build]
image-file: arch/alpha/boot/vmlinux.gz
[image]
suggests: aboot, fdutils
install-stem: vmlinuz
[alpha-generic_description]
hardware: Alpha

View File

@ -6,10 +6,12 @@ kernel-arch: x86
[build]
debug-info: true
image-file: arch/x86/boot/bzImage
[image]
bootloaders: grub-pc extlinux lilo
configs:
install-stem: vmlinuz
[relations]
headers%gcc-4.8: linux-compiler-gcc-4.8-x86

View File

@ -15,6 +15,7 @@ suggests: fdutils
configs:
kernelarch-arm/config
armel/config
install-stem: vmlinuz
[relations]
headers%gcc-4.8: linux-compiler-gcc-4.8-arm

View File

@ -12,6 +12,7 @@ suggests: fdutils
configs:
kernelarch-arm/config
armhf/config
install-stem: vmlinuz
[relations]
headers%gcc-4.8: linux-compiler-gcc-4.8-arm

View File

@ -2,8 +2,12 @@
flavours: parisc parisc64-smp
kernel-arch: parisc
[build]
image-file: vmlinux
[image]
suggests: palo
install-stem: vmlinux
[parisc_description]
hardware: 32-bit PA-RISC

View File

@ -4,6 +4,9 @@ featuresets:
rt
kernel-arch: x86
[build]
image-file: arch/x86/boot/bzImage
[description]
part-long-pae: This kernel requires PAE (Physical Address Extension).
This feature is supported by the Intel Pentium Pro/II/III/4/4M/D, Xeon,
@ -13,6 +16,7 @@ part-long-pae: This kernel requires PAE (Physical Address Extension).
[image]
bootloaders: grub-pc extlinux lilo
configs:
install-stem: vmlinuz
[relations]
headers%gcc-4.8: linux-compiler-gcc-4.8-x86

View File

@ -5,9 +5,13 @@ flavours:
kernel-arch: ia64
compiler: gcc-4.6
[build]
image-file: vmlinux.gz
[image]
bootloaders: elilo
suggests: fdutils
install-stem: vmlinuz
[itanium_description]
hardware: Itanium

View File

@ -5,8 +5,12 @@ flavours:
m68k
kernel-arch: m68k
[build]
image-file: vmlinux.gz
[image]
suggests: vmelilo, fdutils
install-stem: vmlinuz
[m68k_description]
hardware: Motorola MC68020+ family

View File

@ -9,8 +9,12 @@ flavours:
octeon
kernel-arch: mips
[build]
image-file: vmlinux
[image]
initramfs: false
install-stem: vmlinux
[r4k-ip22_description]
hardware: SGI IP22

View File

@ -8,8 +8,12 @@ flavours:
loongson-2f
kernel-arch: mips
[build]
image-file: vmlinux
[image]
initramfs: false
install-stem: vmlinux
[sb1-bcm91250a_description]
hardware: BCM91250A

View File

@ -5,8 +5,12 @@ flavours:
powerpc64
kernel-arch: powerpc
[build]
image-file: vmlinux
[image]
suggests: mkvmlinuz
install-stem: vmlinux
[powerpc_description]
hardware: uniprocessor 32-bit PowerPC

View File

@ -3,9 +3,13 @@ flavours:
powerpcspe
kernel-arch: powerpc
[build]
image-file: vmlinux
[image]
suggests: mkvmlinuz
configs: powerpc/config powerpcspe/config.powerpcspe
install-stem: vmlinux
[description]
hardware: 32-bit PowerPC with SPE (instead of AltiVec) with SMP support

View File

@ -3,9 +3,13 @@ flavours:
powerpc64
kernel-arch: powerpc
[build]
image-file: vmlinux
[image]
configs: powerpc/config
suggests: mkvmlinuz
install-stem: vmlinux
[powerpc64_description]
hardware: 64-bit PowerPC

View File

@ -3,9 +3,13 @@ flavours:
s390x
kernel-arch: s390
[build]
image-file: arch/s390/boot/image
[image]
bootloaders: s390-tools
configs: s390x/config
install-stem: vmlinuz
[relations]
headers%gcc-4.8: linux-compiler-gcc-4.8-s390

View File

@ -3,8 +3,12 @@ flavours:
s390x
kernel-arch: s390
[build]
image-file: arch/s390/boot/image
[image]
bootloaders: s390-tools
install-stem: vmlinuz
[relations]
headers%gcc-4.8: linux-compiler-gcc-4.8-s390

View File

@ -10,6 +10,7 @@ image-file: arch/sh/boot/zImage
[image]
suggests: fdutils
install-stem: vmlinuz
[sh7751r_description]
hardware: sh7751r

View File

@ -4,8 +4,12 @@ flavours:
sparc64-smp
kernel-arch: sparc
[build]
image-file: arch/sparc/boot/zImage
[image]
suggests: silo, fdutils
install-stem: vmlinuz
[sparc32_description]
hardware: uniprocessor sparc32 (sun4m)

View File

@ -4,9 +4,13 @@ flavours:
sparc64-smp
kernel-arch: sparc
[build]
image-file: arch/sparc/boot/zImage
[image]
configs: sparc/config
suggests: silo, fdutils
install-stem: vmlinuz
[sparc64_description]
hardware: uniprocessor 64-bit UltraSPARC

49
debian/rules.real vendored
View File

@ -370,52 +370,21 @@ endif
PACKAGE_DIR='$(PACKAGE_DIR)' PACKAGE_NAME='$(PACKAGE_NAME)' REAL_VERSION='$(REAL_VERSION)'
+$(MAKE_SELF) install-base
install-image_sparc_$(FEATURESET)_$(FLAVOUR)_plain_image \
install-image_sparc64_$(FEATURESET)_$(FLAVOUR)_plain_image \
install-image_sh4_$(FEATURESET)_$(FLAVOUR)_plain_image:
install -m644 '$(DIR)/arch/$(KERNEL_ARCH)/boot/zImage' $(INSTALL_DIR)/vmlinuz-$(REAL_VERSION)
ifneq ($(filter armel armhf,$(ARCH)),)
install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain_image: DTB_INSTALL_DIR = /usr/lib/linux-image-$(REAL_VERSION)
install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain_image: DT_INSTALL_DIR = $(PACKAGE_DIR)/usr/lib/linux-image-$(REAL_VERSION)
install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain_image:
install -m644 '$(DIR)/arch/$(KERNEL_ARCH)/boot/zImage' $(INSTALL_DIR)/vmlinuz-$(REAL_VERSION)
install -m644 '$(DIR)/$(IMAGE_FILE)' $(INSTALL_DIR)/$(IMAGE_INSTALL_STEM)-$(REAL_VERSION)
ifneq ($(filter armel armhf,$(ARCH)),)
+$(MAKE_CLEAN) -C $(DIR) dtbs
shopt -s nullglob ; for i in $(DIR)/arch/arm/boot/dts/*.dtb ; do \
install -D -m644 $$i '$(PACKAGE_DIR)'/'$(DTB_INSTALL_DIR)'/$$(basename $$i) ; \
install -D -m644 $$i '$(DT_INSTALL_DIR)'/$$(basename $$i) ; \
done
endif
install-image_amd64_$(FEATURESET)_$(FLAVOUR)_plain_image \
install-image_i386_$(FEATURESET)_$(FLAVOUR)_plain_image:
install -m644 '$(DIR)/arch/$(KERNEL_ARCH)/boot/bzImage' $(INSTALL_DIR)/vmlinuz-$(REAL_VERSION)
install-image_alpha_$(FEATURESET)_$(FLAVOUR)_plain_image:
install -m644 '$(DIR)/arch/$(KERNEL_ARCH)/boot/vmlinux.gz' $(INSTALL_DIR)/vmlinuz-$(REAL_VERSION)
install-image_ia64_$(FEATURESET)_$(FLAVOUR)_plain_image \
install-image_m68k_$(FEATURESET)_$(FLAVOUR)_plain_image:
install -m644 '$(DIR)/vmlinux.gz' $(INSTALL_DIR)/vmlinuz-$(REAL_VERSION)
install-image_hppa_$(FEATURESET)_$(FLAVOUR)_plain_image \
install-image_mips_$(FEATURESET)_$(FLAVOUR)_plain_image \
install-image_mipsel_$(FEATURESET)_$(FLAVOUR)_plain_image:
install -m644 '$(DIR)/vmlinux' $(INSTALL_DIR)/vmlinux-$(REAL_VERSION)
install-image_powerpc_$(FEATURESET)_$(FLAVOUR)_plain_image: WRAPPER_INSTALL_DIR = '$(CURDIR)'/$(PACKAGE_DIR)/usr/lib/linux-image-$(REAL_VERSION)
install-image_powerpcspe_$(FEATURESET)_$(FLAVOUR)_plain_image: WRAPPER_INSTALL_DIR = '$(CURDIR)'/$(PACKAGE_DIR)/usr/lib/linux-image-$(REAL_VERSION)
install-image_ppc64_$(FEATURESET)_$(FLAVOUR)_plain_image: WRAPPER_INSTALL_DIR = '$(CURDIR)'/$(PACKAGE_DIR)/usr/lib/linux-image-$(REAL_VERSION)
install-image_powerpc_$(FEATURESET)_$(FLAVOUR)_plain_image \
install-image_powerpcspe_$(FEATURESET)_$(FLAVOUR)_plain_image \
install-image_ppc64_$(FEATURESET)_$(FLAVOUR)_plain_image:
install -m644 '$(DIR)/vmlinux' $(INSTALL_DIR)/vmlinux-$(REAL_VERSION)
ifneq ($(filter powerpc powerpcspe ppc64,$(ARCH)),)
+$(MAKE_CLEAN) -C '$(DIR)' bootwrapper_install \
WRAPPER_OBJDIR='$(WRAPPER_INSTALL_DIR)' \
WRAPPER_DTSDIR='$(WRAPPER_INSTALL_DIR)'/dts \
WRAPPER_BINDIR='$(WRAPPER_INSTALL_DIR)'
install-image_s390_$(FEATURESET)_$(FLAVOUR)_plain_image \
install-image_s390x_$(FEATURESET)_$(FLAVOUR)_plain_image:
install -m644 '$(DIR)/arch/s390/boot/image' $(INSTALL_DIR)/vmlinuz-$(REAL_VERSION)
WRAPPER_OBJDIR='$(CURDIR)/$(DT_INSTALL_DIR)' \
WRAPPER_DTSDIR='$(CURDIR)/$(DT_INSTALL_DIR)'/dts \
WRAPPER_BINDIR='$(CURDIR)/$(DT_INSTALL_DIR)'
endif
install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain_bug:
dh_installdirs usr/share/bug/$(PACKAGE_NAME)