Generate signed slimboot binary to output path
Currently final IFWI gets generated output path. Copy the signed slimboot binary to out path. Added option for outpath. Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
This commit is contained in:
parent
0faae704d1
commit
dfd4444a33
|
@ -501,6 +501,11 @@ def main():
|
||||||
type=str, required=True,
|
type=str, required=True,
|
||||||
help='specify the platform specific stitch config file')
|
help='specify the platform specific stitch config file')
|
||||||
|
|
||||||
|
ap.add_argument('-op',
|
||||||
|
dest='outpath',
|
||||||
|
default = '',
|
||||||
|
help = "Specify path to write output IFIW and signed bin files")
|
||||||
|
|
||||||
args = ap.parse_args()
|
args = ap.parse_args()
|
||||||
|
|
||||||
stitch_cfg_file = load_source('StitchIfwiConfig', args.config_file)
|
stitch_cfg_file = load_source('StitchIfwiConfig', args.config_file)
|
||||||
|
@ -539,11 +544,14 @@ def main():
|
||||||
raise Exception ('Stitching process failed !')
|
raise Exception ('Stitching process failed !')
|
||||||
os.chdir(curr_dir)
|
os.chdir(curr_dir)
|
||||||
|
|
||||||
generated_ifwi_file = os.path.join(stitch_dir, 'Temp', 'Ifwi.bin')
|
generated_ifwi_file = os.path.join(work_dir, 'Temp', 'Ifwi.bin')
|
||||||
|
ifwi_file_name = os.path.join(args.outpath,'sbl_ifwi_%s.bin' % (args.platform))
|
||||||
ifwi_file_name = 'sbl_ifwi_%s.bin' % (args.platform)
|
|
||||||
shutil.copy(generated_ifwi_file, ifwi_file_name)
|
shutil.copy(generated_ifwi_file, ifwi_file_name)
|
||||||
|
|
||||||
|
generated_signed_sbl = os.path.join(work_dir, 'Temp', 'SlimBootloader.bin')
|
||||||
|
sbl_file_name = os.path.join(args.outpath,'SlimBootloader_%s.bin' % (args.platform))
|
||||||
|
shutil.copy(generated_signed_sbl, sbl_file_name)
|
||||||
|
|
||||||
print ("\nIFWI Stitching completed successfully !")
|
print ("\nIFWI Stitching completed successfully !")
|
||||||
print ("Boot Guard Profile: %s" % args.btg_profile.upper())
|
print ("Boot Guard Profile: %s" % args.btg_profile.upper())
|
||||||
print ("IFWI image: %s\n" % ifwi_file_name)
|
print ("IFWI image: %s\n" % ifwi_file_name)
|
||||||
|
|
|
@ -435,6 +435,7 @@ def main():
|
||||||
ap.add_argument('-r', dest='remove', action = "store_true", default = False, help = "delete temporary files after stitch")
|
ap.add_argument('-r', dest='remove', action = "store_true", default = False, help = "delete temporary files after stitch")
|
||||||
ap.add_argument('-t', dest='tpm', default = 'ptt', choices=['ptt', 'dtpm', 'none'], help='specify TPM type')
|
ap.add_argument('-t', dest='tpm', default = 'ptt', choices=['ptt', 'dtpm', 'none'], help='specify TPM type')
|
||||||
ap.add_argument('-fusa', dest='fusa', action = "store_true", default = False, help = "Patch IFWI to generate Fusa ifwi")
|
ap.add_argument('-fusa', dest='fusa', action = "store_true", default = False, help = "Patch IFWI to generate Fusa ifwi")
|
||||||
|
ap.add_argument('-op', dest='outpath', default = '', help = "Specify path to write output IFIW and signed bin files")
|
||||||
args = ap.parse_args()
|
args = ap.parse_args()
|
||||||
|
|
||||||
stitch_cfg_file = load_source('StitchIfwiConfig', args.config_file)
|
stitch_cfg_file = load_source('StitchIfwiConfig', args.config_file)
|
||||||
|
@ -460,9 +461,13 @@ def main():
|
||||||
os.chdir(curr_dir)
|
os.chdir(curr_dir)
|
||||||
|
|
||||||
generated_ifwi_file = os.path.join(work_dir, 'Temp', 'Ifwi.bin')
|
generated_ifwi_file = os.path.join(work_dir, 'Temp', 'Ifwi.bin')
|
||||||
ifwi_file_name = 'sbl_ifwi_%s.bin' % (args.platform)
|
ifwi_file_name = os.path.join(args.outpath,'sbl_ifwi_%s.bin' % (args.platform))
|
||||||
shutil.copy(generated_ifwi_file, ifwi_file_name)
|
shutil.copy(generated_ifwi_file, ifwi_file_name)
|
||||||
|
|
||||||
|
generated_signed_sbl = os.path.join(work_dir, 'Temp', 'SlimBootloader.bin')
|
||||||
|
sbl_file_name = os.path.join(args.outpath,'SlimBootloader_%s.bin' % (args.platform))
|
||||||
|
shutil.copy(generated_signed_sbl, sbl_file_name)
|
||||||
|
|
||||||
if args.fusa:
|
if args.fusa:
|
||||||
print ("patch IFWI to generate Fusa ifwi")
|
print ("patch IFWI to generate Fusa ifwi")
|
||||||
with open(ifwi_file_name, "r+b") as fh:
|
with open(ifwi_file_name, "r+b") as fh:
|
||||||
|
|
|
@ -435,6 +435,8 @@ def main():
|
||||||
ap.add_argument('-r', dest='remove', action = "store_true", default = False, help = "delete temporary files after stitch")
|
ap.add_argument('-r', dest='remove', action = "store_true", default = False, help = "delete temporary files after stitch")
|
||||||
ap.add_argument('-t', dest='tpm', default = 'ptt', choices=['ptt', 'dtpm', 'none'], help='specify TPM type')
|
ap.add_argument('-t', dest='tpm', default = 'ptt', choices=['ptt', 'dtpm', 'none'], help='specify TPM type')
|
||||||
ap.add_argument('-fusa', dest='fusa', action = "store_true", default = False, help = "Patch IFWI to generate Fusa ifwi")
|
ap.add_argument('-fusa', dest='fusa', action = "store_true", default = False, help = "Patch IFWI to generate Fusa ifwi")
|
||||||
|
ap.add_argument('-op', dest='outpath', default = '', help = "Specify path to write output IFIW and signed bin files")
|
||||||
|
|
||||||
args = ap.parse_args()
|
args = ap.parse_args()
|
||||||
|
|
||||||
stitch_cfg_file = load_source('StitchIfwiConfig', args.config_file)
|
stitch_cfg_file = load_source('StitchIfwiConfig', args.config_file)
|
||||||
|
@ -460,9 +462,13 @@ def main():
|
||||||
os.chdir(curr_dir)
|
os.chdir(curr_dir)
|
||||||
|
|
||||||
generated_ifwi_file = os.path.join(work_dir, 'Temp', 'Ifwi.bin')
|
generated_ifwi_file = os.path.join(work_dir, 'Temp', 'Ifwi.bin')
|
||||||
ifwi_file_name = 'sbl_ifwi_%s.bin' % (args.platform)
|
ifwi_file_name = os.path.join(args.outpath,'sbl_ifwi_%s.bin' % (args.platform))
|
||||||
shutil.copy(generated_ifwi_file, ifwi_file_name)
|
shutil.copy(generated_ifwi_file, ifwi_file_name)
|
||||||
|
|
||||||
|
generated_signed_sbl = os.path.join(work_dir, 'Temp', 'SlimBootloader.bin')
|
||||||
|
sbl_file_name = os.path.join(args.outpath,'SlimBootloader_%s.bin' % (args.platform))
|
||||||
|
shutil.copy(generated_signed_sbl, sbl_file_name)
|
||||||
|
|
||||||
if args.fusa:
|
if args.fusa:
|
||||||
print ("patch IFWI to generate Fusa ifwi")
|
print ("patch IFWI to generate Fusa ifwi")
|
||||||
with open(ifwi_file_name, "r+b") as fh:
|
with open(ifwi_file_name, "r+b") as fh:
|
||||||
|
|
|
@ -195,6 +195,7 @@ def main():
|
||||||
ap.add_argument('-t', dest='tpm', default = 'ptt', choices=['ptt', 'dtpm', 'none'], help='specify TPM type')
|
ap.add_argument('-t', dest='tpm', default = 'ptt', choices=['ptt', 'dtpm', 'none'], help='specify TPM type')
|
||||||
ap.add_argument('-k', dest='key_dir', type=str, required=True, help='specify the path to Sbl Keys directory')
|
ap.add_argument('-k', dest='key_dir', type=str, required=True, help='specify the path to Sbl Keys directory')
|
||||||
ap.add_argument('-o', dest='option', default = '', help = "Platform specific stitch option. Format: '-o option1;option2;...' For each option its format is 'parameter:data'. Try -o help for more information")
|
ap.add_argument('-o', dest='option', default = '', help = "Platform specific stitch option. Format: '-o option1;option2;...' For each option its format is 'parameter:data'. Try -o help for more information")
|
||||||
|
ap.add_argument('-op', dest='outpath', default = '', help = "Specify path to write output IFIW and signed bin files")
|
||||||
|
|
||||||
args = ap.parse_args()
|
args = ap.parse_args()
|
||||||
|
|
||||||
|
@ -235,9 +236,13 @@ def main():
|
||||||
os.chdir(curr_dir)
|
os.chdir(curr_dir)
|
||||||
|
|
||||||
generated_ifwi_file = os.path.join(work_dir, 'Temp', 'Ifwi.bin')
|
generated_ifwi_file = os.path.join(work_dir, 'Temp', 'Ifwi.bin')
|
||||||
|
ifwi_file_name = os.path.join(args.outpath,'sbl_ifwi_%s.bin' % (args.platform))
|
||||||
ifwi_file_name = 'sbl_ifwi_%s.bin' % (args.platform)
|
|
||||||
shutil.copy(generated_ifwi_file, ifwi_file_name)
|
shutil.copy(generated_ifwi_file, ifwi_file_name)
|
||||||
|
|
||||||
|
generated_signed_sbl = os.path.join(work_dir, 'Temp', 'SlimBootloader.bin')
|
||||||
|
sbl_file_name = os.path.join(args.outpath,'SlimBootloader_%s.bin' % (args.platform))
|
||||||
|
shutil.copy(generated_signed_sbl, sbl_file_name)
|
||||||
|
|
||||||
list_val = [1,0,2,4,16,249,15] #List of values to override
|
list_val = [1,0,2,4,16,249,15] #List of values to override
|
||||||
softstrap_write(ifwi_file_name,0xc18,list_val[0],1) #FUSA SOFTSTRAP due to CSME 2041 update
|
softstrap_write(ifwi_file_name,0xc18,list_val[0],1) #FUSA SOFTSTRAP due to CSME 2041 update
|
||||||
###################################################################################
|
###################################################################################
|
||||||
|
|
|
@ -172,6 +172,7 @@ def main():
|
||||||
ap.add_argument('-r', dest='remove', action = "store_true", default = False, help = "delete temporary files after stitch")
|
ap.add_argument('-r', dest='remove', action = "store_true", default = False, help = "delete temporary files after stitch")
|
||||||
ap.add_argument('-t', dest='tpm', default = 'ptt', choices=['ptt', 'dtpm', 'none'], help='specify TPM type')
|
ap.add_argument('-t', dest='tpm', default = 'ptt', choices=['ptt', 'dtpm', 'none'], help='specify TPM type')
|
||||||
ap.add_argument('-o', dest='option', default = '', help = "Platform specific stitch option. Format: '-o option1;option2;...' For each option its format is 'parameter:data'. Try -o help for more information")
|
ap.add_argument('-o', dest='option', default = '', help = "Platform specific stitch option. Format: '-o option1;option2;...' For each option its format is 'parameter:data'. Try -o help for more information")
|
||||||
|
ap.add_argument('-op', dest='outpath', default = '', help = "Specify path to write output IFIW and signed bin files")
|
||||||
|
|
||||||
args = ap.parse_args()
|
args = ap.parse_args()
|
||||||
|
|
||||||
|
@ -211,10 +212,13 @@ def main():
|
||||||
os.chdir(curr_dir)
|
os.chdir(curr_dir)
|
||||||
|
|
||||||
generated_ifwi_file = os.path.join(work_dir, 'Temp', 'Ifwi.bin')
|
generated_ifwi_file = os.path.join(work_dir, 'Temp', 'Ifwi.bin')
|
||||||
|
ifwi_file_name = os.path.join(args.outpath,'sbl_ifwi_%s.bin' % (args.platform))
|
||||||
ifwi_file_name = 'sbl_ifwi_%s.bin' % (args.platform)
|
|
||||||
shutil.copy(generated_ifwi_file, ifwi_file_name)
|
shutil.copy(generated_ifwi_file, ifwi_file_name)
|
||||||
|
|
||||||
|
generated_signed_sbl = os.path.join(work_dir, 'Temp', 'SlimBootloader.bin')
|
||||||
|
sbl_file_name = os.path.join(args.outpath,'SlimBootloader_%s.bin' % (args.platform))
|
||||||
|
shutil.copy(generated_signed_sbl, sbl_file_name)
|
||||||
|
|
||||||
print ("\nIFWI Stitching completed successfully !")
|
print ("\nIFWI Stitching completed successfully !")
|
||||||
print ("Boot Guard Profile: %s" % args.btg_profile.upper())
|
print ("Boot Guard Profile: %s" % args.btg_profile.upper())
|
||||||
print ("IFWI image: %s\n" % ifwi_file_name)
|
print ("IFWI image: %s\n" % ifwi_file_name)
|
||||||
|
|
Loading…
Reference in New Issue