feat: Improved installation (#483)

This commit is contained in:
Kroese 2024-05-10 18:21:41 +02:00 committed by GitHub
parent 5a000c1f9e
commit f7986f57ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 199 additions and 94 deletions

View file

@ -984,7 +984,7 @@ migrateFiles() {
[[ "${version,,}" == "win7${PLATFORM,,}" ]] && file="en_windows_7_enterprise_with_sp1_${PLATFORM,,}_dvd_u_677651.iso"
[ ! -f "$STORAGE/$file" ] && return 0
! mv "$STORAGE/$file" "$base" && return 1
! mv -f "$STORAGE/$file" "$base" && return 1
return 0
}
@ -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
}