mirror of
https://github.com/dockur/windows.git
synced 2025-10-27 03:15:49 +00:00
feat: Improved installation (#483)
This commit is contained in:
parent
5a000c1f9e
commit
f7986f57ce
3 changed files with 199 additions and 94 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue