summaryrefslogtreecommitdiffstats
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-03-01 11:17:44 +0000
commit5d30fc4996c5eaaff9aed6c1acd8f3f222f6f742 (patch)
tree1ef6d7ba0961a39756d3314f44fbb37084ba33dd
parentbf7411cb4b29255bf5698e0289261c9c26327b02 (diff)
downloadpoky-5d30fc4996c5eaaff9aed6c1acd8f3f222f6f742.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. (From OE-Core rev: 6f84653e34b75a821fbf31b9f1aa912858e27f43) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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 \
12 12
13SRCREV="4575a602ca6072ee9d04150b38bfb143cbff8588" 13SRCREV="4575a602ca6072ee9d04150b38bfb143cbff8588"
14 14
15inherit deploy
16
15PARALLEL_MAKE = "" 17PARALLEL_MAKE = ""
16 18
17S = "${WORKDIR}/git" 19S = "${WORKDIR}/git"
18 20
19DEPENDS_class-native="util-linux-native iasl-native ossp-uuid-native" 21DEPENDS_class-native="util-linux-native iasl-native ossp-uuid-native qemu-native"
20 22
21DEPENDS_class-target="ovmf-native" 23DEPENDS_class-target="ovmf-native"
22 24
@@ -97,9 +99,22 @@ do_compile_class-target() {
97 OVMF_ARCH="IA32" 99 OVMF_ARCH="IA32"
98 fi 100 fi
99 101
102 # ${WORKDIR}/ovmf is a well-known location where do_install and
103 # do_deploy will be able to find the files.
104 rm -rf ${WORKDIR}/ovmf
105 mkdir ${WORKDIR}/ovmf
106 OVMF_DIR_SUFFIX="X64"
107 if [ "${TARGET_ARCH}" != "x86_64" ] ; then
108 OVMF_DIR_SUFFIX="Ia32" # Note the different capitalization
109 fi
100 FIXED_GCCVER=$(fixup_target_tools ${GCC_VER}) 110 FIXED_GCCVER=$(fixup_target_tools ${GCC_VER})
101 echo FIXED_GCCVER is ${FIXED_GCCVER} 111 bbnote FIXED_GCCVER is ${FIXED_GCCVER}
112 build_dir="${S}/Build/Ovmf$OVMF_DIR_SUFFIX/RELEASE_${FIXED_GCCVER}"
113
102 ${S}/OvmfPkg/build.sh -a $OVMF_ARCH -b RELEASE -t ${FIXED_GCCVER} 114 ${S}/OvmfPkg/build.sh -a $OVMF_ARCH -b RELEASE -t ${FIXED_GCCVER}
115 ln ${build_dir}/FV/OVMF.fd ${WORKDIR}/ovmf/ovmf.fd
116 ln ${build_dir}/FV/OVMF_CODE.fd ${WORKDIR}/ovmf/ovmf.code.fd
117 ln ${build_dir}/FV/OVMF_VARS.fd ${WORKDIR}/ovmf/ovmf.vars.fd
103} 118}
104 119
105do_install_class-native() { 120do_install_class-native() {
@@ -108,16 +123,21 @@ do_install_class-native() {
108} 123}
109 124
110do_install_class-target() { 125do_install_class-target() {
111 OVMF_DIR_SUFFIX="X64" 126}
112 if [ "${TARGET_ARCH}" != "x86_64" ] ; then
113 OVMF_DIR_SUFFIX="Ia32" # Note the different capitalization
114 fi
115 install -d ${D}${datadir}/ovmf
116 127
117 FIXED_GCCVER=$(fixup_target_tools ${GCC_VER}) 128do_deploy() {
118 build_dir="${S}/Build/Ovmf$OVMF_DIR_SUFFIX/RELEASE_${FIXED_GCCVER}" 129}
119 install -m 0755 ${build_dir}/FV/OVMF.fd \ 130do_deploy[cleandirs] = "${DEPLOYDIR}"
120 ${D}${datadir}/ovmf/bios.bin 131do_deploy_class-target() {
132 # For use with "runqemu ovmf".
133 for i in \
134 ovmf \
135 ovmf.code \
136 ovmf.vars \
137 ; do
138 qemu-img convert -f raw -O qcow2 ${WORKDIR}/ovmf/$i.fd ${DEPLOYDIR}/$i.qcow2
139 done
121} 140}
141addtask do_deploy after do_compile before do_build
122 142
123BBCLASSEXTEND = "native" 143BBCLASSEXTEND = "native"