summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorNeil Williams <codehelp@debian.org>2015-08-18 13:11:58 +0200
committerNeil Williams <codehelp@debian.org>2015-08-31 18:00:26 +0100
commitaa0972e2c62feff98273c6a1575e148817b2fe0e (patch)
tree71a4cb25a80c57438988229ee326e9baa0139196 /examples
parentbc7ef0f9a3df88424ab594fe13a4322b408f6718 (diff)
downloadvmdebootstrap-aa0972e2c62feff98273c6a1575e148817b2fe0e.tar.gz
Add examples for UEFI hook.
Document task package usage in the README
Diffstat (limited to 'examples')
-rw-r--r--examples/README.txt50
-rwxr-xr-xexamples/jessie-uefi-amd64.sh15
-rwxr-xr-xexamples/qemu-efi-bochs-drm.sh8
3 files changed, 73 insertions, 0 deletions
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
+