From 4fac99e23ebd07485a986fc011cf3d8c845e697e Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Stelmach?= Date: Fri, 24 Nov 2023 11:59:45 +0100 Subject: [PATCH] scripts: support x86 emulator images for QEMU MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: I24261d9dbc2926e1d0b7b39402269a09b48dd82b Signed-off-by: Łukasz Stelmach --- scripts/tizen/sd_fusing.py | 40 +++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/scripts/tizen/sd_fusing.py b/scripts/tizen/sd_fusing.py index e6b5877678..16867a90ca 100755 --- a/scripts/tizen/sd_fusing.py +++ b/scripts/tizen/sd_fusing.py @@ -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): -- 2.34.1