summaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2026-02-09 03:19:17 +0000
committerBruce Ashfield <bruce.ashfield@gmail.com>2026-02-09 03:34:12 +0000
commitd04103169c462913a68e7346e4f78682b74d93f0 (patch)
tree5f21cd9b8da110865ba4d40905310aba8caf02ed /classes
parent7297ba3aeba2cef546c9245b2b6ae1139568cf40 (diff)
downloadmeta-virtualization-d04103169c462913a68e7346e4f78682b74d93f0.tar.gz
image-oci: fix process substitution for dash/busybox compatibility
Replace bash-specific process substitution (< <(find ...)) with POSIX-compatible piped find | while constructs. Replace $((...)) arithmetic with expr for broader shell compatibility. This fixes OCI image delta-copy on systems where /bin/sh is dash or busybox ash rather than bash. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'classes')
-rw-r--r--classes/image-oci-umoci.inc13
1 files changed, 7 insertions, 6 deletions
diff --git a/classes/image-oci-umoci.inc b/classes/image-oci-umoci.inc
index 616c20ae..eeb41ca5 100644
--- a/classes/image-oci-umoci.inc
+++ b/classes/image-oci-umoci.inc
@@ -595,25 +595,26 @@ IMAGE_CMD:oci() {
595 oci_delta_copied=0 595 oci_delta_copied=0
596 oci_delta_skipped=0 596 oci_delta_skipped=0
597 # Walk the directory and copy only files not in bundle 597 # Walk the directory and copy only files not in bundle
598 while IFS= read -r oci_src_file; do 598 # Copy files (delta-only)
599 find "${IMAGE_ROOTFS}$oci_dir" \( -type f -o -type l \) | while IFS= read -r oci_src_file; do
599 oci_rel_path="${oci_src_file#${IMAGE_ROOTFS}}" 600 oci_rel_path="${oci_src_file#${IMAGE_ROOTFS}}"
600 oci_dst_file="$image_bundle_name/rootfs$oci_rel_path" 601 oci_dst_file="$image_bundle_name/rootfs$oci_rel_path"
601 if [ ! -e "$oci_dst_file" ]; then 602 if [ ! -e "$oci_dst_file" ]; then
602 mkdir -p "$(dirname "$oci_dst_file")" 603 mkdir -p "$(dirname "$oci_dst_file")"
603 cp -a "$oci_src_file" "$oci_dst_file" 604 cp -a "$oci_src_file" "$oci_dst_file"
604 oci_delta_copied=$((oci_delta_copied + 1)) 605 oci_delta_copied=$(expr $oci_delta_copied + 1)
605 else 606 else
606 oci_delta_skipped=$((oci_delta_skipped + 1)) 607 oci_delta_skipped=$(expr $oci_delta_skipped + 1)
607 fi 608 fi
608 done < <(find "${IMAGE_ROOTFS}$oci_dir" -type f -o -type l) 609 done
609 # Also copy empty directories 610 # Also copy empty directories
610 while IFS= read -r oci_src_dir; do 611 find "${IMAGE_ROOTFS}$oci_dir" -type d | while IFS= read -r oci_src_dir; do
611 oci_rel_path="${oci_src_dir#${IMAGE_ROOTFS}}" 612 oci_rel_path="${oci_src_dir#${IMAGE_ROOTFS}}"
612 oci_dst_dir="$image_bundle_name/rootfs$oci_rel_path" 613 oci_dst_dir="$image_bundle_name/rootfs$oci_rel_path"
613 if [ ! -e "$oci_dst_dir" ]; then 614 if [ ! -e "$oci_dst_dir" ]; then
614 mkdir -p "$oci_dst_dir" 615 mkdir -p "$oci_dst_dir"
615 fi 616 fi
616 done < <(find "${IMAGE_ROOTFS}$oci_dir" -type d) 617 done
617 bbnote "OCI: Added directory $oci_dir (delta: $oci_delta_copied copied, $oci_delta_skipped skipped)" 618 bbnote "OCI: Added directory $oci_dir (delta: $oci_delta_copied copied, $oci_delta_skipped skipped)"
618 else 619 else
619 bbwarn "OCI: Directory not found in IMAGE_ROOTFS: $oci_dir" 620 bbwarn "OCI: Directory not found in IMAGE_ROOTFS: $oci_dir"