-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathipxe.sh
50 lines (46 loc) · 1.45 KB
/
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
IPXE_SOURCE_REPO=https://git.ipxe.org/ipxe.git
IPXE_HOME=https://boot.ipxe.org
IPXE_SOURCE=${IPXE_SOURCE:-/tmp/ipxe}
ipxe-build-from-source() {
rm -rf $IPXE_SOURCE
# build dependencies on Debian
if command -v apt >/dev/null
then
sudo apt -y \
install \
build-essential \
liblzma-dev \
genisoimage \
git-core
fi
# Download the source code
git clone $IPXE_SOURCE_REPO $IPXE_SOURCE
# build iPXE from source
cd $IPXE_SOURCE/src
make CFLAGS="-Wno-error=format-truncation" |& tee ../build.log
# copy components to HTTP server document root
cp -v bin/*.{iso,usb,pxe,lkrn} $PXESRV_ROOT/
# clean up
cd -
}
# download the iPXE roms from the official web-site
ipxe-download() {
for file in ipxe.{iso,usb,dsk,efi,lkrn,pxe}
do
curl --silent \
--show-error \
--output $PXESRV_ROOT/$file \
$IPXE_HOME/$file
ls -1 $PXESRV_ROOT/$file
done
}
# kill with Esc+2 (monitor console), `quit` command
ipxe-instance() {
echo Access QEMU/monitor with Esc-2
sleep 2
qemu-system-x86_64 \
--enable-kvm \
-m 2048 \
-display curses \
$PXESRV_ROOT/ipxe.iso
}