|
14 | 14 | parser.add_argument('-b', '--bootargs', type=str, metavar='"boot arguments"') |
15 | 15 | parser.add_argument('-t', '--tty', type=str) |
16 | 16 | parser.add_argument('-u', '--u-boot', type=pathlib.Path, help="load u-boot before linux") |
| 17 | +parser.add_argument('-E', '--efi', action="store_true", help="payload is EFI stub (requires u-boot)") |
17 | 18 | parser.add_argument('-T', '--tso', action="store_true", help="enable TSO") |
18 | 19 | args = parser.parse_args() |
19 | 20 |
|
20 | 21 | from m1n1.setup import * |
21 | 22 |
|
| 23 | +if args.efi and args.u_boot is None: |
| 24 | + raise Exception("Booting EFI stubs requires u-boot.") |
| 25 | + |
22 | 26 | if args.compression == 'auto': |
23 | 27 | suffix = args.payload.suffix |
24 | | - if suffix == '.gz': |
| 28 | + if args.efi: |
| 29 | + args.compression = 'none' |
| 30 | + elif suffix == '.gz': |
25 | 31 | args.compression = 'gz' |
26 | 32 | elif suffix == '.xz': |
27 | 33 | args.compression = 'xz' |
|
91 | 97 | x.startswith("bootcmd") |
92 | 98 | ), bootenv)) |
93 | 99 |
|
94 | | - if initramfs is not None: |
| 100 | + if args.efi and initramfs is not None: |
| 101 | + bootcmd = "bootcmd=bootefi 0x%x:0x%x 0x%x:0x%x $fdtcontroladdr" % (kernel_base, kernel_size, initramfs_base, initramfs_size) |
| 102 | + elif initramfs is not None: |
95 | 103 | bootcmd = "bootcmd=booti 0x%x 0x%x:0x%x $fdtcontroladdr" % (kernel_base, initramfs_base, initramfs_size) |
| 104 | + elif args.efi: |
| 105 | + bootcmd = "bootcmd=bootefi 0x%x:0x%x $fdtcontroladdr" % (kernel_base, kernel_size) |
96 | 106 | else: |
97 | 107 | bootcmd = "bootcmd=booti 0x%x - $fdtcontroladdr" % (kernel_base) |
98 | 108 |
|
|
0 commit comments