-
Notifications
You must be signed in to change notification settings - Fork 2
/
rpi.ipxe
60 lines (55 loc) · 1.8 KB
/
rpi.ipxe
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
#!ipxe
# see https://ipxe.org/docs
# see https://ipxe.org/settings
# show the system information.
# NB you can run "config" to interactively see all the possible variables.
echo Platform..... ${platform}
echo Architecture. ${buildarch}
echo Product...... ${smbios/product}
echo Manufacturer. ${smbios/manufacturer}
echo Asset........ ${smbios/asset}
echo UUID......... ${smbios/uuid}
echo Serial....... ${smbios/serial}
# show the available network interfaces.
echo Network interfaces:
ifstat
echo Configuring net0 ${net0/mac} (${net0/chip}) from dhcp...
:retry_ifconf
ifconf --configurator dhcp net0 || goto retry_ifconf
echo MAC address.. ${net0/mac}
echo IP address... ${net0/ip}
echo Subnet mask.. ${net0/netmask}
echo Gateway...... ${net0/gateway}
echo DNS.......... ${net0/dns}
echo Hostname..... ${hostname}
echo Domain....... ${domain}
echo Next Server.. ${next-server}
echo Filename..... ${filename}
# we need to set the time from ntp because the pi does not have an rtc.
# NB having the correct time is a requirement to use TLS.
echo Getting the current time from ntp...
:retry_ntp
ntp pool.ntp.org || goto retry_ntp
# in a bash you can convert this into a date with, e.g.:
# date --date=@$((0x5ebfcbbb))
# see https://ipxe.org/cfg/unixtime
echo Unix Time.... ${unixtime}
echo Dropping into the iPXE shell...
echo
echo TIP You can boot from the DHCP configured EFI application with:
echo
echo chain --autofree tftp://${next-server}/${filename}
echo
echo TIP You can launch the EFI shell with:
echo
echo chain --autofree file:///Shell.efi -nostartup
echo
echo TIP You can execute an EFI shell command with:
echo
echo chain --autofree file:///Shell.efi -exit smbiosview -t 3
echo
echo TIP You can download and execute a remote iPXE script with:
echo
echo chain --autofree https://boot.netboot.xyz
echo
shell