scripts: support x86 emulator images for QEMU 46/301846/2 accepted/tizen/unified/20231211.095412 accepted/tizen/unified/riscv/20231215.050220
authorŁukasz Stelmach <l.stelmach@samsung.com>
Fri, 24 Nov 2023 10:59:45 +0000 (11:59 +0100)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 27 Nov 2023 01:53:24 +0000 (01:53 +0000)
Change-Id: I24261d9dbc2926e1d0b7b39402269a09b48dd82b
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
scripts/tizen/sd_fusing.py

index e6b5877..16867a9 100755 (executable)
@@ -364,12 +364,50 @@ class RV64(SdFusingTarget):
 class VF2(RV64):
     long_name = "VisionFive2"
 
+class X86emu(SdFusingTarget):
+    part_table = [
+        {"size": 512,    "fstype": "vfat",  "name": "EFI", "start": 4,
+         "ptype": "C12A7328-F81F-11D2-BA4B-00A0C93EC93B",
+         "binaries": ""},
+        {"size": 512,    "fstype": "ext2",  "name": "boot",
+         "binaries": "emulator-boot.img",},
+        {"size": 2048,  "fstype": "ext4", "name": "rootfs",
+         "binaries": "emulator-rootfs.img"},
+        {"size": 1344, "fstype": "ext4", "name": "system-data",
+         "binaries": "emulator-sysdata.img"},
+        {"size": 1024, "fstype": "swap", "name": "emulator-swap",
+         "ptype": "0657FD6D-A4AB-43C4-84E5-0933C84B4F4F"},
+    ]
+
+    def __init__(self, device, args):
+        super().__init__(device, 'gpt')
+        for p in self.label.part_table:
+            if p.name == "rootfs":
+                p.ptype = args._rootfs_uuid
+                break
+
+class X86emu32(X86emu):
+    long_name = "QEMU x86 32-bit"
+
+    def __init__(self, device, args):
+        setattr(args, "_rootfs_uuid", "44479540-F297-41B2-9AF7-D131D5F0458A")
+        super().__init__(device, args)
+
+class X86emu64(X86emu):
+    long_name = "QEMU x86 64-bit"
+
+    def __init__(self, device, args):
+        setattr(args, "_rootfs_uuid", "44479540-F297-41B2-9AF7-D131D5F0458A")
+        super().__init__(device, args)
+
 TARGETS = {
     'rpi3': Rpi3,
     'rpi4': Rpi4,
     'rpi4s': Rpi4Super,
     'vf2': VF2,
-    'rv64': RV64
+    'rv64': RV64,
+    'x86emu32': X86emu32,
+    'x86emu64': X86emu64,
 }
 
 def device_size(device):