From: Łukasz Stelmach Date: Fri, 24 Nov 2023 10:59:45 +0000 (+0100) Subject: scripts: support x86 emulator images for QEMU X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=67d8f2e652d0cb235dc071f6b6df55461a5cc4c7;p=platform%2Fkernel%2Ftizen-fusing-scripts.git scripts: support x86 emulator images for QEMU Change-Id: I24261d9dbc2926e1d0b7b39402269a09b48dd82b Signed-off-by: Łukasz Stelmach --- diff --git a/sd_fusing.py b/sd_fusing.py index e6b5877..16867a9 100755 --- a/sd_fusing.py +++ b/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):