summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/ovmf
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2016-12-16 15:07:29 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-02-28 11:26:32 +0000
commit6f84653e34b75a821fbf31b9f1aa912858e27f43 (patch)
tree1c305269d599c1fb8b6cc58b848b4cb1c4a56900 /meta/recipes-core/ovmf
parent92198bdda7add49f2c76ce55ab1f310e2128bf8f (diff)
downloadopenembedded-core-contrib-6f84653e34b75a821fbf31b9f1aa912858e27f43.tar.gz
ovmf: deploy firmware in image directory
When used with '-drive if=pflash', qemu will store UEFI variables inside the firmware image file. That is unexpected for a file located in the sysroot, which should be read-only, while it is normal for image files in the deploy/images directory. Therefore that directory is a better place for use with runqemu. The name was chose so that "runqemu ovmf" can be used as shorthand for "runqemu <full path>/ovmf.qcow2" by treating "ovmf" as the base name of the firmware file. "ovmf.secboot.qcow2" is meant to be used for the Secure Boot enabled firmware. qcow2 is used because it is needed for "savevm" snapshots of a virtual machine. With code and variables stored in the same ovmf.qcow2 it is not possible to update the firmware code without also overwriting the variables. For users who care about persistent variables, the code and variables are also provided as separate files, in ovmf.code.qcow2 and ovmf.vars.qcow2. The traditional usage of OVMF via the qemu bios parameter ("biosdir" and/or "biosfilename" in runqemu) is no longer recommended, and therefore this recipe no longer provides the bios.bin file. Instead, OVMF is meant to be used as flash drive in qemu. See the "runqemu: support UEFI with OVMF firmware" patch for details on how to use OVMF that way. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Diffstat (limited to 'meta/recipes-core/ovmf')
-rw-r--r--meta/recipes-core/ovmf/ovmf_git.bb42
1 files changed, 31 insertions, 11 deletions
diff --git a/meta/recipes-core/ovmf/ovmf_git.bb b/meta/recipes-core/ovmf/ovmf_git.bb
index 13b583b05d..895ed6cfee 100644
--- a/meta/recipes-core/ovmf/ovmf_git.bb
+++ b/meta/recipes-core/ovmf/ovmf_git.bb
@@ -12,11 +12,13 @@ SRC_URI = "git://github.com/tianocore/edk2.git;branch=master \
SRCREV="4575a602ca6072ee9d04150b38bfb143cbff8588"
+inherit deploy
+
PARALLEL_MAKE = ""
S = "${WORKDIR}/git"
-DEPENDS_class-native="util-linux-native iasl-native ossp-uuid-native"
+DEPENDS_class-native="util-linux-native iasl-native ossp-uuid-native qemu-native"
DEPENDS_class-target="ovmf-native"
@@ -97,9 +99,22 @@ do_compile_class-target() {
OVMF_ARCH="IA32"
fi
+ # ${WORKDIR}/ovmf is a well-known location where do_install and
+ # do_deploy will be able to find the files.
+ rm -rf ${WORKDIR}/ovmf
+ mkdir ${WORKDIR}/ovmf
+ OVMF_DIR_SUFFIX="X64"
+ if [ "${TARGET_ARCH}" != "x86_64" ] ; then
+ OVMF_DIR_SUFFIX="Ia32" # Note the different capitalization
+ fi
FIXED_GCCVER=$(fixup_target_tools ${GCC_VER})
- echo FIXED_GCCVER is ${FIXED_GCCVER}
+ bbnote FIXED_GCCVER is ${FIXED_GCCVER}
+ build_dir="${S}/Build/Ovmf$OVMF_DIR_SUFFIX/RELEASE_${FIXED_GCCVER}"
+
${S}/OvmfPkg/build.sh -a $OVMF_ARCH -b RELEASE -t ${FIXED_GCCVER}
+ ln ${build_dir}/FV/OVMF.fd ${WORKDIR}/ovmf/ovmf.fd
+ ln ${build_dir}/FV/OVMF_CODE.fd ${WORKDIR}/ovmf/ovmf.code.fd
+ ln ${build_dir}/FV/OVMF_VARS.fd ${WORKDIR}/ovmf/ovmf.vars.fd
}
do_install_class-native() {
@@ -108,16 +123,21 @@ do_install_class-native() {
}
do_install_class-target() {
- OVMF_DIR_SUFFIX="X64"
- if [ "${TARGET_ARCH}" != "x86_64" ] ; then
- OVMF_DIR_SUFFIX="Ia32" # Note the different capitalization
- fi
- install -d ${D}${datadir}/ovmf
+}
- FIXED_GCCVER=$(fixup_target_tools ${GCC_VER})
- build_dir="${S}/Build/Ovmf$OVMF_DIR_SUFFIX/RELEASE_${FIXED_GCCVER}"
- install -m 0755 ${build_dir}/FV/OVMF.fd \
- ${D}${datadir}/ovmf/bios.bin
+do_deploy() {
+}
+do_deploy[cleandirs] = "${DEPLOYDIR}"
+do_deploy_class-target() {
+ # For use with "runqemu ovmf".
+ for i in \
+ ovmf \
+ ovmf.code \
+ ovmf.vars \
+ ; do
+ qemu-img convert -f raw -O qcow2 ${WORKDIR}/ovmf/$i.fd ${DEPLOYDIR}/$i.qcow2
+ done
}
+addtask do_deploy after do_compile before do_build
BBCLASSEXTEND = "native"