This provides a few clean-ups: - sort the imports correctly - sort the arguments (-v is in the wrong place) - use os_arch for the OS architecture, to match build-efi
Signed-off-by: Simon Glass <s...@chromium.org> --- scripts/build-qemu | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/build-qemu b/scripts/build-qemu index 5798da3775c..74dc3bb915e 100755 --- a/scripts/build-qemu +++ b/scripts/build-qemu @@ -12,13 +12,13 @@ It assumes that So far the script supports only ARM and x86 """ -import sys -import os import argparse +import os +from pathlib import Path import subprocess +import sys import shlex import time -from pathlib import Path from build_helper import Helper @@ -57,8 +57,6 @@ def parse_args(): help='Use KVM (Kernel-based Virtual Machine) for acceleration') parser.add_argument('-o', '--os', metavar='NAME', choices=['ubuntu'], help='Run a specified Operating System') - parser.add_argument('-v', '--verbose', action='store_true', - help='Show executed commands') parser.add_argument('-r', '--run', action='store_true', help='Run QEMU with the built/specified image') parser.add_argument( @@ -70,6 +68,8 @@ def parse_args(): parser.add_argument( '-S', '--sct-seq', help='SCT sequence-file to be written into the SCT image if -e') + parser.add_argument('-v', '--verbose', action='store_true', + help='Show executed commands') parser.add_argument('-w', '--word-32bit', action='store_true', help='Use 32-bit version for the build/architecture') @@ -148,27 +148,27 @@ class BuildQemu: self.qemu_extra.extend(['-machine', 'virt']) if not args.kvm: self.qemu_extra.extend(['-accel', 'tcg']) - qemu_arch = 'arm' + os_arch = 'arm' if self.bitness == 64: self.board = 'qemu_arm64' self.qemu = 'qemu-system-aarch64' self.qemu_extra.extend(['-cpu', 'cortex-a57']) - qemu_arch = 'arm64' + os_arch = 'arm64' elif args.arch == 'x86': self.board = 'qemu-x86' default_bios = 'u-boot.rom' self.qemu = 'qemu-system-i386' - qemu_arch = 'i386' # For OS image naming + os_arch = 'i386' # For OS image naming if self.bitness == 64: self.board = 'qemu-x86_64' self.qemu = 'qemu-system-x86_64' - qemu_arch = 'amd64' + os_arch = 'amd64' else: raise ValueError(f"Invalid arch '{args.arch}'") self.os_path = None if args.os == 'ubuntu': - img_name = (f'{args.os}-{args.release}-desktop-{qemu_arch}.iso') + img_name = (f'{args.os}-{args.release}-desktop-{os_arch}.iso') self.os_path = self.imagedir / args.os / img_name self.build_dir = self.ubdir / self.board -- 2.43.0