Update define.sh

This commit is contained in:
Kroese 2024-05-19 13:55:25 +02:00 committed by GitHub
parent 8691c64a92
commit 5fcecb0a8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1901,6 +1901,25 @@ migrateFiles() {
return 0 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() { prepareXP() {
local dir="$2" local dir="$2"
@ -2105,23 +2124,4 @@ prepareXP() {
return 0 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 return 0