test: Allow use of FsHelper without a config

This class is used by the build-efi/qemu scripts, so allow it to work
outside the context of a test.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-08-02 07:48:50 -06:00
parent abf6c576b8
commit a18a6252fb

View File

@@ -63,7 +63,8 @@ class FsHelper:
# Use a default filename; the caller can adjust it
leaf = f'{prefix}.{fs_type}.img'
self.fs_img = os.path.join(config.persistent_data_dir, leaf)
self.fs_img = os.path.join(
config.persistent_data_dir if config else '', leaf)
# Some distributions do not add /sbin to the default PATH, where mkfs
# lives