U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mattijs Korpershoek <mkorpershoek@kernel.org>
To: Simon Glass <sjg@chromium.org>, u-boot@lists.denx.de
Cc: Simon Glass <sjg@chromium.org>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Marek Vasut <marek.vasut+renesas@mailbox.org>,
	Martin Schwan <m.schwan@phytec.de>,
	Mattijs Korpershoek <mkorpershoek@kernel.org>,
	Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH v2 11/11] test: Move disk images to persistent-data directory
Date: Mon, 08 Jun 2026 10:49:51 +0200	[thread overview]
Message-ID: <87ik7txvps.fsf@kernel.org> (raw)
In-Reply-To: <20260523085455.750591-12-sjg@chromium.org>

Hi Simon,

Thank you for the patch.

On Sat, May 23, 2026 at 02:54, Simon Glass <sjg@chromium.org> wrote:

> It is annoying to have disk images in the source directory since it
> clutters up the working space.
>
> Remove cur_dir=True from DiskHelper calls so disk images are written to
> the persistent-data directory instead.
>
> Move scsi.img too (used by the bootstd tests) and mmc6.img (used by the
> MBR tests).
>
> Add a few comments as to where the images are used.
>
> This keeps the source tree clean and puts disk images in the same place
> as other test data.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>

I've re-ran the following using this series:
$ git clean -xdf
$ python3 -m venv venv && . venv/bin/activate && pip install -r test/py/requirements.txt && pip install setuptools && ./test/py/test.py --bd sandbox --build -k ut

Then, if I check the source folder, I still see some disk images:
$ ls *.img
mmc10.img  mmc1.img  mmc5.img  mmc7.img  mmc8.img  mmc9.img

Also see:

$ find -name '*.img'
./build-sandbox/persistent-data/test_efi_capsule.vfat.img
./build-sandbox/persistent-data/scsi.img
./build-sandbox/persistent-data/2MB.ext2.img
./build-sandbox/persistent-data/1MB.fat32.img
./build-sandbox/persistent-data/mmc6.img
./build-sandbox/persistent-data/mmc.vfat.tmp/initramfs-5.3.7-301.fc31.armv7hl.img
./build-sandbox/persistent-data/mmc1.img
./build-sandbox/persistent-data/mmc4.img
./build-sandbox/persistent-data/bootv4.img
./build-sandbox/persistent-data/vendor_boot.img
./build-sandbox/persistent-data/boot.img
./build-sandbox/persistent-data/flash1.img
./build-sandbox/bootv4.img
./build-sandbox/vendor_boot.img
./build-sandbox/boot.img
./mmc1.img
./mmc9.img
./mmc5.img
./mmc7.img
./mmc8.img
./mmc10.img

Is there a reason for not moving all the images?

I think that for this patch, we should at least ensure that all the
mmc*.img are moved.

For example, mmc7.img and mmc8.img are used by Android and I believe
they should be in build-sandbox/persistent-data/ as well.

> ---
>
> (no changes since v1)
>
>  test/py/img/common.py    |  2 +-
>  test/py/img/efi.py       |  2 +-
>  test/py/img/script.py    |  2 +-
>  test/py/tests/test_ut.py | 11 +++++++----
>  4 files changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/test/py/img/common.py b/test/py/img/common.py
> index 301b6c840d4..a2c86c5c282 100644
> --- a/test/py/img/common.py
> +++ b/test/py/img/common.py
> @@ -74,7 +74,7 @@ def make_extlinux_disk(ubman, devnum, basename, vmlinux, initrd, dtbdir,
>  
>      fsh.mk_fs()
>  
> -    img = DiskHelper(ubman.config, devnum, basename, True)
> +    img = DiskHelper(ubman.config, devnum, basename)
>      img.add_fs(fsh, DiskHelper.VFAT, bootable=True)
>  
>      ext4 = FsHelper(ubman.config, 'ext4', 1, prefix=basename)
> diff --git a/test/py/img/efi.py b/test/py/img/efi.py
> index 4cb0bb95a59..06fda8a90b2 100644
> --- a/test/py/img/efi.py
> +++ b/test/py/img/efi.py
> @@ -31,7 +31,7 @@ def setup_efi_image(ubman):
>  
>      fsh.mk_fs()
>  
> -    img = DiskHelper(ubman.config, devnum, 'flash', True)
> +    img = DiskHelper(ubman.config, devnum, 'flash')
>      img.add_fs(fsh, DiskHelper.VFAT)
>      img.create()
>      fsh.cleanup()
> diff --git a/test/py/img/script.py b/test/py/img/script.py
> index e6072bf5bd9..5c0c9e99183 100644
> --- a/test/py/img/script.py
> +++ b/test/py/img/script.py
> @@ -126,7 +126,7 @@ booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
>          ubman, f'echo here {kernel} {symlink}')
>      os.symlink(kernel, symlink)
>      fsh.mk_fs()
> -    img = DiskHelper(ubman.config, mmc_dev, 'mmc', True)
> +    img = DiskHelper(ubman.config, mmc_dev, 'mmc')
>      img.add_fs(fsh, DiskHelper.EXT4)
>      img.create()
>      fsh.cleanup()
> diff --git a/test/py/tests/test_ut.py b/test/py/tests/test_ut.py
> index 38fec6cf8a2..9c938943259 100644
> --- a/test/py/tests/test_ut.py
> +++ b/test/py/tests/test_ut.py
> @@ -32,7 +32,8 @@ from img.cedit import setup_cedit_file
>  def test_ut_dm_init(ubman):
>      """Initialize data for ut dm tests."""
>  
> -    fn = ubman.config.source_dir + '/testflash.bin'
> +    # This is used by flash-stick@0 in test.py
> +    fn = ubman.config.persistent_data_dir + '/testflash.bin'
>      if not os.path.exists(fn):
>          data = b'this is a test'
>          data += b'\x00' * ((4 * 1024 * 1024) - len(data))
> @@ -45,8 +46,8 @@ def test_ut_dm_init(ubman):
>          with open(fn, 'wb') as fh:
>              fh.write(data)
>  
> -    # Create a file with a single partition
> -    fn = ubman.config.source_dir + '/scsi.img'
> +    # Create a file with a single partition (used by /scsi in test.dts) */
> +    fn = ubman.config.persistent_data_dir + '/scsi.img'
>      if not os.path.exists(fn):
>          data = b'\x00' * (2 * 1024 * 1024)
>          with open(fn, 'wb') as fh:
> @@ -54,11 +55,13 @@ def test_ut_dm_init(ubman):
>          utils.run_and_log(
>              ubman, f'sfdisk {fn}', stdin=b'type=83')
>  
> +    # These two are used by test/dm/host.c
>      FsHelper(ubman.config, 'ext2', 2, '2MB').mk_fs()
>      FsHelper(ubman.config, 'fat32', 1, '1MB').mk_fs()
>  
> +    # This is used by test/cmd/mbr.c
>      mmc_dev = 6
> -    fn = os.path.join(ubman.config.source_dir, f'mmc{mmc_dev}.img')
> +    fn = os.path.join(ubman.config.persistent_data_dir, f'mmc{mmc_dev}.img')
>      data = b'\x00' * (12 * 1024 * 1024)
>      with open(fn, 'wb') as fh:
>          fh.write(data)
> -- 
> 2.43.0

  reply	other threads:[~2026-06-08  8:50 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-23  8:54 [PATCH v2 00/11] Move test/py image creation into separate modules Simon Glass
2026-05-23  8:54 ` [PATCH v2 01/11] test: Create a common file for image utilities Simon Glass
2026-06-08  8:04   ` Mattijs Korpershoek
2026-05-23  8:54 ` [PATCH v2 02/11] test: Move extlinux image-creation to its own file Simon Glass
2026-06-08  8:17   ` Mattijs Korpershoek
2026-05-23  8:54 ` [PATCH v2 03/11] test: Move script " Simon Glass
2026-06-08  8:13   ` Mattijs Korpershoek
2026-05-23  8:54 ` [PATCH v2 04/11] test: Move ChromeOS " Simon Glass
2026-06-08  8:19   ` Mattijs Korpershoek
2026-05-23  8:54 ` [PATCH v2 05/11] test: Move Android " Simon Glass
2026-06-08  8:21   ` Mattijs Korpershoek
2026-05-23  8:54 ` [PATCH v2 06/11] test: Move EFI " Simon Glass
2026-06-08  8:22   ` Mattijs Korpershoek
2026-05-23  8:54 ` [PATCH v2 07/11] test: Move the configuration-editor setup " Simon Glass
2026-06-08  8:23   ` Mattijs Korpershoek
2026-05-23  8:54 ` [PATCH v2 08/11] test: Add Args docstrings to img setup functions Simon Glass
2026-06-08  8:24   ` Mattijs Korpershoek
2026-05-23  8:54 ` [PATCH v2 09/11] test: Reformat line wraps in " Simon Glass
2026-06-08  8:27   ` Mattijs Korpershoek
2026-05-23  8:54 ` [PATCH v2 10/11] sandbox: Find disk images in the persistent-data directory Simon Glass
2026-06-08  8:41   ` Mattijs Korpershoek
2026-05-23  8:54 ` [PATCH v2 11/11] test: Move disk images to " Simon Glass
2026-06-08  8:49   ` Mattijs Korpershoek [this message]
2026-06-08  7:53 ` [PATCH v2 00/11] Move test/py image creation into separate modules Mattijs Korpershoek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ik7txvps.fsf@kernel.org \
    --to=mkorpershoek@kernel.org \
    --cc=m.schwan@phytec.de \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox