From 45421e257eb23ed37bb4c72d8caf69bcf201abb7 Mon Sep 17 00:00:00 2001 From: Kroese Date: Fri, 10 May 2024 16:28:40 +0200 Subject: [PATCH] fix: Skip exisiting boot image --- src/define.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/define.sh b/src/define.sh index f5ebbc2..9b2bed9 100644 --- a/src/define.sh +++ b/src/define.sh @@ -1199,15 +1199,17 @@ prepareLegacy() { local iso="$1" local dir="$2" + local file="$dir/boot.img" - ETFS="boot.img" - rm -f "$dir/$ETFS" + ETFS=$(basename "$file") + [ -f "$file" ] && [ -s "$file" ] && return 0 + rm -f "$file" local len offset len=$(isoinfo -d -i "$iso" | grep "Nsect " | grep -o "[^ ]*$") offset=$(isoinfo -d -i "$iso" | grep "Bootoff " | grep -o "[^ ]*$") - dd "if=$iso" "of=$dir/$ETFS" bs=2048 "count=$len" "skip=$offset" status=none && return 0 + dd "if=$iso" "of=$file" bs=2048 "count=$len" "skip=$offset" status=none && return 0 return 1 }