From aa0972e2c62feff98273c6a1575e148817b2fe0e Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Tue, 18 Aug 2015 13:11:58 +0200 Subject: Add examples for UEFI hook. Document task package usage in the README --- examples/README.txt | 50 ++++++++++++++++++++++++++++++++++++++++++ examples/jessie-uefi-amd64.sh | 15 +++++++++++++ examples/qemu-efi-bochs-drm.sh | 8 +++++++ 3 files changed, 73 insertions(+) create mode 100755 examples/jessie-uefi-amd64.sh create mode 100755 examples/qemu-efi-bochs-drm.sh (limited to 'examples') diff --git a/examples/README.txt b/examples/README.txt index cde28cf..65e6bd9 100644 --- a/examples/README.txt +++ b/examples/README.txt @@ -30,3 +30,53 @@ CubieTruck ---------- Currently untested and lacking u-boot support. + +QEMU and EFI +------------ + +The bochs-drm kernel driver can be a problem when testing UEFI images, +even headless ones, causing systemd to halt before a login prompt is +offered. + +vmdebootstrap includes a simple customisation script which blacklists +the bochs-drm module. Use, copy or extend this script for any image +which uses UEFI and which should be testable using QEMU. + +To run UEFI with QEMU, the ovmf package needs to be installed from +non-free (due to patent issues with VFAT) and the -L option used to +QEMU to indicate the directory containing the EFI firmware to use. +For amd64, the firmware installed by ovmf can need to be renamed +(or symlinked) as /usr/share/ovmf/bios-256k.bin - then supply the +-L option to QEMU: + +$ qemu-system-x86_64 -machine accel=kvm -m 4096 -smp 2 -drive format=raw,file=test.img -L /usr/share/ovmf/ + +debootstrap and task packages +----------------------------- + +debootstrap is designed to be a minimalist tool and vmdebootstrap +wraps this support without substantial changes. Task packages are +the simplest way to extend a minimal bootstrap to a more general +purpose machine but there are limitations. debootstrap does not +handle Recommended packages, so installing a task package using +the --package support of vmdebootstrap (just as with the --include +support of debootstrap itself) may result in a system with fewer +packages installed than expected. Such systems can have the extra +packages identified after boot using graphical tools like aptitude +but to have all packages available during the creation of the image, +a customisation hook is required. The hook simply needs to install +the task package using apt instead of passing the task package to +--package. This allows apt to do all the normal Recommends calculations +and results in all of the extra packages being installed in one +operation. However, the apt source used for this will be the apt +source specified to vmdebootstrap for use after the system is booted, +so you may also want to extend the hook to temporarily reinstate a +local mirror (as used for the bootstrap phase) and put the other +mirror back at the end of the hook. + +Examples of such hooks are available here: +http://anonscm.debian.org/cgit/debian-cd/pettersson-live.git/tree/vmdebootstrap + +(These will need modification for other uses as the hooks expect +a particular filesystem layout only useful for debian-cd.) + diff --git a/examples/jessie-uefi-amd64.sh b/examples/jessie-uefi-amd64.sh new file mode 100755 index 0000000..0578450 --- /dev/null +++ b/examples/jessie-uefi-amd64.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -e + +WHO=`whoami` +sudo vmdebootstrap --owner ${WHO} --verbose \ + --sudo --lock-root-password \ + --enable-dhcp --configure-apt \ + --log amd64-uefi.log --log-level debug \ + --size 5G --distribution jessie \ + --grub --use-uefi \ + --package task-xfce-desktop \ + --customize ./examples/qemu-efi-bochs-drm.sh \ + "$@" + diff --git a/examples/qemu-efi-bochs-drm.sh b/examples/qemu-efi-bochs-drm.sh new file mode 100755 index 0000000..d7b7a58 --- /dev/null +++ b/examples/qemu-efi-bochs-drm.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -e + +rootdir=$1 + +echo "blacklist bochs-drm" > $rootdir/etc/modprobe.d/qemu-blacklist.conf + -- cgit v1.2.1