Features/S390xNetworkBoot: Difference between revisions

From QEMU
Line 12: Line 12:


<code>
<code>
   qemu-system-s390x ... -device virtio-net-ccw,netdev=hostnet0,id=net0,mac=52:54:00:2d:b5:b5,devno=fe.0.0001,bootindex=1
   qemu-system-s390x ... -device virtio-net-ccw,netdev=hostnet0,id=net0,bootindex=1
</code>
</code>


Line 20: Line 20:
   ...
   ...
   <interface type='network'>
   <interface type='network'>
    <mac address='52:54:00:2d:b5:b5'/>
     <source network='default'/>
     <source network='default'/>
     <model type='virtio'/>
     <model type='virtio'/>
    <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
     <boot order='1'>
     <boot order='1'>
   </interface>
   </interface>

Revision as of 14:17, 12 September 2017

This is a short overview about using network boot for s390x.

Overview

The network boot feature enhances the s390x ipl device and the s390-ccw bios with support for booting via a virtio-net boot device. A new address is added to the ccw ipl block providing the address of a s390-netboot.img (effectively a network boot ROM) which performs the actual load over the network. This code has been included into QEMU since 2.9.

Starting with 2.10 QEMU includes a pre-built network boot ROM based on the SLOF firmware, enabling network booting from a DHCP/TFTP server. As s390 network bootable operating system images are not very common at this point in time, this document also gives a brief overview on how to build one.

Booting from a network interface

The network boot can't be triggered using the traditional -boot n command line option, but requires to specify the bootindex attribute on the network device. E.g.,

  qemu-system-s390x ... -device virtio-net-ccw,netdev=hostnet0,id=net0,bootindex=1

or, with libvirt

  ...
  <interface type='network'>
    <source network='default'/>
    <model type='virtio'/>
    <boot order='1'>
  </interface>
  ...

Building a s390 network bootable binary

A s390 operating system image usable for network booting can be built from an initial ramdisk and a kernel image. These can be taken from any existing s390 system.

One way to build an image is to take a kernel and an installer initial ramdisk from a distribution's DVD/ISO and concatenate them. Some fixups are necessary in the new binary. Both, concatenation and fixups can be done by using the script in [1]. Booting the resulting image would then start the installation process as if booted from the DVD.

Another possible way is to build a binary that behaves similar to the PXELINUX boot loader. In this case an initial ramdisk with an init process triggering the PXELINUX-like processing has to be built as described in [2]. The site also contains a script assisting in the creation of such an initial ramdisk.