mirror of
https://github.com/dockur/windows.git
synced 2025-12-21 01:40:37 +00:00
feat: Improved installation (#483)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user