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