Loading...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | .. SPDX-License-Identifier: GPL-2.0+ Script for building and running =============================== You may find the script `scripts/build-qemu` helpful for building and testing U-Boot on QEMU. If uses a settings file `~/.u_boot_qemu` to control how it works: build_dir base directory for building U-Boot, with each board being in its own subdirectory image_dir directory containing OS images, containing a subdirectory for each distro type (e.g. `ubuntu/`) bzimage path to a bzImage file to supply to boot x86 Linux efi_image_file output filename for the disk image containing an EFI app / payload efi_dir directory when pre-built UEFI images are kept, e.g. OVMF-pure-efi.i386.fd sct_dir directory when the UEFI Self-Certification Test (SCT) is kept sct_mnt temporary mount point for building SCT: note this requires sudo A sample file is written if you don't have one, e.g.:: # U-Boot QEMU-scripts config [DEFAULT] # Set to the build directory where you build U-Boot out-of-tree # We avoid in-tree build because it gets confusing trying different builds # Each board gets a build in a separate subdir build_dir = /tmp/b # Image directory (for OS images) image_dir = ~/dev/os # Build the kernel with: make O=/tmp/kernel bzimage = /tmp/kernel/arch/x86/boot/bzImage # EFI image-output filename efi_image_file = try.img # Directory where OVMF-pure-efi.i386.fd etc. are kept efi_dir = ~/dev/efi # Directory where SCT image (sct.img) is kept sct_dir = ~/dev/efi/sct # Directory where the SCT image is temporarily mounted for modification sct_mnt = /mnt/sct Once configured, you can build and run QEMU for arm64 like this:: scripts/build-qemu -rsw Options ~~~~~~~ Options are available to control the script: -a <arch> Select architecture (default arm, x86) -B Don't build; assume a build exists -d/--disk DISK Root disk image file to use with QEMU -e/--sct-run Package an run UEFI Self-Certification Test (SCT) -E/--use-tianocore Run Tianocore (OVMF) instead of U-Boot -k Use kvm - kernel-based Virtual Machine. By default QEMU uses its own emulator -o <os> Run an Operating System. For now this only supports 'ubuntu'. The name of the OS file must remain unchanged from its standard name on the Ubuntu website. -r Run QEMU with the image (by default this is not done) -R Select OS release (e.g. 24.04). -s Use serial only (no display) -S/--sct-seq SCT_SEQ SCT sequence-file to be written into the SCT image if -e -w Use word version (32-bit). By default, 64-bit is used |