@@ -18,6 +18,10 @@ SRC_URI_append_secureboot = " \
DEPENDS_append_secureboot = " optee-os-${MACHINE}"
+do_prepare_build_append_secureboot() {
+ sed -i 's/CONFIG_BOOTCOMMAND="/CONFIG_BOOTCOMMAND="fatload virtio 1:1 40000000 db\.auth; setenv -e -nv -bs -rt -at -i 40000000:\$filesize db; /g' ${S}/configs/${U_BOOT_CONFIG}
+}
+
do_deploy[dirs] = "${DEPLOY_DIR_IMAGE}"
do_deploy() {
dpkg --fsys-tarfile "${WORKDIR}/u-boot-${MACHINE}_${PV}_${DISTRO_ARCH}.deb" | \
@@ -32,3 +32,22 @@ do_install() {
do_prepare_build_append() {
echo "Provides: secure-boot-secrets" >> ${S}/debian/control
}
+
+do_build_append() {
+ if [ "${MACHINE}" = "qemu-arm64" ]; then
+ cert-to-efi-sig-list -g 11111111-2222-3333-4444-123456789abc "${WORKDIR}/${SB_CERT}" "${WORKDIR}/secure-boot.esl"
+ sign-efi-sig-list -c "${WORKDIR}/${SB_CERT}" -k "${WORKDIR}/${SB_KEY}" db "${WORKDIR}/secure-boot.esl" "${WORKDIR}/db.auth"
+ fi
+}
+
+do_deploy[dirs] = "${DEPLOY_DIR_IMAGE}"
+do_deploy() {
+ if [ "${MACHINE}" = "qemu-arm64" ]; then
+ DTARGET=${DEPLOY_DIR_IMAGE}/keys
+ mkdir -p ${DTARGET}
+
+ cp ${WORKDIR}/db.auth ${DTARGET}/db.auth
+ fi
+}
+
+addtask deploy after do_dpkg_build before do_deploy_deb
\ No newline at end of file
@@ -183,7 +183,8 @@ if [ -n "${SECURE_BOOT}${SWUPDATE_BOOT}" ]; then
${QEMU_PATH}${QEMU} \
-drive file=${IMAGE_PREFIX}.wic,discard=unmap,if=none,id=disk,format=raw \
-bios ${u_boot_bin} \
- ${QEMU_COMMON_OPTIONS} "$@"
+ ${QEMU_COMMON_OPTIONS} "$@" \
+ -hdb fat:rw:./build/tmp/deploy/images/qemu-${QEMU_ARCH}/keys
;;
*)
echo "Unsupported architecture: ${arch}"