summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Tolvanen2016-03-10 18:08:42 -0600
committerSami Tolvanen2016-03-10 18:08:42 -0600
commit32530927185956f8daefbdc10ae0c82798a87f5b (patch)
tree7c6bfe948c226b54819213f5c29de4bf8b9f5017 /mkbootimg
parent3edc43234a0c0d592bc67b61f39c45eed238cef2 (diff)
downloadplatform-system-core-32530927185956f8daefbdc10ae0c82798a87f5b.tar.gz
platform-system-core-32530927185956f8daefbdc10ae0c82798a87f5b.tar.xz
platform-system-core-32530927185956f8daefbdc10ae0c82798a87f5b.zip
Revert "mkbootimg: add version and patch level"
This reverts commit 3edc43234a0c0d592bc67b61f39c45eed238cef2. Bug: 27580174 Change-Id: I42dac32eb7a70498accf2b8b4fde1ed0d221ca0b
Diffstat (limited to 'mkbootimg')
-rw-r--r--mkbootimg/bootimg.h6
-rwxr-xr-xmkbootimg/mkbootimg24
2 files changed, 4 insertions, 26 deletions
diff --git a/mkbootimg/bootimg.h b/mkbootimg/bootimg.h
index 2bd823012..5ab619599 100644
--- a/mkbootimg/bootimg.h
+++ b/mkbootimg/bootimg.h
@@ -43,11 +43,7 @@ struct boot_img_hdr
43 43
44 uint32_t tags_addr; /* physical addr for kernel tags */ 44 uint32_t tags_addr; /* physical addr for kernel tags */
45 uint32_t page_size; /* flash page size we assume */ 45 uint32_t page_size; /* flash page size we assume */
46 46 uint32_t unused[2]; /* future expansion: should be 0 */
47 /* operating system version; "1.2.34" -> 010234 */
48 uint32_t os_version;
49 /* operating system patch level; "2016-01-01" -> 20160101 */
50 uint32_t os_patch_level;
51 47
52 uint8_t name[BOOT_NAME_SIZE]; /* asciiz product name */ 48 uint8_t name[BOOT_NAME_SIZE]; /* asciiz product name */
53 49
diff --git a/mkbootimg/mkbootimg b/mkbootimg/mkbootimg
index be342c9b5..f95d7039c 100755
--- a/mkbootimg/mkbootimg
+++ b/mkbootimg/mkbootimg
@@ -20,7 +20,6 @@ from os import fstat
20from struct import pack 20from struct import pack
21from hashlib import sha1 21from hashlib import sha1
22import sys 22import sys
23import re
24 23
25def filesize(f): 24def filesize(f):
26 if f is None: 25 if f is None:
@@ -48,7 +47,7 @@ def pad_file(f, padding):
48def write_header(args): 47def write_header(args):
49 BOOT_MAGIC = 'ANDROID!'.encode() 48 BOOT_MAGIC = 'ANDROID!'.encode()
50 args.output.write(pack('8s', BOOT_MAGIC)) 49 args.output.write(pack('8s', BOOT_MAGIC))
51 args.output.write(pack('10I', 50 args.output.write(pack('8I',
52 filesize(args.kernel), # size in bytes 51 filesize(args.kernel), # size in bytes
53 args.base + args.kernel_offset, # physical load addr 52 args.base + args.kernel_offset, # physical load addr
54 filesize(args.ramdisk), # size in bytes 53 filesize(args.ramdisk), # size in bytes
@@ -56,9 +55,8 @@ def write_header(args):
56 filesize(args.second), # size in bytes 55 filesize(args.second), # size in bytes
57 args.base + args.second_offset, # physical load addr 56 args.base + args.second_offset, # physical load addr
58 args.base + args.tags_offset, # physical addr for kernel tags 57 args.base + args.tags_offset, # physical addr for kernel tags
59 args.pagesize, # flash page size we assume 58 args.pagesize)) # flash page size we assume
60 args.os_version, # operating system version 59 args.output.write(pack('8x')) # future expansion: should be 0
61 args.os_patch_level)) # security patch level
62 args.output.write(pack('16s', args.board.encode())) # asciiz product name 60 args.output.write(pack('16s', args.board.encode())) # asciiz product name
63 args.output.write(pack('512s', args.cmdline[:512].encode())) 61 args.output.write(pack('512s', args.cmdline[:512].encode()))
64 62
@@ -99,18 +97,6 @@ def write_padded_file(f_out, f_in, padding):
99def parse_int(x): 97def parse_int(x):
100 return int(x, 0) 98 return int(x, 0)
101 99
102def match_to_int(x):
103 if (x and x.lastindex == 3):
104 return (parse_int(x.group(3)) +
105 parse_int(x.group(2)) * 100 +
106 parse_int(x.group(1)) * 10000)
107 return 0
108
109def parse_os_version(x):
110 return match_to_int(re.search(r'^(\d+)\.(\d{1,2})\.(\d{1,2})', x))
111
112def parse_os_patch_level(x):
113 return match_to_int(re.search(r'^(\d{4,})-(\d{2})-(\d{2})', x))
114 100
115def parse_cmdline(): 101def parse_cmdline():
116 parser = ArgumentParser() 102 parser = ArgumentParser()
@@ -125,10 +111,6 @@ def parse_cmdline():
125 parser.add_argument('--ramdisk_offset', help='ramdisk offset', type=parse_int, default=0x01000000) 111 parser.add_argument('--ramdisk_offset', help='ramdisk offset', type=parse_int, default=0x01000000)
126 parser.add_argument('--second_offset', help='2nd bootloader offset', type=parse_int, 112 parser.add_argument('--second_offset', help='2nd bootloader offset', type=parse_int,
127 default=0x00f00000) 113 default=0x00f00000)
128 parser.add_argument('--os_version', help='operating system version', type=parse_os_version,
129 default=0)
130 parser.add_argument('--os_patch_level', help='operating system patch level',
131 type=parse_os_patch_level, default=0)
132 parser.add_argument('--tags_offset', help='tags offset', type=parse_int, default=0x00000100) 114 parser.add_argument('--tags_offset', help='tags offset', type=parse_int, default=0x00000100)
133 parser.add_argument('--board', help='board name', default='', action=ValidateStrLenAction, 115 parser.add_argument('--board', help='board name', default='', action=ValidateStrLenAction,
134 maxlen=16) 116 maxlen=16)