From patchwork Thu Jul 31 08:27:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 67813 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC2B7C87FD2 for ; Thu, 31 Jul 2025 08:27:28 +0000 (UTC) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mx.groups.io with SMTP id smtpd.web10.56902.1753950444302269539 for ; Thu, 31 Jul 2025 01:27:24 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=nr10QnlJ; spf=pass (domain: smile.fr, ip: 209.85.128.65, mailfrom: yoann.congal@smile.fr) Received: by mail-wm1-f65.google.com with SMTP id 5b1f17b1804b1-4561514c7f0so1281385e9.0 for ; Thu, 31 Jul 2025 01:27:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1753950442; x=1754555242; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ocBHOlOu/xMMMJiOpYeIMVLPGLzAfwmp0e76wraa93w=; b=nr10QnlJdMdHW47CGT4BGqQbyz/OwsL71CDdrcOOf4haHmNEt9qYaAIYPLFZ3Q9o58 PC4BjYK+G7erPVePXHFhyHYUoVsIrYZfMRs4mc51ThXaby9qExb6c9tTpucnimUJWVi8 qKdzlHsMvfeznEiZQTbzBpHMeEV3snjc6pxZQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753950442; x=1754555242; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ocBHOlOu/xMMMJiOpYeIMVLPGLzAfwmp0e76wraa93w=; b=DYrAZnyrlG2DSmTmr2lYK6Xl0U9cJ5DlDcRNlEz/VSCQaRcJUXls2zOcCEmNQ1IZO3 GdDdBLEmAzv3uaRg4A/pl3up3hr2P+oBHRBaebSKdLS3usfXFyTu3HUu9E6pzdj5bfhB 4+0kNwGR0C2gJQ7khCMzKxEh5g5bFyJceQ0l9NMWqWX6JB0HAlIpluAGNHdzTe4FCkz4 EPtCifyYYa7zUzTd7ne5HU/aFuCVOnKy8IEpamD8n5zqYjtMln9b1iDHYyvkUVjJz28v xAWEEej4JqphN/Q1bUBgvuJ3m7m8whBUbp17AbhcAqh0MA5iUL6fzQ8knR6X1y23LH5/ rb3w== X-Gm-Message-State: AOJu0YwdJjoHIPwIHjDuOpvfY2oYlzifWd1GZyeLCRy8wtXoGaOKjXA8 7/xmwcWT+x2UuviC4er2YzH3mlNwi3lMmOMO2AsJE3ILCGWWuuaZcfJo2/IoPr5nPShloPfSpME ppUUuBQjVpYiH X-Gm-Gg: ASbGncvzrEnmKuO0DQv0oLABvI0sJ3TQyD8SUvZfIiwPEoZMdKiCbXE7d4GhJJIdyFc bRp+p9qSSWQHGHrC+VyjdOdy1UVgFRfPOtifl8Yn3dNw9MNB+3X2+R3BYfH6Y3l1XPVhF4195J+ mb/sY02TZ6E7LEbkZBs/Yi6L+2ZMeiMv9l2vMXROMUEPja/0jBbcPXybl/pJbBkW2aDhwDb2vrc 0aze3Fdx4fAZxnxONdw7XVCbwlMaFlmjxHVmRs6MbDGWk7hWAcFIFxihTXKdxarp3Q2QYnnfxRe 8+Uxz0Kb25pncQKNVMwseOqX0/8ii6S0hNWShD3C4yHZzv3L9/XjuNW+WzKNpM9Bo1LYQJl3qyb cjRRBr3EbSAx5ay/i32UICdUlnFPI9OALLxYseU4S5vnHGDdGBCKDgdGhLyeRImquHBwn0qv62U ySqNnl5OG7GlIbyqlAP1p8c68QALcH9XaEdfk= X-Google-Smtp-Source: AGHT+IGCe5jCNWufW9khPW5aaGluxNa8RQvwylgQsTihPBm4D8ZLjbijcwvkOPQnaz70MsgKn/0j5g== X-Received: by 2002:a05:600c:3ac9:b0:453:2066:4a26 with SMTP id 5b1f17b1804b1-45892bbf7e6mr62771165e9.16.1753950441975; Thu, 31 Jul 2025 01:27:21 -0700 (PDT) Received: from P-ASN-ECS-830T8C3.idf.intranet (static-css-ccs-204145.business.bouyguestelecom.com. [176.157.204.145]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c47908esm1562672f8f.59.2025.07.31.01.27.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Jul 2025 01:27:21 -0700 (PDT) From: Yoann Congal To: openembedded-core@lists.openembedded.org Cc: Yoann Congal , Lamine REHAHLIA Subject: [PATCH v3 1/4] runqemu: Add support for running compressed .zst rootfs images Date: Thu, 31 Jul 2025 10:27:04 +0200 Message-Id: <20250731082707.3481718-1-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 31 Jul 2025 08:27:28 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/221176 From: Lamine REHAHLIA Enhance runqemu to detect and decompress .zst-compressed rootfs images (e.g. ext4.zst, wic.zst) automatically. If a decompressed image already exists in the original directory, it will be reused to avoid overwriting build artifacts. Otherwise, the image is decompressed and removed after the QEMU session ends. This allows runqemu to be used seamlessly with compressed image formats generated by the build system or during releases. Note: support for .zst images is only available when snapshot mode is enabled IMPORTANT: This patch assumes that the original directory of the .zst-compressed image is writable. If, for some reason, the path passed from CI or another system to the script is read-only, the decompression step will fail when trying to write the uncompressed image to the same directory. Signed-off-by: Lamine REHAHLIA Signed-off-by: Yoann Congal --- v4: moved the feature to support calling "runqemu " and support usign snapshot after the image. Also improved the error message when a compressed image is used without snapshot mode. --- scripts/runqemu | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/scripts/runqemu b/scripts/runqemu index 3d77046972..c668906bdd 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -197,7 +197,7 @@ class BaseConfig(object): self.portlocks = {} self.bitbake_e = '' self.snapshot = False - self.wictypes = ('wic', 'wic.vmdk', 'wic.qcow2', 'wic.vdi', "wic.vhd", "wic.vhdx") + self.wictypes = ('wic.zst', 'wic', 'wic.vmdk', 'wic.qcow2', 'wic.vdi', "wic.vhd", "wic.vhdx") self.fstypes = ('ext2', 'ext3', 'ext4', 'jffs2', 'nfs', 'btrfs', 'cpio.gz', 'cpio', 'ramfs', 'tar.bz2', 'tar.gz', 'squashfs', 'squashfs-xz', 'squashfs-lzo', @@ -418,6 +418,48 @@ class BaseConfig(object): else: raise RunQemuError("Unknown path arg %s" % p) + def uncompress_rootfs(self): + """Decompress ZST rootfs image if needed""" + if not self.rootfs or not self.fstype.endswith('.zst'): + return + + # Ensure snapshot mode is active before allowing decompression. + if not self.snapshot: + raise RunQemuError(".zst images are only supported with snapshot mode. " \ + "You can either use the \"snapshot\" option or use an uncompressed image.") + + # Get the real path to the image to avoid issues when a symbolic link is passed. + # This ensures we always operate on the actual file. + image_path = os.path.realpath(self.rootfs) + # Extract target filename by removing .zst + image_dir = os.path.dirname(image_path) + uncompressed_name = os.path.basename(image_path).replace(".zst", "") + uncompressed_path = os.path.join(image_dir, uncompressed_name) + + # If the decompressed image already exists (e.g., in the deploy directory), + # we use it directly to avoid overwriting artifacts generated by the build system. + # This prevents redundant decompression and preserves build outputs. + if os.path.exists(uncompressed_path): + logger.warning(f"Found existing decompressed image: {uncompressed_path}, Using it directly.") + else: + logger.info(f"Decompressing {self.rootfs} to {uncompressed_path}") + # Ensure the 'zstd' tool is installed before attempting to decompress. + if not shutil.which('zstd'): + raise RunQemuError(f"'zstd' is required to decompress {self.rootfs} but was not found in PATH") + try: + with open(uncompressed_path, 'wb') as out_file: + subprocess.check_call(['zstd', '-d', '-c', image_path], stdout=out_file) + except subprocess.CalledProcessError as e: + self.cleanup_files.append(uncompressed_path) + raise RunQemuError(f"Failed to decompress {self.rootfs}: {e}") + + # Mark for deletion at the end + self.cleanup_files.append(uncompressed_path) + + # Use the decompressed image as the rootfs + self.rootfs = uncompressed_path + self.fstype = self.fstype.removesuffix(".zst") + def check_arg_machine(self, arg): """Check whether it is a machine""" if self.get('MACHINE') == arg: @@ -1762,6 +1804,7 @@ def main(): config.check_args() config.read_qemuboot() config.check_and_set() + config.uncompress_rootfs() # Check whether the combos is valid or not config.validate_combos() config.print_config() From patchwork Thu Jul 31 08:27:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 67815 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA259C87FD5 for ; Thu, 31 Jul 2025 08:27:28 +0000 (UTC) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mx.groups.io with SMTP id smtpd.web10.56903.1753950444691824574 for ; Thu, 31 Jul 2025 01:27:25 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=k5gMf34G; spf=pass (domain: smile.fr, ip: 209.85.128.65, mailfrom: yoann.congal@smile.fr) Received: by mail-wm1-f65.google.com with SMTP id 5b1f17b1804b1-455b00339c8so1134005e9.3 for ; Thu, 31 Jul 2025 01:27:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1753950443; x=1754555243; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2L4vWGSA29NlOV7m5A9foDo+jjLHx7PlDN4jNYyt4aU=; b=k5gMf34G9HRXIaOnGDuO+r08YIisFbko2s7QfxhBUFe7BgedzKzGH2+yDpl6OUmsC9 YqnICbWVzJ/I5A2VVajkhh1lXwcHxSFLFk09U8c33UzS+Pk2LfWo1yFw2dAVhNw8L9xx gdXGvoLB2CroFzYCLlKTmMEMCtYpLNhfwONA4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753950443; x=1754555243; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2L4vWGSA29NlOV7m5A9foDo+jjLHx7PlDN4jNYyt4aU=; b=pYDzepRQUn65ug0C4AqF0lMlOIjQzw1NvW69djUJY7nbO7pGI3qTR9hzKGEfvCbgwD gRMjaNbtvMB/v+RMG55kUagyeyMXdYy63mUD+3FNRiK7xcCK/wK+IdQ9pKDCVqXAbIGg c0EVufdL1bFsMLf786m9uYdcXINv8xJBnghrOaqb0rnb78gsxP+rz66XNA7qQqwBPNug zX5pIh/3zYvX879Z2Q2T4id7SdnhtwIh9bu3n2gMo0XVgJkvLufGXVK8C0Opcrd3jLO7 EWam8JTQqrgqdeo/pjuo2y0XmZJayOJivVoNNRD4ly/a1oF1xp9af0kyu+nsgWsklyfe Oz2Q== X-Gm-Message-State: AOJu0Yz2YFk5WHoDN64mfloUmhmaVhsAv62/FUlqx35vVjZDBy7OnNZq 2ZDu+NjakybU42SNc0yXTv0X9Dpg/5oBPmB5YNf10uIqySUXsNCd8nWuw/jS3G/NnZc6GUstwAu Xo7CBDM9yzqbm X-Gm-Gg: ASbGnctPXLu7IFV1XQCMcPN5IrmJAA972idiwAZ3UxwmdjUqY3h/8CGFWg9mk+344dn 9cuYCynw7LOdyxVwOmW44fQyDsO/xmPpaZrouzZqRTnsIo0L+SLFHjEod76jrpHtcSciHW6+8hU k5B06Qw1iNlXt8EwcPVOt00f6SnmynPVLRsFS8TlaIPWJB8FG26Un4MYNxFEDCiC+2K7S7QxCdk qso/8prlknGTNlGOw+WkN6zHzSgPR7FvzOBHXOpyPjSh6ecnkm3RYx2fhD/iwCtfUFVFTThd7kv CYqMjUan5JMh2TTd0kjWeQ9Qng/Mwboh7LEXL2WK9lMdwmDwvvHnsZN8cPjzCuL1HYEUYqzd2x5 LcRmLgVtSJliDmgUExYIrmf4f4li96cNjAbyGHbkhth42UD1DAAZN4Cgu04Fw1vxQg1ve5Cp20W NWXNcjbPT8wf2II1DUKsCeV+06J2CKgCt3UKA= X-Google-Smtp-Source: AGHT+IEFopsO71ML6m2s+HMv+nwWexv/UU/cOlqLJqWeSm19DANlzPe66b4A1v/7Bk6BwRrxIteiGw== X-Received: by 2002:a05:600c:3e0e:b0:455:f187:6203 with SMTP id 5b1f17b1804b1-458953e9f5bmr46621265e9.27.1753950442735; Thu, 31 Jul 2025 01:27:22 -0700 (PDT) Received: from P-ASN-ECS-830T8C3.idf.intranet (static-css-ccs-204145.business.bouyguestelecom.com. [176.157.204.145]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c47908esm1562672f8f.59.2025.07.31.01.27.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Jul 2025 01:27:22 -0700 (PDT) From: Yoann Congal To: openembedded-core@lists.openembedded.org Cc: Yoann Congal Subject: [PATCH v3 2/4] selftest: runqemu: add tests for booting zst compressed image Date: Thu, 31 Jul 2025 10:27:05 +0200 Message-Id: <20250731082707.3481718-2-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250731082707.3481718-1-yoann.congal@smile.fr> References: <20250731082707.3481718-1-yoann.congal@smile.fr> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 31 Jul 2025 08:27:28 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/221177 From: Yoann Congal Add a simple tests booting a compressed image given to runqemu as path and as image recipe name. Signed-off-by: Yoann Congal --- meta/lib/oeqa/selftest/cases/runqemu.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/meta/lib/oeqa/selftest/cases/runqemu.py b/meta/lib/oeqa/selftest/cases/runqemu.py index f01e1eec66..46ca0b4480 100644 --- a/meta/lib/oeqa/selftest/cases/runqemu.py +++ b/meta/lib/oeqa/selftest/cases/runqemu.py @@ -31,7 +31,7 @@ class RunqemuTests(OESelftestTestCase): if self.td["HOST_ARCH"] in ('i586', 'i686', 'x86_64'): self.fstypes += " iso hddimg" if self.machine == "qemux86-64": - self.fstypes += " wic.vmdk wic.qcow2 wic.vdi" + self.fstypes += " wic.vmdk wic.qcow2 wic.vdi wic.zst" self.cmd_common = "runqemu nographic" kvm = oe.types.qemu_use_kvm(get_bb_var('QEMU_USE_KVM'), self.td["TARGET_ARCH"]) @@ -152,6 +152,23 @@ SYSLINUX_TIMEOUT = "10" with open(qemu.qemurunnerlog) as f: self.assertTrue(qemu.runner.logged, "Failed: %s, %s" % (cmd, f.read())) + def test_boot_compressed_wic_by_path(self): + """Test runqemu /path/to/rootfs.wic.zst""" + rootfs = "%s.wic.zst" % (self.image_link_name) + rootfs = os.path.join(self.deploy_dir_image, rootfs) + if not os.path.exists(rootfs): + self.skipTest("%s not found" % rootfs) + cmd = "%s %s snapshot" % (self.cmd_common, rootfs) + with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu: + with open(qemu.qemurunnerlog) as f: + self.assertTrue(qemu.runner.logged, "Failed: %s, %s" % (cmd, f.read())) + + def test_boot_compressed_wic_by_recipe(self): + """Test runqemu recipe-image wic.zst""" + cmd = "%s %s snapshot wic.zst" % (self.cmd_common, self.recipe) + with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu: + with open(qemu.qemurunnerlog) as f: + self.assertTrue(qemu.runner.logged, "Failed: %s, %s" % (cmd, f.read())) # This test was designed as a separate class to test that shutdown # command will shutdown qemu as expected on each qemu architecture From patchwork Thu Jul 31 08:27:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 67814 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06BDFC83F17 for ; Thu, 31 Jul 2025 08:27:29 +0000 (UTC) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mx.groups.io with SMTP id smtpd.web11.56790.1753950445266371943 for ; Thu, 31 Jul 2025 01:27:25 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=0Gp2cjRk; spf=pass (domain: smile.fr, ip: 209.85.221.44, mailfrom: yoann.congal@smile.fr) Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-3b783ea502eso385952f8f.1 for ; Thu, 31 Jul 2025 01:27:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1753950443; x=1754555243; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/y2i9yzi/p3tGLVer0kwwFtrV/7rZI5g3L7aJzSNxjU=; b=0Gp2cjRkA4VKb/jmIFN8uXXxZuawPxXr6zTYFV2pRSBQlfxkrRRnHkCRqcFSHAVLGo zTMDZRebSAGsgS94agfK6U3SsmwrOBVYEQKk1zQMUq9E3PqqcxbZzKyyOKR8BGf35iyU YXaUUmOHGuEuDFLufMhFN0/nRHqqkqzf0B+Eg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753950443; x=1754555243; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/y2i9yzi/p3tGLVer0kwwFtrV/7rZI5g3L7aJzSNxjU=; b=AaJPDrec6S+5mSbp/X8n7hLw0nhLRO+ukrolyP957eakxjHYE+8OJkz/2U4UlZ79EX BGlKDC652owKSJYWSXZ+hrfB2IFv6cRtN0ISRTOAiVLSw326bOPJcvnURE48mR3F1n59 l95AneUnS+64U28j8xcqG1qOT9vONNS4P9FQqApX10R4GJjSUzP4OADIC4s9Ir+c9ltt LfbKDBym05bspw0aSMnSAwZujlrkIfg/IQy15w80EzPf40zNFD9S2Ctrf/jNeqWGlaLB DHxGantdGIJg3d9a0UFPGRKO8r0zraTeSLxmvp1oHl3ZW1N97Nqf/ZHVRRcbsGQlWwbq JWcg== X-Gm-Message-State: AOJu0YxFnr4ESqvgTP5ARhT8j0GwdGc8LVgYAle/DNLuTfqYuP7c6bHJ 2shjV+hU+h/znm5g1zPtNut9Y8s3QEHm+wNf56JMiyn6CeSTOWPHnytS1t28xGpHokZluMleiq+ 7yRYXZchWEA== X-Gm-Gg: ASbGncsfacf1wnoTqiwzpBidD1o5Xou/WGwC6bkygZh/omNbpt6pAGVOe2NlKX0j5IA jD5U8i0SXuUlxS7d8CjyP9Pmy1LcUBm23iTsQrS1o8NfwT+t6IqptrM1Ggd58K7S8PhuYvNdtU/ w0i0k5doUN3tPFUNrYJuJTmt6amYN/+51lpnBBhVpblTg2e11b77Ppo/dc+3m84+tBN/l/sDX7G f6gAtWqlB6Yv/Tbzg4SM/v0Sz+8UvVHSQt+K6VwxZ65jVUcOlU3ABbYbp7MGvxQLx3A0InQAF3n lBdkId0MFlb0H5HtpGs9MATEmVYqgxNbeSD3bJE2jytbkbaxqYbqXXwbrby65prd2CvQv8YdBH2 ueamMPQ3dX6PVjOz5VWYql6mw/VViKshnceOgJ8dx+cHHhAXLqjkLafY/Eu9Mw3g9k8jhO2v6Rr OsaTXiNXTqIxNJej3xWdhY6RXESzxX198WCls= X-Google-Smtp-Source: AGHT+IHZEVJKtvKE/fKRPr2NTVVKtKKUOj4Lop2qXaEYRzixrEsQEQ9UvIETzGgNFk88a57zgMaGUQ== X-Received: by 2002:a05:6000:220d:b0:3b7:8ba2:9818 with SMTP id ffacd0b85a97d-3b79d4e3419mr1095152f8f.22.1753950443323; Thu, 31 Jul 2025 01:27:23 -0700 (PDT) Received: from P-ASN-ECS-830T8C3.idf.intranet (static-css-ccs-204145.business.bouyguestelecom.com. [176.157.204.145]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c47908esm1562672f8f.59.2025.07.31.01.27.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Jul 2025 01:27:22 -0700 (PDT) From: Yoann Congal To: openembedded-core@lists.openembedded.org Cc: Yoann Congal Subject: [PATCH v3 3/4] runqemu: accept vmtypes and wictypes for rootfs paths extensions Date: Thu, 31 Jul 2025 10:27:06 +0200 Message-Id: <20250731082707.3481718-3-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250731082707.3481718-1-yoann.congal@smile.fr> References: <20250731082707.3481718-1-yoann.congal@smile.fr> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 31 Jul 2025 08:27:29 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/221178 From: Yoann Congal When using a .wic.zst image, its fstype is detected by default as ".zst" which prevent booting correctly. Fix this by adding wictypes (and vmtypes while at it) to the list of known fstypes. After this fix, the initial fstype is correctly ".wic.zst". Signed-off-by: Yoann Congal --- scripts/runqemu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/runqemu b/scripts/runqemu index c668906bdd..da53265219 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -380,7 +380,7 @@ class BaseConfig(object): # Check filename against self.fstypes can handle .cpio.gz, # otherwise, its type would be "gz", which is incorrect. fst = "" - for t in self.fstypes: + for t in self.fstypes + self.vmtypes + self.wictypes: if p.endswith(t): fst = t break From patchwork Thu Jul 31 08:27:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 67816 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD16AC87FD3 for ; Thu, 31 Jul 2025 08:27:28 +0000 (UTC) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by mx.groups.io with SMTP id smtpd.web10.56904.1753950445717378997 for ; Thu, 31 Jul 2025 01:27:26 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=Vcg6FoWG; spf=pass (domain: smile.fr, ip: 209.85.128.49, mailfrom: yoann.congal@smile.fr) Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4563cfac19cso6276145e9.2 for ; Thu, 31 Jul 2025 01:27:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1753950444; x=1754555244; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DG2uXXx5USlu6YzcXo1ffNHGefrpyHRNDMmy/8oDvTY=; b=Vcg6FoWGDf8OE6eSoj9u/o+4UqmT7gti23pOPHRYTeYIUGBKGiMCdSvw+OqEs7RwaG vYFdoox5whAQ2Xhu6633gEuGIOyL0Purimm/vWJUhLaCD/+0oYeHhgJF+IRcsVWuxV7z sHQHbDYgFjkR1j80+8K7D4CtnoRuPDu7SWTqI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753950444; x=1754555244; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DG2uXXx5USlu6YzcXo1ffNHGefrpyHRNDMmy/8oDvTY=; b=AkbvvCSYLNNP66SFSpMJKgCFt6Q9w4kzklgbXRKlN+Ns8dxzU4QkNnqtnqMiHmUi5p lOQyl+b2OCh5NHJefelOEdgNdGTIvogJi6KBMMVJ6KjjSgOgp7KwKYBUmR2iXpQ4KBem J0UQqoYFzsbtpCuvB/NMmBHQWnzY5gFdfo0SNiAQSE96P3x7TtOGSem6PkbzxLcuQlW2 pSCpYU1M6/HNp4xrOnPSkzXRxAQ50LfRffqpoglN1EKgNOYxQz0BMUK9N+oMhcqUudtX h9aP//nXZdKS7zGV2T7b3cfGJRcRWXsG4/seIFBm7Hi1NQfInNc1VgwteAjt3cXdQX67 tt/g== X-Gm-Message-State: AOJu0YwmRlw/AqNVBUVywjM3F0qLfca+Q+ShLis+RcVru8KKsxtD3ELO ccd1Y3dxouv61Ju+I2Np0MVaNJ9aTykWvssaIuTWlYzjQ/IP+nHJptb1DRs1TPOED97dcB0jY2A BWMDyhUP8TA== X-Gm-Gg: ASbGncuRnCR4KtTJT9V7mf/P3di4wb+aFx+cEMeOvI+tqZzZGdPMe09zgGy/rIIbXs2 CVxfP2HFSQRrv4ILx9ODH0ylPvP2cHbREPxWj9eFSrhwZ46v7n4kBbpiGa+MjJt2G4p0o9bu8w4 /Tf/KwG99P/ZF5EAyG3rTZfX1+YIjW3SMjnnsiTzsEhOW7Wrl1cSI+7Ojqc4rDjSxl3HK0wEKHa HcVWKx/9QjvttLEBiQHGSW3z7hR14ClYxEtwXmFSM2e+M55r/d2dOPb2/xUXFMeH/MvPJFsaZsS zDqMbO7kxwx+WG6sPzK7jmw9ngZecdT2CnYAMQEe+D4snhqC+ScnljInKeS/k1T9pMjpUoiBiix rxzBLRkpDAV2mBMVcRDsNKpVG6bse15qTaUFUHWgRpCJBC4fGZNE3Gh5qrXxNlLDszpvkt+nW+9 Zr+9I7l1h+61MCkne21NAnGngvrzqa8wFKytw= X-Google-Smtp-Source: AGHT+IGcVpxp3D2r5YqMVwNgtm88MX/AJhhO/KzKabuJ0Q3MccUqPqKWdDBpAplsEipShr1XQmfohw== X-Received: by 2002:a05:600c:8889:10b0:454:ccd6:327 with SMTP id 5b1f17b1804b1-45893943ce2mr31859315e9.1.1753950443922; Thu, 31 Jul 2025 01:27:23 -0700 (PDT) Received: from P-ASN-ECS-830T8C3.idf.intranet (static-css-ccs-204145.business.bouyguestelecom.com. [176.157.204.145]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c47908esm1562672f8f.59.2025.07.31.01.27.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Jul 2025 01:27:23 -0700 (PDT) From: Yoann Congal To: openembedded-core@lists.openembedded.org Cc: Yoann Congal Subject: [PATCH v3 4/4] runqemu: print snapshot mode state in console Date: Thu, 31 Jul 2025 10:27:07 +0200 Message-Id: <20250731082707.3481718-4-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250731082707.3481718-1-yoann.congal@smile.fr> References: <20250731082707.3481718-1-yoann.congal@smile.fr> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 31 Jul 2025 08:27:28 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/221179 From: Yoann Congal With snapshot enabled, no change on rootfs will be saved after qemu shutdown. Since this is not what a user might expect, print the snapshot mode state and its consequence in console at runqemu start. Signed-off-by: Yoann Congal --- scripts/runqemu | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/runqemu b/scripts/runqemu index da53265219..99ea0a98ea 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -1053,6 +1053,11 @@ to your build configuration. logoutput.append('NFS_DIR: [%s]' % self.rootfs) else: logoutput.append('ROOTFS: [%s]' % self.rootfs) + if self.snapshot: + msg = "Enabled. Changes on rootfs won't be kept after QEMU shutdown." + else: + msg = "Disabled. Changes on rootfs will be kept after QEMU shutdown." + logoutput.append('SNAPSHOT: [%s]' % msg) if self.ovmf_bios: logoutput.append('OVMF: %s' % self.ovmf_bios) if (self.ovmf_secboot_pkkek1):