Skip to content

Image Replicator: Multiple updates#103

Open
ts-kris wants to merge 6 commits into
mainfrom
image-replicator-tar-opts
Open

Image Replicator: Multiple updates#103
ts-kris wants to merge 6 commits into
mainfrom
image-replicator-tar-opts

Conversation

@ts-kris

@ts-kris ts-kris commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Fixes #91
Fixes #102

  • Adds GNU tar to Image Replicator configurations. This allows for handling extended attributes, sparse files, etc., that can occur from tarballs generated from newer distro-seed configurations to be able to write all of them out. In order to support IR: Use GNU tar and preserve all metadata #102, additional options for ACL, SELinux, and attr are now required.
  • Adds bsdcat to Image Replicator configurations. With the move to GNU tar, tar can now automatically figure out the compression method and stream decompress making this process no longer reliant on the get_stream_decompress shell function that is currently used to parse a file's extension and return the correct compression. bsdcat fills a similar gap with arbitrary stream decompression at a slight performance penalty for smaller filesizes.
xzcat:
real    0m 0.73s
user    0m 1.66s
sys     0m 0.14s

bsdcat:
real    0m 1.61s
user    0m 1.57s
sys     0m 0.03s
bzcat:
real    3m 34.18s
user    3m 32.01s
sys     0m 1.42s

bsdcat:
real    3m 29.89s
user    3m 28.33s
sys     0m 0.83s
  • Adds common variables to use for tar extract and create so these are located in a single point in blast_funcs.sh
  • Removes use of dd for the disk image write pipeline. Instead, just redirect the output of tee to the FIFO and the output file. Letting the kernel handle block sizes and buffers automatically tends to have performance improvements across the board.

Tested against:

  • TS-4900 Rev E
  • Debian 12 tarball known to use sparse files and was previously failing.
  • Using test script to cycle through all media types and modes of operation for Image Replicator for capture and write.

Tests:

  • Verified that non-present media errors in a more obvious way by notifying that the disk is not present.
  • Verified that no errors present in tar output:
+ tar --xattrs '--xattrs-include=*' --acls --selinux --numeric-owner --sparse -xhf /mnt/usb/sdimage.tar -C /tmp/tmp.zucTgeC5sA

With ACL, SELinux, and attr installed to the environment as well, no tar errors relating to these are created.

  • Tested builds of hash 7e5bbaa, did quick test with TS-4900 and TS-7250-V3 to ensure they boot and that images unpack as expected.

ts-kris added 6 commits June 8, 2026 20:39
Fixes #91

More obviously errors in the logs if a target media for a disk
image to be written to is not present in the system.

Signed-off-by: Kris Bahnsen <kris@embeddedTS.com>
Needed for extended attribute support

Signed-off-by: Kris Bahnsen <kris@embeddedTS.com>
Fixes #102

This creates a simple shell function that can be called for both
extraction and creation to handle extended attrs, selinux, numeric
owner, and sparse files. The only thing not handled here is that
extraction needs -h, and creation needs to not have -h in the
argument list to tar to prevent issues.

Signed-off-by: Kris Bahnsen <kris@embeddedTS.com>
Makes stream decompression easier to handle

Signed-off-by: Kris Bahnsen <kris@embeddedTS.com>
Now can rely on bsdcat and tar to handle the stream decompression
and much more robustly compared to just relying on the file
extension to be correct.

Signed-off-by: Kris Bahnsen <kris@embeddedTS.com>
Signed-off-by: Kris Bahnsen <kris@embeddedTS.com>
@ts-kris ts-kris force-pushed the image-replicator-tar-opts branch from 993c9bd to 7e5bbaa Compare June 9, 2026 18:56
@ts-kris ts-kris marked this pull request as ready for review June 9, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IR: Use GNU tar and preserve all metadata IR: Check target media exists before writing

1 participant