[SLOF] [PATCH v2 0/4] Block write support for SCSI and virtio-block disks

Thomas Huth thuth at redhat.com
Wed Nov 16 00:02:48 AEDT 2016

GRUB2 uses a file called grubenv in the boot partition to store certain
information like which kernel should be booted the next time (see
for details). If the user set the "next_entry" variable here, e.g. with
the "grub2-reboot" command under Linux, the corresponding kernel should
only be booted once, so the GRUB2 bootloader has to update the grubenv
file on the boot partition to avoid that it is booted again after the next
reboot. That means GRUB2 needs write support at the firmware layer!
This patch series implements this block write support in SLOF, so that
the "grub2-reboot" command now works with SLOF as with other firmware
implementations (i.e. the grubenv file is updated after the kernel that
should be booted only once has been selected).

- Write access to the first 34 sectors is now not allowed anymore, to
  avoid that the user / client program accidentially destroys the
  partition table
- Print the transfer type in virtioblk_transfer() in case of errors, too,
  to provide some more information for debugging

Thomas Huth (4):
  deblocker: Add a 'write' function
  scsi: Add SCSI block write support
  virtio: Implement block write support
  Provide "write" function in the disk-label package

 board-qemu/slof/virtio-block.fs | 13 +++++++++
 lib/libvirtio/virtio-blk.c      | 27 ++++++++++---------
 lib/libvirtio/virtio-blk.h      |  3 ++-
 lib/libvirtio/virtio.code       | 11 +++++++-
 lib/libvirtio/virtio.in         |  1 +
 slof/fs/packages/deblocker.fs   | 21 +++++++++++++++
 slof/fs/packages/disk-label.fs  |  5 ++++
 slof/fs/scsi-disk.fs            | 38 +++++++++++++++++++++++++++
 slof/fs/scsi-support.fs         | 58 +++++++++++++++++++++++++++++++++++++++++
 9 files changed, 163 insertions(+), 14 deletions(-)


More information about the SLOF mailing list