mirror of
https://github.com/ipxe/ipxe
synced 2025-12-28 10:32:52 +03:00
[prefix] Allow iPXE's own command line to be executed as a script
Some prefixes (e.g. .lkrn) allow a command line to be passed in to
iPXE. At present, this command line is ignored.
If a command line is provided, treat it as an embedded script (without
an explicit "#!ipxe" magic marker). This allows for patterns of
invocation such as
title iPXE
kernel /boot/ipxe.lkrn dhcp && \
sanboot iscsi:10.0.4.1::::iqn.2010-04.org.ipxe.dolphin:storage
Here GRUB is instructed to load ipxe.lkrn with an embedded script
equivalent to
#!ipxe
dhcp
sanboot iscsi:10.0.4.1::::iqn.2010-04.org.ipxe.dolphin:storage
This can be used to effectively vary the embedded script without
having to rebuild ipxe.lkrn.
Originally-implemented-by: Dave Hansen <dave@sr71.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -193,6 +193,9 @@ run_ipxe:
|
||||
movw %ax, %ss
|
||||
movw $0x7c00, %sp
|
||||
|
||||
/* Retrieve command-line pointer */
|
||||
movl %es:cmd_line_ptr, %edx
|
||||
|
||||
/* Install iPXE */
|
||||
call install
|
||||
|
||||
@@ -206,6 +209,13 @@ run_ipxe:
|
||||
lret
|
||||
.section ".text16", "awx", @progbits
|
||||
1:
|
||||
/* Set up %ds for access to .data16 */
|
||||
movw %bx, %ds
|
||||
|
||||
/* Store command-line pointer */
|
||||
movl %edx, cmdline_phys
|
||||
|
||||
/* Run iPXE */
|
||||
pushl $main
|
||||
pushw %cs
|
||||
call prot_call
|
||||
|
||||
Reference in New Issue
Block a user