-
Notifications
You must be signed in to change notification settings - Fork 2
/
build-ipxe.sh
61 lines (57 loc) · 2.22 KB
/
build-ipxe.sh
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
#!/bin/bash
set -euxo pipefail
# clone the ipxe repo.
cd ~
[ -d ipxe ] || git clone https://github.com/ipxe/ipxe.git ipxe
cd ipxe
git fetch origin master
git checkout v1.21.1
# configure.
# see https://ipxe.org/buildcfg/cert_cmd
# see https://ipxe.org/buildcfg/download_proto_https
# see https://ipxe.org/buildcfg/image_trust_cmd
# see https://ipxe.org/buildcfg/neighbour_cmd
# see https://ipxe.org/buildcfg/nslookup_cmd
# see https://ipxe.org/buildcfg/ntp_cmd
# see https://ipxe.org/buildcfg/param_cmd
# see https://ipxe.org/buildcfg/ping_cmd
# see https://ipxe.org/buildcfg/poweroff_cmd
# see https://ipxe.org/buildcfg
# see https://ipxe.org/appnote/named_config
cat >src/config/local/general.h <<'EOF'
#define CERT_CMD /* Certificate management commands */
#define DOWNLOAD_PROTO_HTTPS /* Secure Hypertext Transfer Protocol */
#define DOWNLOAD_PROTO_TFTP /* Trivial File Transfer Protocol */
#define IMAGE_TRUST_CMD /* Image trust management commands */
#define NEIGHBOUR_CMD /* Neighbour management commands */
#define NSLOOKUP_CMD /* Name resolution command */
#define NTP_CMD /* Network time protocol commands */
#define PARAM_CMD /* Form parameter commands */
#define PING_CMD /* Ping command */
#define POWEROFF_CMD /* Power off command */
#undef SANBOOT_PROTO_AOE /* AoE protocol */
EOF
# see https://ipxe.org/buildcfg/keyboard_map
cat >src/config/local/console.h <<'EOF'
// NB this has no effect in EFI mode. you must set the layout in the
// efi firmware instead.
//#undef KEYBOARD_MAP
//#define KEYBOARD_MAP pt
EOF
# build.
# see https://ipxe.org/embed
# see https://ipxe.org/scripting
# see https://ipxe.org/cmd
# see https://ipxe.org/cmd/ifconf
# see https://ipxe.org/appnote/buildtargets
export CROSS_COMPILE=aarch64-linux-gnu-
NUM_CPUS=$((`getconf _NPROCESSORS_ONLN` + 2))
# NB sometimes, for some reason, when we change the settings at
# src/config/local/*.h they will not always work unless we
# build from scratch.
rm -rf src/bin*
time make -j $NUM_CPUS -C src bin-arm64-efi/ipxe.efi EMBED=/vagrant/rpi.ipxe
# copy to the host.
mkdir -p /vagrant/tmp
cp src/bin-arm64-efi/ipxe.efi /vagrant/tmp/
ls -laF /vagrant/tmp/ipxe.efi