mirror of
https://github.com/dockur/windows.git
synced 2025-10-27 03:15:49 +00:00
Update install.sh
This commit is contained in:
parent
4ad0fdc5c8
commit
8ffea86f1b
1 changed files with 21 additions and 13 deletions
|
|
@ -261,7 +261,7 @@ extractImage() {
|
|||
|
||||
local iso="$1"
|
||||
local dir="$2"
|
||||
local size size_gb space space_gb len offset
|
||||
local size size_gb space space_gb
|
||||
|
||||
local msg="Extracting downloaded ISO image..."
|
||||
[ -n "$CUSTOM" ] && msg="Extracting local ISO image..."
|
||||
|
|
@ -287,15 +287,6 @@ extractImage() {
|
|||
exit 66
|
||||
fi
|
||||
|
||||
#ETFS="boot.img"
|
||||
#len=$(isoinfo -d -i "$iso" | grep "Nsect " | grep -o "[^ ]*$")
|
||||
#offset=$(isoinfo -d -i "$iso" | grep "Bootoff " | grep -o "[^ ]*$")
|
||||
|
||||
#if ! dd if="$ISO" of="$dir/boot.img" bs=2048 "count=$len" "skip=$offset" status=none; then
|
||||
# error "Failed to extract boot image from ISO!"
|
||||
# exit 67
|
||||
#fi
|
||||
|
||||
if [ ! -f "$dir/$ETFS" ] || [ ! -f "$dir/$EFISYS" ]; then
|
||||
|
||||
if [ ! -f "$dir/$ETFS" ]; then
|
||||
|
|
@ -390,8 +381,9 @@ selectXML() {
|
|||
|
||||
updateImage() {
|
||||
|
||||
local dir="$1"
|
||||
local asset="$2"
|
||||
local iso="$1"
|
||||
local dir="$2"
|
||||
local asset="/run/assets/$3"
|
||||
local index result
|
||||
|
||||
[ ! -f "$asset" ] && return 0
|
||||
|
|
@ -420,6 +412,22 @@ updateImage() {
|
|||
return 1
|
||||
fi
|
||||
|
||||
if [[ "$2" == "win7x64-ultimate.xml" ]]; then
|
||||
|
||||
ETFS="boot.img"
|
||||
BOOT_MODE="windows_legacy"
|
||||
|
||||
local len offset
|
||||
len=$(isoinfo -d -i "$iso" | grep "Nsect " | grep -o "[^ ]*$")
|
||||
offset=$(isoinfo -d -i "$iso" | grep "Bootoff " | grep -o "[^ ]*$")
|
||||
|
||||
if ! dd "if=$iso" "of=$dir/boot.img" bs=2048 "count=$len" "skip=$offset" status=none; then
|
||||
error "Failed to extract boot image from ISO!"
|
||||
exit 67
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
|
@ -501,7 +509,7 @@ if ! selectXML "$DIR"; then
|
|||
return 0
|
||||
fi
|
||||
|
||||
if ! updateImage "$DIR" "/run/assets/$XML"; then
|
||||
if ! updateImage "$ISO" "$DIR" "$XML"; then
|
||||
abortInstall "$ISO"
|
||||
return 0
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue