feat: Switch Win7 mirror (#104)
This commit is contained in:
parent
0aea392b28
commit
73793dbcaa
@ -16,7 +16,7 @@ RUN apt-get update \
|
|||||||
|
|
||||||
COPY ./src /run/
|
COPY ./src /run/
|
||||||
COPY ./assets /run/assets
|
COPY ./assets /run/assets
|
||||||
ADD https://github.com/qemus/virtiso/raw/master/virtio-win.iso /run/drivers.iso
|
ADD https://github.com/qemus/virtiso/releases/download/v0.1.240/virtio-win-0.1.240.iso /run/drivers.iso
|
||||||
RUN chmod +x /run/*.sh
|
RUN chmod +x /run/*.sh
|
||||||
|
|
||||||
EXPOSE 8006 3389
|
EXPOSE 8006 3389
|
||||||
|
@ -52,8 +52,8 @@
|
|||||||
<OSImage>
|
<OSImage>
|
||||||
<InstallFrom>
|
<InstallFrom>
|
||||||
<MetaData wcm:action="add">
|
<MetaData wcm:action="add">
|
||||||
<Key>/IMAGE/INDEX</Key>
|
<Value>Windows 7 Ultimate</Value>
|
||||||
<Value>1</Value>
|
<Key>/IMAGE/NAME</Key>
|
||||||
</MetaData>
|
</MetaData>
|
||||||
</InstallFrom>
|
</InstallFrom>
|
||||||
<InstallTo>
|
<InstallTo>
|
@ -80,7 +80,7 @@ docker run -it --rm -p 8006:8006 --device=/dev/kvm --cap-add NET_ADMIN --stop-ti
|
|||||||
| ```win10``` | Windows 10 Pro | Microsoft | Fast | 5.8 GB |
|
| ```win10``` | Windows 10 Pro | Microsoft | Fast | 5.8 GB |
|
||||||
| ```ltsc10``` | Windows 10 LTSC | Microsoft | Fast | 4.6 GB |
|
| ```ltsc10``` | Windows 10 LTSC | Microsoft | Fast | 4.6 GB |
|
||||||
| ```win81``` | Windows 8.1 Pro | Microsoft | Fast | 4.2 GB |
|
| ```win81``` | Windows 8.1 Pro | Microsoft | Fast | 4.2 GB |
|
||||||
| ```win7``` | Windows 7 Ultimate | Archive.org | Slow | 5.5 GB |
|
| ```win7``` | Windows 7 SP1 | Bob Pony | Medium | 3.2 GB |
|
||||||
| ```win22``` | Windows Server 2022 | Microsoft | Fast | 4.7 GB |
|
| ```win22``` | Windows Server 2022 | Microsoft | Fast | 4.7 GB |
|
||||||
| ```win19``` | Windows Server 2019 | Microsoft | Fast | 5.3 GB |
|
| ```win19``` | Windows Server 2019 | Microsoft | Fast | 5.3 GB |
|
||||||
| ```win16``` | Windows Server 2016 | Microsoft | Fast | 6.5 GB |
|
| ```win16``` | Windows Server 2016 | Microsoft | Fast | 6.5 GB |
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
set -Eeuo pipefail
|
set -Eeuo pipefail
|
||||||
|
|
||||||
: "${MANUAL:=""}"
|
: "${MANUAL:=""}"
|
||||||
|
: "${DETECTED:=""}"
|
||||||
: "${VERSION:="win11x64"}"
|
: "${VERSION:="win11x64"}"
|
||||||
|
|
||||||
if [[ "${VERSION}" == \"*\" || "${VERSION}" == \'*\' ]]; then
|
if [[ "${VERSION}" == \"*\" || "${VERSION}" == \'*\' ]]; then
|
||||||
@ -20,9 +21,8 @@ fi
|
|||||||
[[ "${VERSION,,}" == "win81" ]] && VERSION="win81x64"
|
[[ "${VERSION,,}" == "win81" ]] && VERSION="win81x64"
|
||||||
[[ "${VERSION,,}" == "win8" ]] && VERSION="win81x64"
|
[[ "${VERSION,,}" == "win8" ]] && VERSION="win81x64"
|
||||||
|
|
||||||
[[ "${VERSION,,}" == "7" ]] && VERSION="win7x64-ultimate"
|
[[ "${VERSION,,}" == "7" ]] && VERSION="win7x64"
|
||||||
[[ "${VERSION,,}" == "win7" ]] && VERSION="win7x64-ultimate"
|
[[ "${VERSION,,}" == "win7" ]] && VERSION="win7x64"
|
||||||
[[ "${VERSION,,}" == "win7x64" ]] && VERSION="win7x64-ultimate"
|
|
||||||
|
|
||||||
[[ "${VERSION,,}" == "22" ]] && VERSION="win2022-eval"
|
[[ "${VERSION,,}" == "22" ]] && VERSION="win2022-eval"
|
||||||
[[ "${VERSION,,}" == "2022" ]] && VERSION="win2022-eval"
|
[[ "${VERSION,,}" == "2022" ]] && VERSION="win2022-eval"
|
||||||
@ -44,14 +44,25 @@ fi
|
|||||||
[[ "${VERSION,,}" == "win10-ltsc" ]] && VERSION="win10x64-enterprise-ltsc-eval"
|
[[ "${VERSION,,}" == "win10-ltsc" ]] && VERSION="win10x64-enterprise-ltsc-eval"
|
||||||
[[ "${VERSION,,}" == "win10x64-ltsc" ]] && VERSION="win10x64-enterprise-ltsc-eval"
|
[[ "${VERSION,,}" == "win10x64-ltsc" ]] && VERSION="win10x64-enterprise-ltsc-eval"
|
||||||
|
|
||||||
if [[ "${VERSION,,}" == "tiny11" ]]; then
|
if [[ "${VERSION,,}" == "win10x64-enterprise-ltsc-eval" ]]; then
|
||||||
VERSION="https://archive.org/download/tiny-11-core-x-64-beta-1/tiny11%20core%20x64%20beta%201.iso"
|
DETECTED="win10x64-ltsc"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${VERSION,,}" == "tiny10" ]]; then
|
if [[ "${VERSION,,}" == "tiny10" ]]; then
|
||||||
|
DETECTED="win10x64-ltsc"
|
||||||
VERSION="https://archive.org/download/tiny-10-23-h2/tiny10%20x64%2023h2.iso"
|
VERSION="https://archive.org/download/tiny-10-23-h2/tiny10%20x64%2023h2.iso"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "${VERSION,,}" == "win7x64" ]]; then
|
||||||
|
DETECTED="win7x64"
|
||||||
|
VERSION="https://dl.bobpony.com/windows/7/en_windows_7_with_sp1_x64.iso"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${VERSION,,}" == "tiny11" ]]; then
|
||||||
|
DETECTED="win11x64"
|
||||||
|
VERSION="https://archive.org/download/tiny-11-core-x-64-beta-1/tiny11%20core%20x64%20beta%201.iso"
|
||||||
|
fi
|
||||||
|
|
||||||
CUSTOM="custom.iso"
|
CUSTOM="custom.iso"
|
||||||
|
|
||||||
[ ! -f "$STORAGE/$CUSTOM" ] && CUSTOM="Custom.iso"
|
[ ! -f "$STORAGE/$CUSTOM" ] && CUSTOM="Custom.iso"
|
||||||
@ -297,18 +308,6 @@ extractImage() {
|
|||||||
exit 66
|
exit 66
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "$dir/$ETFS" ] || [ ! -f "$dir/$EFISYS" ]; then
|
|
||||||
|
|
||||||
if [ ! -f "$dir/$ETFS" ]; then
|
|
||||||
warn "failed to locate file 'etfsboot.com' in ISO image, $FB"
|
|
||||||
else
|
|
||||||
warn "failed to locate file 'efisys_noprompt.bin' in ISO image, $FB"
|
|
||||||
fi
|
|
||||||
|
|
||||||
BOOT_MODE="windows_legacy"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -319,10 +318,11 @@ findVersion() {
|
|||||||
|
|
||||||
[[ "${name,,}" == *"windows 11"* ]] && detected="win11x64"
|
[[ "${name,,}" == *"windows 11"* ]] && detected="win11x64"
|
||||||
[[ "${name,,}" == *"windows 8"* ]] && detected="win81x64"
|
[[ "${name,,}" == *"windows 8"* ]] && detected="win81x64"
|
||||||
|
[[ "${name,,}" == *"windows 7"* ]] && detected="win7x64"
|
||||||
|
[[ "${name,,}" == *"windows vista"* ]] && detected="winvistax64"
|
||||||
[[ "${name,,}" == *"server 2022"* ]] && detected="win2022-eval"
|
[[ "${name,,}" == *"server 2022"* ]] && detected="win2022-eval"
|
||||||
[[ "${name,,}" == *"server 2019"* ]] && detected="win2019-eval"
|
[[ "${name,,}" == *"server 2019"* ]] && detected="win2019-eval"
|
||||||
[[ "${name,,}" == *"server 2016"* ]] && detected="win2016-eval"
|
[[ "${name,,}" == *"server 2016"* ]] && detected="win2016-eval"
|
||||||
[[ "${name,,}" == *"windows 7"* ]] && detected="win7x64-ultimate"
|
|
||||||
|
|
||||||
if [[ "${name,,}" == *"windows 10"* ]]; then
|
if [[ "${name,,}" == *"windows 10"* ]]; then
|
||||||
if [[ "${name,,}" == *"enterprise ltsc"* ]]; then
|
if [[ "${name,,}" == *"enterprise ltsc"* ]]; then
|
||||||
@ -338,30 +338,29 @@ findVersion() {
|
|||||||
|
|
||||||
detectImage() {
|
detectImage() {
|
||||||
|
|
||||||
local dir="$1"
|
|
||||||
local tag result name name2
|
|
||||||
|
|
||||||
XML=""
|
XML=""
|
||||||
DETECTED=""
|
|
||||||
|
|
||||||
if [[ "$EXTERNAL" != [Yy1]* ]] && [ -z "$CUSTOM" ]; then
|
if [ -n "$CUSTOM" ]; then
|
||||||
if [[ "${VERSION,,}" != "win10x64-enterprise-ltsc-eval" ]]; then
|
DETECTED=""
|
||||||
|
else
|
||||||
|
if [ -z "$DETECTED" ] && [[ "$EXTERNAL" != [Yy1]* ]]; then
|
||||||
DETECTED="$VERSION"
|
DETECTED="$VERSION"
|
||||||
else
|
|
||||||
DETECTED="win10x64-ltsc"
|
|
||||||
fi
|
fi
|
||||||
if [[ "$MANUAL" != [Yy1]* ]]; then
|
fi
|
||||||
|
|
||||||
|
if [ -n "$DETECTED" ]; then
|
||||||
if [ -f "/run/assets/$DETECTED.xml" ]; then
|
if [ -f "/run/assets/$DETECTED.xml" ]; then
|
||||||
XML="$DETECTED.xml"
|
[[ "$MANUAL" != [Yy1]* ]] && XML="$DETECTED.xml"
|
||||||
else
|
return 0
|
||||||
warn "image type is '$DETECTED', but no matching XML file exists, $FB."
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
warn "image type is '$DETECTED', but no matching XML file exists!"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
info "Detecting Windows version from ISO image..."
|
info "Detecting Windows version from ISO image..."
|
||||||
|
|
||||||
|
local dir="$1"
|
||||||
|
local tag result name name2
|
||||||
local loc="$dir/sources/install.wim"
|
local loc="$dir/sources/install.wim"
|
||||||
[ ! -f "$loc" ] && loc="$dir/sources/install.esd"
|
[ ! -f "$loc" ] && loc="$dir/sources/install.esd"
|
||||||
|
|
||||||
@ -410,7 +409,21 @@ prepareImage() {
|
|||||||
local iso="$1"
|
local iso="$1"
|
||||||
local dir="$2"
|
local dir="$2"
|
||||||
|
|
||||||
[[ "${DETECTED,,}" != "win7x64"* ]] && return 0
|
if [[ "${BOOT_MODE,,}" == "windows" ]]; then
|
||||||
|
if [[ "${DETECTED,,}" != "win7x64"* ]] && [[ "${DETECTED,,}" != "winvistax64"* ]]; then
|
||||||
|
|
||||||
|
if [ -f "$dir/$ETFS" ] && [ -f "$dir/$EFISYS" ]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "$dir/$ETFS" ]; then
|
||||||
|
warn "failed to locate file 'etfsboot.com' in ISO image, falling back to legacy boot!"
|
||||||
|
else
|
||||||
|
warn "failed to locate file 'efisys_noprompt.bin' in ISO image, falling back to legacy boot!"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
ETFS="boot.img"
|
ETFS="boot.img"
|
||||||
BOOT_MODE="windows_legacy"
|
BOOT_MODE="windows_legacy"
|
||||||
|
Loading…
Reference in New Issue
Block a user