[linux] 01/01: buildcheck.py: Add check for uncompressed Image size

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Fri Sep 1 15:30:57 UTC 2017


This is an automated email from the git hooks/post-receive script.

rosh-guest pushed a commit to branch master
in repository linux.

commit 8d9993070b4fb64673de37d0cae1e126da11e639
Author: Roger Shimizu <rogershimizu at gmail.com>
Date:   Sat Sep 2 00:30:02 2017 +0900

    buildcheck.py: Add check for uncompressed Image size
    
    Currently only armel/marvell flavour need this check
---
 debian/bin/buildcheck.py    | 26 ++++++++++++++++++++------
 debian/bin/gencontrol.py    |  1 +
 debian/changelog            |  9 +++++++++
 debian/config/armel/defines |  5 +++++
 4 files changed, 35 insertions(+), 6 deletions(-)

diff --git a/debian/bin/buildcheck.py b/debian/bin/buildcheck.py
index 5cd0d8a..6a50978 100755
--- a/debian/bin/buildcheck.py
+++ b/debian/bin/buildcheck.py
@@ -189,20 +189,23 @@ class CheckImage(object):
 
     def __call__(self, out):
         image = self.config_entry_build.get('image-file')
+        uncompressed_image = self.config_entry_build.get('uncompressed-image-file')
 
         if not image:
             # TODO: Bail out
             return 0
 
         image = os.path.join(self.dir, image)
+        if uncompressed_image:
+            uncompressed_image = os.path.join(self.dir, uncompressed_image)
 
         fail = 0
 
-        fail |= self.check_size(out, image)
+        fail |= self.check_size(out, image, uncompressed_image)
 
         return fail
 
-    def check_size(self, out, image):
+    def check_size(self, out, image, uncompressed_image):
         value = self.config_entry_image.get('check-size')
 
         if not value:
@@ -218,10 +221,6 @@ class CheckImage(object):
 
         size = os.stat(image).st_size + dtb_size
 
-        if size > value:
-            out.write('Image too large (%d > %d)!  Refusing to continue.\n' % (size, value))
-            return 1
-
         # 1% overhead is desirable in order to cope with growth
         # through the lifetime of a stable release. Warn if this is
         # not the case.
@@ -236,6 +235,21 @@ class CheckImage(object):
             out.write('Image fits.  ')
         out.write('Continuing.\n')
 
+        # Also check the uncompressed image
+        if uncompressed_image and self.config_entry_image.get('check-uncompressed-size'):
+            value = self.config_entry_image.get('check-uncompressed-size')
+            size = os.stat(uncompressed_image).st_size
+            usage = (float(size)/value) * 100.0
+            out.write('Uncompressed Image size %d/%d, using %.2f%%.  ' % (size, value, usage))
+            if size > value:
+                out.write('Too large.  Refusing to continue.\n')
+                return 1
+            elif usage >= 99.0:
+                out.write('Uncompressed Image Under 1%% space in %s.  ' % self.changelog.distribution)
+            else:
+                out.write('Uncompressed Image fits.  ')
+            out.write('Continuing.\n')
+
         return 0
 
 
diff --git a/debian/bin/gencontrol.py b/debian/bin/gencontrol.py
index 5302e56..29ea618 100755
--- a/debian/bin/gencontrol.py
+++ b/debian/bin/gencontrol.py
@@ -35,6 +35,7 @@ class Gencontrol(Base):
             'initramfs-generators': config.SchemaItemList(),
             'check-size': config.SchemaItemInteger(),
             'check-size-with-dtb': config.SchemaItemBoolean(),
+            'check-uncompressed-size': config.SchemaItemInteger(),
         },
         'relations': {
         },
diff --git a/debian/changelog b/debian/changelog
index fb275f6..60c2e22 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+linux (4.13~rc7-1~exp2) UNRELEASED; urgency=medium
+
+  [ Roger Shimizu ]
+  * debian/bin/buildcheck.py:
+    Add check for uncompressed Image size, which is necessary for
+    armel/marvell flavour currently.
+
+ -- Roger Shimizu <rogershimizu at gmail.com>  Thu, 31 Aug 2017 19:47:54 +0900
+
 linux (4.13~rc7-1~exp1) experimental; urgency=medium
 
   * New upstream release candidate
diff --git a/debian/config/armel/defines b/debian/config/armel/defines
index 193c81b..9f4ed16 100644
--- a/debian/config/armel/defines
+++ b/debian/config/armel/defines
@@ -9,6 +9,8 @@ image-file: arch/arm/boot/zImage
 # apply only to marvell, but we would then need to build udebs only for
 # marvell and we don't have a way to do that.
 signed-modules: false
+# uncompressed-image is just for size checking
+uncompressed-image-file: arch/arm/boot/Image
 
 [image]
 install-stem: vmlinuz
@@ -32,4 +34,7 @@ recommends: u-boot-tools
 # Buffalo Linkstation LS-WSXL/WXL/WVL (from stock kernel): 2729776 - 64 = 2729712
 check-size: 2097080
 check-size-with-dtb: true
+## Maximum uncompressed kernel size for supported devices
+# Buffalo Linkstation LS-WSXL/WXL/WVL: 7340032
+check-uncompressed-size: 7340032
 breaks: flash-kernel (<< 3.57~)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git



More information about the Kernel-svn-changes mailing list