handle 4096 byte pages if requested via --pagesize

Change-Id: I9299ebeced85dcf5e6e4686b99b28b9786be4f25
Signed-off-by: Brian Swetland <swetland@google.com>
diff --git a/mkbootimg/mkbootimg.c b/mkbootimg/mkbootimg.c
index 3642647..bdc572e 100644
--- a/mkbootimg/mkbootimg.c
+++ b/mkbootimg/mkbootimg.c
@@ -71,7 +71,7 @@
 
 
 
-static unsigned char padding[2048] = { 0, };
+static unsigned char padding[4096] = { 0, };
 
 int write_padding(int fd, unsigned pagesize, unsigned itemsize)
 {
@@ -148,6 +148,12 @@
             hdr.tags_addr =    base + 0x00000100;
         } else if(!strcmp(arg, "--board")) {
             board = val;
+        } else if(!strcmp(arg,"--pagesize")) {
+            pagesize = strtoul(val, 0, 10);
+            if ((pagesize != 2048) && (pagesize != 4096)) {
+                fprintf(stderr,"error: unsupported page size %d\n", pagesize);
+                return -1;
+            }
         } else {
             return usage();
         }