diff options
| author | Mark Hatle <mark.hatle@amd.com> | 2025-03-17 17:57:39 -0600 |
|---|---|---|
| committer | Mark Hatle <mark.hatle@amd.com> | 2025-03-30 14:16:15 -0600 |
| commit | 4a95d4cdccb17a5630787ed7e5097b3c3b42891a (patch) | |
| tree | 0ce9e5b1f3096aa8fa273272324b5ee6a4aedbed | |
| parent | a59f9e0da23ec24d85575265ce14f520d5850de2 (diff) | |
| download | meta-xilinx-4a95d4cdccb17a5630787ed7e5097b3c3b42891a.tar.gz | |
meta-xilinx-core: qemu-system-aarch64-multiarch: Move sanity checks
Before the user may have been forced to specify certain parameters, even if
they wanted to just use --help. Move the sanity checks after the help check
to avoid unnecessary warnings and errors.
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
| -rw-r--r-- | meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch b/meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch index 24b90848..e66c0fd0 100644 --- a/meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch +++ b/meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch | |||
| @@ -55,23 +55,6 @@ if '-kernel' in APU_args: | |||
| 55 | kernel_args_idx = APU_args.index('-kernel') | 55 | kernel_args_idx = APU_args.index('-kernel') |
| 56 | del APU_args[kernel_args_idx:kernel_args_idx+2] | 56 | del APU_args[kernel_args_idx:kernel_args_idx+2] |
| 57 | 57 | ||
| 58 | # The APU QEMU will hang if it does get get a -hw-dtb | ||
| 59 | if dtb_arg and '-hw-dtb' in APU_args: | ||
| 60 | sys.exit(f'\nERROR: Arguments -dtb and -hw-dtb conflict, only one should be specified.') | ||
| 61 | elif not dtb_arg and not '-hw-dtb' in APU_args: | ||
| 62 | sys.exit(f'\nERROR: You must specify at least a -dtb or -hw-dtb for the APU.') | ||
| 63 | |||
| 64 | if mach_path_arg: | ||
| 65 | if not os.path.isdir(mach_path_arg): | ||
| 66 | sys.exit(f'\nERROR: Missing machine path for qemu: {mach_path_arg}') | ||
| 67 | else: | ||
| 68 | mach_path = os.path.realpath(mach_path_arg) | ||
| 69 | else: | ||
| 70 | mach_path = tempfile.mkdtemp() | ||
| 71 | |||
| 72 | if PMU_args and PLM_args: | ||
| 73 | sys.exit("\nError: -pmu-args can not be used with -plm-args\n") | ||
| 74 | |||
| 75 | help_options = ['-h', '-help', '--help'] | 58 | help_options = ['-h', '-help', '--help'] |
| 76 | def help(status): | 59 | def help(status): |
| 77 | print("AMD FPGA QEMU multiarch wrapper\nVersion 2025.1\n\nUsage:") | 60 | print("AMD FPGA QEMU multiarch wrapper\nVersion 2025.1\n\nUsage:") |
| @@ -110,6 +93,23 @@ if set(APU_args).intersection(set(help_options)) or set(PMU_args).intersection(s | |||
| 110 | if not PMU_args and not PLM_args: | 93 | if not PMU_args and not PLM_args: |
| 111 | help(1) | 94 | help(1) |
| 112 | 95 | ||
| 96 | # The APU QEMU will hang if it does get get a -hw-dtb | ||
| 97 | if dtb_arg and '-hw-dtb' in APU_args: | ||
| 98 | sys.exit(f'\nERROR: Arguments -dtb and -hw-dtb conflict, only one should be specified.') | ||
| 99 | elif not dtb_arg and not '-hw-dtb' in APU_args: | ||
| 100 | sys.exit(f'\nERROR: You must specify at least a -dtb or -hw-dtb for the APU.') | ||
| 101 | |||
| 102 | if mach_path_arg: | ||
| 103 | if not os.path.isdir(mach_path_arg): | ||
| 104 | sys.exit(f'\nERROR: Missing machine path for qemu: {mach_path_arg}') | ||
| 105 | else: | ||
| 106 | mach_path = os.path.realpath(mach_path_arg) | ||
| 107 | else: | ||
| 108 | mach_path = tempfile.mkdtemp() | ||
| 109 | |||
| 110 | if PMU_args and PLM_args: | ||
| 111 | sys.exit("\nError: -pmu-args can not be used with -plm-args\n") | ||
| 112 | |||
| 113 | if PMU_args: | 113 | if PMU_args: |
| 114 | try: | 114 | try: |
| 115 | PMU_rom = PMU_args[PMU_args.index('-kernel')+1] | 115 | PMU_rom = PMU_args[PMU_args.index('-kernel')+1] |
