pack.py: included lkboot in single image

Added an additional option '--lk'.
With this option '--lk' included, pack script will
use lkboot.mbn instead of u-boot.mbn for APPSBL.

This option applies to 'emmc' only image.
Other flash types will discard this option.

Applies to ipq806x and ipq40xx SoCs.

Change-Id: Ic3b5a3398e3d007fe1d144e069e62a6157b9a2ef
Signed-off-by: Gokul Sriram Palanisamy <gokulsri@codeaurora.org>
This commit is contained in:
Gokul Sriram Palanisamy 2018-12-27 10:55:51 +05:30
parent 7b83f68369
commit 44cffe4325

View file

@ -83,6 +83,7 @@ import re
import hashlib
version = "1.1"
lk = False
TABLE_VERSION_AK = 3
TABLE_VERSION_DK = 4
@ -718,6 +719,11 @@ class Pack(object):
for section in info.sections():
try:
filename = info.get(section, "filename")
if lk == True and "u-boot" in filename and self.flinfo.type == 'emmc':
if "ipq40xx" in filename:
filename = "openwrt-ipq40xx-lkboot-stripped.elf"
elif "ipq806x" in filename:
filename = "openwrt-ipq806x-lkboot.mbn"
partition = info.get(section, "partition")
include = info.get(section, "include")
except ConfigParserError, e:
@ -841,6 +847,11 @@ class Pack(object):
if ( size != img_size ):
filename = filename + ".padded"
if self.flinfo.type == 'emmc':
if lk == True and "u-boot" in filename:
if "ipq40xx" in filename:
filename = "openwrt-ipq40xx-lkboot-stripped.elf"
elif "ipq806x" in filename:
filename = "openwrt-ipq806x-lkboot.mbn"
img_size = self.__get_img_size(filename)
size = roundup(img_size, flinfo.blocksize)
if ( size != img_size ):
@ -1404,9 +1415,10 @@ class ArgParser(object):
bconf = False
bconf_fname = None
genitb_fname = None
global lk
try:
opts, args = getopt(argv[1:], "Bib:hp:t:o:c:m:f:F:M:")
opts, args = getopt(argv[1:], "Bib:hp:t:o:c:m:f:F:M:", ["lk"])
except GetoptError, e:
raise UsageError(e.msg)
@ -1433,6 +1445,8 @@ class ArgParser(object):
bconf_fname = value
elif option == "-M":
genitb_fname= value
elif option == "--lk":
lk = True
if len(args) != 1:
raise UsageError("insufficient arguments")