Files
s390-tools/netboot/Makefile.pxelinux.0
Viktor Mihajlovski f3f16a7ca4 netboot: Scripts for building a PXE-style netboot image for KVM
A set of scripts and a short documentation describing how to build
a network boot image simulating a PXELINUX-style boot process.

Starting with QEMU 2.10 it is possible to boot a KVM guest over a
network interface using DHCP/BOOTP. The boot process is triggered by
the network boot firmware that is part of QEMU and follows the usual
network boot pattern: a DHCP request is issued by the client and
answered by a DHCP/BOOTP server. The DHCP reply will contain a
TFPT server identification and a bootfile name. The client will
retrieve the bootfile from the TFTP server, load it into memory
and IPL it.

A very common way of setting up a boot server has been defined
by PXELINUX, an open source implementation of PXE. With PXELINUX
the bootfile is a small network boot loader that will retrieve
a potentially client-specific configuration file containing
further instructions for the final boot process (kernel, ramdisk,...).

The set of sample scripts contained in the netboot directory provide
directions for a Linux distributor or a boot server administrator
on how to build a network boot image usable for a simplified
PXELINUX-style network boot setup for s390.

Note that the sample scripts are implementing only a subset of PXELINUX
functionality, specifically the config file parsing. In order to
get full functionality, a more specialized boot loader program
like petitboot or pxe-kexec must be used in the ramdisk.

Further, a sample Dockerfile is provided along with instructions on how
to build the network boot image in a Docker container.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
2017-08-31 17:41:15 +02:00

47 lines
1.3 KiB
Makefile

# Sample Makefile to produce a pxe-style netboot image
# matching the currently active kernel.
# If the image is to be build for a different kernel version
# the KERNEL_VERSION variable must be overridden
# To use a local busybox installation, change BBINSTALL
# to point to the local busybox install path
ifeq ("$(KERNEL_VERSION)","")
KERNEL_VERSION=$(shell uname -r)
endif
export KERNEL_VERSION
filetype=$(shell file $1 | grep "Linux S390")
s390_check=$(if $(call filetype,$1), $1)
prefixes=image vmlinux vmlinuz
kernel_images=$(foreach prefix, $(prefixes), \
$(call s390_check,/boot/$(prefix)-$(KERNEL_VERSION)))
KERNEL_IMAGE=$(firstword $(kernel_images))
ifeq ($(KERNEL_IMAGE),)
$(error Could not find a kernel image under /boot)
endif
BUSYBOX=busybox-1.27.1
BBINSTALL=$(BUSYBOX)/_install
all: $(KERNEL_IMAGE) pxelinux.initramfs
/bin/bash mk-s390image $(KERNEL_IMAGE) pxelinux.0 -r pxelinux.initramfs
pxelinux.initramfs: $(BBINSTALL)
/bin/bash mk-pxelinux-ramfs -b $< -k $(KERNEL_VERSION) $@
$(BUSYBOX)/_install:
wget https://busybox.net/downloads/$(BUSYBOX).tar.bz2
tar xjf $(BUSYBOX).tar.bz2
make -C $(BUSYBOX) defconfig
make -C $(BUSYBOX) install
install:
clean:
$(RM) pxelinux.0 pxelinux.initramfs $(BUSYBOX).tar.bz2
$(RM) -r $(BUSYBOX)
.PHONY: all install clean