Fix split_live_squashfs_layers crash under POSIX sh (dash)

trap RETURN is a bash extension not supported by /bin/sh on Debian.
With set -e active the unsupported trap call exited the build immediately
after lb build, before bootloader sync and ISO copy steps ran.

Remove both trap RETURN lines — explicit rm -rf at the end of the
function is sufficient for cleanup on the happy path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mikhail Chusavitin
2026-05-04 09:52:31 +03:00
parent 7b4bcc745a
commit 75c33e073e

View File

@@ -986,7 +986,6 @@ split_live_squashfs_layers() {
tmp_root="$(mktemp -d)"
tmp_usr="$(mktemp -d)"
tmp_fw="$(mktemp -d)"
trap 'rm -rf "$tmp_root" "$tmp_usr" "$tmp_fw"' RETURN
echo "=== splitting live squashfs into smaller layers ==="
unsquashfs -d "$tmp_root/root" "$base_sq" >/dev/null
@@ -1013,7 +1012,6 @@ split_live_squashfs_layers() {
echo "=== live squashfs layers ==="
find "$live_dir" -maxdepth 1 -type f -name '*.squashfs' -exec du -sh {} \; | sort
rm -rf "$tmp_root" "$tmp_usr" "$tmp_fw"
trap - RETURN
}
recover_iso_memtest() {