From 5fcecb0a8a891d59a1c5f91192a873a788c6a86d Mon Sep 17 00:00:00 2001 From: Kroese Date: Sun, 19 May 2024 13:55:25 +0200 Subject: [PATCH] Update define.sh --- src/define.sh | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/define.sh b/src/define.sh index e37f851..149f08b 100644 --- a/src/define.sh +++ b/src/define.sh @@ -1901,6 +1901,25 @@ migrateFiles() { return 0 } +prepareLegacy() { + + local iso="$1" + local dir="$2" + local file="$dir/boot.img" + + 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=$file" bs=2048 "count=$len" "skip=$offset" status=none && return 0 + + return 1 +} + prepareXP() { local dir="$2" @@ -2105,23 +2124,4 @@ prepareXP() { return 0 } -prepareLegacy() { - - local iso="$1" - local dir="$2" - local file="$dir/boot.img" - - 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=$file" bs=2048 "count=$len" "skip=$offset" status=none && return 0 - - return 1 -} - return 0