From 47f7a22cdfaa0ccd9c67201b8d3d0f93d5648d28 Mon Sep 17 00:00:00 2001 From: Jiaqing Zhao Date: Sat, 7 Oct 2023 01:35:49 +0000 Subject: [PATCH] Update GenContainer.py Update GenContainer.py to slimbootloader/slimbootloader@ebc9ae062574 for multi-container boot support. Tracked-On: OAM-112552 Signed-off-by: Jiaqing Zhao --- containertool/GenContainer.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/containertool/GenContainer.py b/containertool/GenContainer.py index 98c9f1a..35e83e0 100755 --- a/containertool/GenContainer.py +++ b/containertool/GenContainer.py @@ -71,6 +71,7 @@ class CONTAINER_HDR (Structure): 'NORMAL' : 0x00, # Used for boot images in FV, regular ELF, PE32, etc. formats 'CLASSIC' : 0xF3, # Used for booting Linux with bzImage, cmdline, initrd, etc. 'MULTIBOOT' : 0xF4, # Multiboot compliant ELF images + 'MULTIBOOT_MODULE' : 0xF5, # Multiboot compliant ELF images } def __new__(cls, buf = None): @@ -592,7 +593,10 @@ def extract (self, name = '', file_path = ''): auth_type_str = self.get_auth_type_str (self.header.auth_type) match = re.match('RSA(\d+)_', auth_type_str) if match: - key_file = 'KEY_ID_CONTAINER_RSA%s' % match.group(1) + if self.header.signature.decode() == 'BOOT': + key_file = 'KEY_ID_OS1_PRIVATE_RSA%s' % match.group(1) + else: + key_file = 'KEY_ID_CONTAINER_RSA%s' % match.group(1) else: key_file = '' alignment = self.header.alignment @@ -822,7 +826,7 @@ def main(): # '-l' or '-cl', one of them is mandatory group.add_argument('-l', dest='layout', type=str, help='Container layout input file if no -cl') group.add_argument('-cl', dest='comp_list',nargs='+', help='List of each component files, following XXXX:FileName format') - cmd_display.add_argument('-t', dest='img_type', type=str, default='CLASSIC', help='Container Image Type : [NORMAL, CLASSIC, MULTIBOOT]') + cmd_display.add_argument('-t', dest='img_type', type=str, default='CLASSIC', help='Container Image Type : [NORMAL, CLASSIC, MULTIBOOT, MULTIBOOT_MODULE]') cmd_display.add_argument('-o', dest='out_path', type=str, default='.', help='Container output directory/file') cmd_display.add_argument('-k', dest='key_path', type=str, default='', help='Input key directory/file. Use key directoy path when container layout -l option is used \ Use Key Id or key file path when component files with -cl option is specified')