mirror of
https://github.com/dockur/windows.git
synced 2025-10-28 19:55:49 +00:00
Update install.sh
This commit is contained in:
parent
b062415da7
commit
3101857815
1 changed files with 32 additions and 20 deletions
|
|
@ -52,6 +52,7 @@ finishInstall() {
|
|||
|
||||
cp /run/version "$STORAGE/windows.ver"
|
||||
|
||||
if [[ "${PLATFORM,,}" == "x64" ]]; then
|
||||
if [[ "${BOOT_MODE,,}" == "windows_legacy" ]]; then
|
||||
if [[ "${MACHINE,,}" != "q35" ]]; then
|
||||
echo "$MACHINE" > "$STORAGE/windows.old"
|
||||
|
|
@ -66,6 +67,7 @@ finishInstall() {
|
|||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -rf "$TMP"
|
||||
return 0
|
||||
|
|
@ -120,10 +122,13 @@ startInstall() {
|
|||
fi
|
||||
fi
|
||||
|
||||
if [[ "${PLATFORM,,}" == "x64" ]]; then
|
||||
! migrateFiles "$BASE" "$VERSION" && error "Migration failed!" && exit 57
|
||||
fi
|
||||
|
||||
if skipInstall; then
|
||||
[ ! -f "$STORAGE/$BASE" ] && BASE=""
|
||||
[[ "${PLATFORM,,}" == "arm64" ]] && VGA="virtio-gpu"
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
|
@ -153,6 +158,9 @@ startInstall() {
|
|||
if [ ! -f "$STORAGE/$CUSTOM" ]; then
|
||||
CUSTOM=""
|
||||
ISO="$TMP/$BASE"
|
||||
if [[ "${PLATFORM,,}" == "arm64" ]]; then
|
||||
[[ "$EXTERNAL" != [Yy1]* ]] && ISO="$TMP/$VERSION.esd"
|
||||
fi
|
||||
else
|
||||
ISO="$STORAGE/$CUSTOM"
|
||||
fi
|
||||
|
|
@ -557,16 +565,18 @@ detectImage() {
|
|||
|
||||
info "Detecting Windows version from ISO image..."
|
||||
|
||||
if [[ "${PLATFORM,,}" == "x64" ]]; then
|
||||
if [ -f "$dir/WIN51" ] || [ -f "$dir/SETUPXP.HTM" ]; then
|
||||
DETECTED="winxpx86"
|
||||
info "Detected: Windows XP" && return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
local src loc tag result name name2 desc
|
||||
src=$(find "$dir" -maxdepth 1 -type d -iname sources | head -n 1)
|
||||
|
||||
if [ ! -d "$src" ]; then
|
||||
BOOT_MODE="windows_legacy"
|
||||
[[ "${PLATFORM,,}" == "x64" ]] && BOOT_MODE="windows_legacy"
|
||||
warn "failed to locate 'sources' folder in ISO image, $FB" && return 1
|
||||
fi
|
||||
|
||||
|
|
@ -574,7 +584,7 @@ detectImage() {
|
|||
[ ! -f "$loc" ] && loc=$(find "$src" -maxdepth 1 -type f -iname install.esd | head -n 1)
|
||||
|
||||
if [ ! -f "$loc" ]; then
|
||||
BOOT_MODE="windows_legacy"
|
||||
[[ "${PLATFORM,,}" == "x64" ]] && BOOT_MODE="windows_legacy"
|
||||
warn "failed to locate 'install.wim' or 'install.esd' in ISO image, $FB" && return 1
|
||||
fi
|
||||
|
||||
|
|
@ -858,7 +868,7 @@ updateImage() {
|
|||
src=$(find "$dir" -maxdepth 1 -type d -iname sources | head -n 1)
|
||||
|
||||
if [ ! -d "$src" ]; then
|
||||
BOOT_MODE="windows_legacy"
|
||||
[[ "${PLATFORM,,}" == "x64" ]] && BOOT_MODE="windows_legacy"
|
||||
warn "failed to locate 'sources' folder in ISO image, $FB" && return 1
|
||||
fi
|
||||
|
||||
|
|
@ -866,7 +876,7 @@ updateImage() {
|
|||
[ ! -f "$loc" ] && loc=$(find "$src" -maxdepth 1 -type f -iname boot.esd | head -n 1)
|
||||
|
||||
if [ ! -f "$loc" ]; then
|
||||
BOOT_MODE="windows_legacy"
|
||||
[[ "${PLATFORM,,}" == "x64" ]] && BOOT_MODE="windows_legacy"
|
||||
warn "failed to locate 'boot.wim' or 'boot.esd' in ISO image, $FB" && return 1
|
||||
fi
|
||||
|
||||
|
|
@ -992,7 +1002,7 @@ bootWindows() {
|
|||
if [ -s "$STORAGE/windows.mode" ] && [ -f "$STORAGE/windows.mode" ]; then
|
||||
BOOT_MODE=$(<"$STORAGE/windows.mode")
|
||||
if [ -s "$STORAGE/windows.old" ] && [ -f "$STORAGE/windows.old" ]; then
|
||||
MACHINE=$(<"$STORAGE/windows.old")
|
||||
[[ "${PLATFORM,,}" == "x64" ]] && MACHINE=$(<"$STORAGE/windows.old")
|
||||
fi
|
||||
rm -rf "$TMP"
|
||||
return 0
|
||||
|
|
@ -1000,6 +1010,8 @@ bootWindows() {
|
|||
|
||||
# Migrations
|
||||
|
||||
[[ "${PLATFORM,,}" != "x64" ]] && return 0
|
||||
|
||||
if [ -f "$STORAGE/windows.old" ]; then
|
||||
MACHINE=$(<"$STORAGE/windows.old")
|
||||
[ -z "$MACHINE" ] && MACHINE="q35"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue