Skip to content

Commit

Permalink
Update GenContainer.py
Browse files Browse the repository at this point in the history
Update GenContainer.py to slimbootloader/slimbootloader@ebc9ae062574
for multi-container boot support.

Tracked-On: OAM-112552
Signed-off-by: Jiaqing Zhao <[email protected]>
  • Loading branch information
jiaqingz-intel committed Oct 7, 2023
1 parent 9489d80 commit 47f7a22
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions containertool/GenContainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 47f7a22

Please sign in to comment.