From 0975aaa518fbfb1bb588cd592b91b7ad3d2fd2e7 Mon Sep 17 00:00:00 2001
From: Zygmunt Krynicki <zygmunt.krynicki@huawei.com>
Date: Tue, 15 Feb 2022 12:57:34 +0000
Subject: [PATCH] wic: add x-gpt-efi-disk workspace file

This file is derived from QEMU+EFI file we already have while having
wider scope of supporting both virtual and physical machines alike.

The partition table is GPT and the boot system is based on EFI. The
EFI_PROVIDER variable can be used to select either grub or systemd-boot.

Over time the qemu-specific workspace files will be deprecated and
removed. This step makes the transition easier to process.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@huawei.com>
---
 meta-oniro-core/wic/x-gpt-efi-disk.wks.in | 25 +++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 meta-oniro-core/wic/x-gpt-efi-disk.wks.in

diff --git a/meta-oniro-core/wic/x-gpt-efi-disk.wks.in b/meta-oniro-core/wic/x-gpt-efi-disk.wks.in
new file mode 100644
index 00000000..cf22f32b
--- /dev/null
+++ b/meta-oniro-core/wic/x-gpt-efi-disk.wks.in
@@ -0,0 +1,25 @@
+# SPDX-FileCopyrightText: Huawei Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# short-description: Creates a GPT-partitioned disk with EFI bootloader
+# long-description: The created disk is universal, and applies to physical and
+# virtual machines alike. The particular bootloader can be controlled with
+# EFI_PROVIDER.
+#
+# Disk layout:
+#  -- ------ ------- ------- --------- --------- ---------
+# |  | boot | sys-a | sys-b | devdata | sysdata | appdata |
+#  -- ------ ------- ------- --------- --------- ---------
+# ^  ^
+# |  |
+# 0  4096KiB
+
+bootloader --ptable gpt --timeout=${WIC_BOOTLOADER_TIMEOUT} --append=" rootfstype=${ROOT_FSTYPE} "
+
+part --source bootimg-efi --sourceparams="loader=${EFI_PROVIDER}" --label ${BOOT_PARTITION_LABEL} --label boot --active --align 4096 --offset 4096 --fixed-size ${BOOT_PARTITION_SIZE}
+${WIC_ROOTA_PARTITION}
+${WIC_ROOTB_PARTITION}
+${WIC_DEVDATA_PARTITION}
+${WIC_SYSDATA_PARTITION}
+${WIC_APPDATA_PARTITION}
-- 
GitLab