diff --git a/debian/bin/buildcheck.py b/debian/bin/buildcheck.py index 159593560..dbe5cb817 100755 --- a/debian/bin/buildcheck.py +++ b/debian/bin/buildcheck.py @@ -4,6 +4,7 @@ import sys sys.path.append('debian/lib/python') import fnmatch +import glob import stat from debian_linux.abi import Symbols @@ -174,6 +175,7 @@ class CheckImage(object): self.dir = dir self.arch, self.featureset, self.flavour = arch, featureset, flavour + self.config_entry_base = config.merge('base', arch, featureset, flavour) self.config_entry_build = config.merge('build', arch, featureset, flavour) self.config_entry_image = config.merge('image', arch, featureset, flavour) @@ -198,7 +200,15 @@ class CheckImage(object): if not value: return 0 - size = os.stat(image)[stat.ST_SIZE] + dtb_size = 0 + if self.config_entry_image.get('check-size-with-dtb'): + for dtb in glob.glob( + os.path.join(self.dir, 'arch', + self.config_entry_base['kernel-arch'], + 'boot/dts/*.dtb')): + dtb_size = max(dtb_size, os.stat(dtb).st_size) + + size = os.stat(image).st_size + dtb_size if size > value: out.write('Image too large (%d > %d)! Refusing to continue.\n' % (size, value)) diff --git a/debian/bin/gencontrol.py b/debian/bin/gencontrol.py index 9d39e7a1b..df2f132b1 100755 --- a/debian/bin/gencontrol.py +++ b/debian/bin/gencontrol.py @@ -34,6 +34,7 @@ class Gencontrol(Base): 'configs': config.SchemaItemList(), 'initramfs-generators': config.SchemaItemList(), 'check-size': config.SchemaItemInteger(), + 'check-size-with-dtb': config.SchemaItemBoolean(), }, 'relations': { }, diff --git a/debian/changelog b/debian/changelog index e74705843..a698e1281 100644 --- a/debian/changelog +++ b/debian/changelog @@ -52,6 +52,7 @@ linux (3.18-1~exp1) UNRELEASED; urgency=medium - [/orion5x] SCSI: Disable SCSI_UFSHCD - [/orion5x] target: Disable TCM_IBLOCK - [/orion5x] Disable AUDIT, DEBUG_BUGVERBOSE, PROFILING, OPROFILE + * [armel] Include size of appended DTBs in image size check -- Ben Hutchings Tue, 09 Dec 2014 02:08:47 +0000 diff --git a/debian/config/armel/defines b/debian/config/armel/defines index 56812cbae..c044461f4 100644 --- a/debian/config/armel/defines +++ b/debian/config/armel/defines @@ -27,6 +27,7 @@ recommends: uboot-mkimage # SheevaPlug: 4194304 - 8 - 64 = 4194232 # QNAP TS-119/TS-219: 2097152 - 8 - 64 = 2097080 check-size: 2097080 +check-size-with-dtb: true [orion5x_description] hardware: Marvell Orion @@ -38,6 +39,7 @@ recommends: uboot-mkimage # HP Media Vault mv2120: ca 2 MB # QNAP TS-109/TS-209 & TS-409: 2097152 - 8 - 64 = 2097080 check-size: 1572792 +check-size-with-dtb: true configs: armel/config-reduced armel/config.orion5x