From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: qemu-devel@nongnu.org
Cc: borntraeger@de.ibm.com, agraf@suse.de, jfrei@linux.vnet.ibm.com,
Cornelia Huck <cornelia.huck@de.ibm.com>
Subject: [Qemu-devel] [PATCH 0/5] s390x: network boot
Date: Mon, 20 Feb 2017 15:19:38 +0100 [thread overview]
Message-ID: <20170220141943.8426-1-cornelia.huck@de.ibm.com> (raw)
This patchset implements network boot for s390x. You need to build
a s390-netboot.img to actually perform the work (not included).
Basically, we add support for virtio-net devices into the ipl code
and update the ccw bios to handle this as well.
For the first patch (elf loading) I'd like to get an ack.
A s390-netboot.img can be built by bundling some shell scripts, busybox
and the kexec binary bundled into an initial ramdisk and append that to
a kernel image. An existing s390 system can be used as source.
The init process can be a simple shell script that mounts a few
essential filesystems, like /dev, /proc, /sys, ..., starts a DHCP client
(busybox udchpc) and then invokes another script to do the actual
network boot.
udchpc will invoke the script /usr/share/udhcpc/default.script in
response to DHCP server messages to configure interfaces. The sample
busybox default.script can be used for that, but needs to also extract
the DHCP options like the tftp server address and pass that on to the
boot script.
The boot script itself has to retrieve the PXELINUX configuration from
the tftp server as in [1], then retrieve the remote kernel and initial
ramdisk and finally use kexec to boot the network kernel.
In a nutshell:
1. Create a skeleton initramfs directory structure
2. Create the init script, the PXE boot scripts and the DHCP default
script
3. Copy kexec and its dependencies from the source system into the
initramfs
4. Copy virtio network and block modules from the source system into
the initramfs
5. Copy the busybox binaries into the initramfs
6. Build the ramdisk (in compressed CPIO format)
7. Concatenate the kernel image and the initial ramdisk
8. Update the 8 bytes at location 66568 with the offset value of the
ramdisk in the new binary, and the 8 bytes at location 66576 with the
size of the ramdisk. Both values need to be updated in binary, big
endian format.
[1]
http://www.syslinux.org/wiki/index.php?title=PXELINUX#Configuration_filename
Cornelia Huck (1):
pc-bios/s390-ccw.img: rebuild image
Farhan Ali (4):
elf-loader: Allow late loading of elf
s390x/ipl: Extend S390IPLState to support network boot
s390x/ipl: Load network boot image
pc-bios/s390-ccw: Use the ccw bios to start the network boot
hw/core/loader.c | 17 +++++++--
hw/s390x/ipl.c | 87 +++++++++++++++++++++++++++++++++++++++++++++
hw/s390x/ipl.h | 5 ++-
hw/s390x/s390-virtio-ccw.c | 3 +-
hw/s390x/s390-virtio.c | 2 ++
hw/s390x/s390-virtio.h | 1 +
include/hw/elf_ops.h | 13 ++++---
include/hw/loader.h | 13 ++++++-
pc-bios/s390-ccw.img | Bin 26392 -> 26456 bytes
pc-bios/s390-ccw/bootmap.c | 8 ++++-
pc-bios/s390-ccw/iplb.h | 3 +-
pc-bios/s390-ccw/main.c | 20 +++++++----
pc-bios/s390-ccw/virtio.c | 1 +
pc-bios/s390-ccw/virtio.h | 1 +
14 files changed, 157 insertions(+), 17 deletions(-)
--
2.11.0
next reply other threads:[~2017-02-20 14:20 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-20 14:19 Cornelia Huck [this message]
2017-02-20 14:19 ` [Qemu-devel] [PATCH 1/5] elf-loader: Allow late loading of elf Cornelia Huck
2017-02-20 15:33 ` Thomas Huth
2017-02-21 10:13 ` Cornelia Huck
2017-02-21 10:23 ` Christian Borntraeger
2017-02-24 10:44 ` Thomas Huth
2017-02-24 11:09 ` Christian Borntraeger
2017-02-24 11:13 ` Thomas Huth
2017-02-24 14:21 ` Farhan Ali
2017-02-24 18:23 ` Thomas Huth
2017-02-20 14:19 ` [Qemu-devel] [PATCH 2/5] s390x/ipl: Extend S390IPLState to support network boot Cornelia Huck
2017-02-20 14:19 ` [Qemu-devel] [PATCH 3/5] s390x/ipl: Load network boot image Cornelia Huck
2017-02-20 15:28 ` Thomas Huth
2017-02-22 15:01 ` Farhan Ali
2017-02-24 10:11 ` Thomas Huth
2017-02-24 11:15 ` Christian Borntraeger
2017-02-24 14:24 ` Farhan Ali
2017-02-20 14:19 ` [Qemu-devel] [PATCH 4/5] pc-bios/s390-ccw: Use the ccw bios to start the network boot Cornelia Huck
2017-02-20 14:19 ` [Qemu-devel] [PATCH 5/5] pc-bios/s390-ccw.img: rebuild image Cornelia Huck
2017-02-20 15:43 ` [Qemu-devel] [PATCH 0/5] s390x: network boot Thomas Huth
2017-02-20 16:01 ` Alexander Graf
2017-02-21 13:35 ` Viktor Mihajlovski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170220141943.8426-1-cornelia.huck@de.ibm.com \
--to=cornelia.huck@de.ibm.com \
--cc=agraf@suse.de \
--cc=borntraeger@de.ibm.com \
--cc=jfrei@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.