scripts: Provide a way to use custom firmware
Update both build-efi and build-scripts to allow a -c option to provide custom firmware. This makes the scripts more generally useful. Drop the existing -c for --spice since it conflicts and is also is bit hard to remember. Signed-off-by: Simon Glass <simon.glass@canonical.com>
This commit is contained in:
@@ -56,7 +56,7 @@ def parse_args():
|
||||
help='Package up the payload instead of the app')
|
||||
parser.add_argument('-P', '--partition', action='store_true',
|
||||
help='Create a partition table')
|
||||
parser.add_argument('-c', '--spice', action='store_true',
|
||||
parser.add_argument('--spice', action='store_true',
|
||||
help='Enable SPICE for clipboard sharing')
|
||||
parser.add_argument('-N', '--net', action='store_true',
|
||||
help='Enable networking (with SSH forwarding on port 2222)')
|
||||
@@ -175,9 +175,15 @@ class BuildEfi:
|
||||
dst (str): Destination directory
|
||||
"""
|
||||
print(f'Packaging {build}')
|
||||
fname = f'u-boot-{build_type}.efi'
|
||||
if self.args.custom:
|
||||
dirname, fname = os.path.split(self.args.custom)
|
||||
if not dirname:
|
||||
dirname = '.'
|
||||
else:
|
||||
fname = f'u-boot-{build_type}.efi'
|
||||
dirname = f'{self.build_dir}/'
|
||||
tools.write_file(f'{dst}/startup.nsh', f'fs0:{fname}', binary=False)
|
||||
shutil.copy(f'{self.build_dir}/{fname}', dst)
|
||||
shutil.copy(f'{dirname}/{fname}', dst)
|
||||
|
||||
# Copy additional files from include directory if specified
|
||||
if self.args.include_dir:
|
||||
|
||||
@@ -111,7 +111,13 @@ class BuildQemu:
|
||||
self.kvm_params = ['-enable-kvm', '-cpu', 'host']
|
||||
|
||||
bios_override = None
|
||||
if args.use_tianocore:
|
||||
if args.custom:
|
||||
bios_override = Path(args.custom)
|
||||
if not bios_override.exists():
|
||||
tout.fatal(
|
||||
'Error: Custom BIOS specified (-c) but not found at '
|
||||
f'{bios_override}')
|
||||
elif args.use_tianocore:
|
||||
if args.arch == 'arm':
|
||||
bios_override = Path(self.tiano, 'OVMF-pure-efi.aarch64.fd.64m')
|
||||
else:
|
||||
|
||||
@@ -295,6 +295,8 @@ def add_common_args(parser):
|
||||
parser.add_argument('-B', '--no-build', action='store_true',
|
||||
help="Don't build; assume a build exists")
|
||||
parser.add_argument('--build-dir', help='Directory to use for the build')
|
||||
parser.add_argument('-c', '--custom',
|
||||
help='Use a custom BIOS/app instead of U-Boot')
|
||||
parser.add_argument('-C', '--enable-console', action='store_true',
|
||||
help="Enable linux console (x86 only)")
|
||||
parser.add_argument('-d', '--disk', nargs='*',
|
||||
|
||||
Reference in New Issue
Block a user