From f44dc01eee65c3ed232f4acb2a1ee57c87164b88 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Stelmach?= Date: Fri, 24 Nov 2023 11:55:12 +0100 Subject: [PATCH] scripts: add support for "swap" filesystem type MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Run mkswap(8) for partitions with have their fstype set to "swap". x86 emulator images require swap partition to be present. Change-Id: Ia8e9be666f1f2c587396b8e11bf515d02370a2ad Signed-off-by: Łukasz Stelmach --- scripts/tizen/sd_fusing.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/tizen/sd_fusing.py b/scripts/tizen/sd_fusing.py index 3952681..e6b5877 100755 --- a/scripts/tizen/sd_fusing.py +++ b/scripts/tizen/sd_fusing.py @@ -473,6 +473,15 @@ def mkpart(args, target): if proc.returncode != 0: log.error(f"Failed to create ext4 filesystem on {d}") sys.exit(1) + elif part['fstype'] == 'swap': + argv = ['mkswap', '-L', part['name'], d] + logging.debug(" ".join(argv)) + proc = subprocess.run(argv, + stdin=subprocess.DEVNULL, + stdout=None, stderr=None) + if proc.returncode != 0: + log.error(f"Failed to format swap partition {d}") + sys.exit(1) elif part['fstype'] == 'raw': pass target.initialize_parameters() -- 2.7.4