Skip to content

Commit

Permalink
images: Support symlinks to Tezi tarballs
Browse files Browse the repository at this point in the history
The filename of the tarball is used to predict the name of the directory
contained in the tarball. When a symlink is used with a different
(simpler) name, the unpack would fail.

This resolves the symlink and looks at the filename of the actual
tarball file.

This can be useful to allow pointing tcbuild.yaml to a symlink with
a stable name, which points to a locally built tarball which changes
name on every build. For example, see this patch that does this
automatically for the yocto builds:

    https://community.toradex.com/t/patch-create-non-versioned-symlink-to-tezi-tarball/21265

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
  • Loading branch information
matthijskooijman committed Feb 9, 2024
1 parent d1e7528 commit e3cd043
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tcbuilder/backend/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,9 @@ def import_local_image(image_dir, tezi_dir, src_sysroot_dir, src_ostree_archive_
log.info("Unpacking Toradex Easy Installer image.")
if "Tezi" in image_dir:
extract_dir = _make_tezi_extract_dir(tezi_dir)
real_image_dir = os.path.realpath(image_dir)
final_dir = os.path.join(
extract_dir, os.path.splitext(os.path.basename(image_dir))[0])
extract_dir, os.path.splitext(os.path.basename(real_image_dir))[0])
elif "teziimage" in image_dir:
extract_dir = _make_tezi_extract_dir(tezi_dir)
final_dir = extract_dir
Expand Down

0 comments on commit e3cd043

Please sign in to comment.