1
0
mirror of https://github.com/dockur/windows.git synced 2026-07-27 21:42:36 +07:00

feat: Added support for Reactos (#1999)

This commit is contained in:
Kroese
2026-07-26 23:55:50 +02:00
committed by GitHub
parent 5287b0ba85
commit a6c1e4c8a5
6 changed files with 126 additions and 27 deletions
+4 -3
View File
@@ -134,9 +134,10 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/mas
| `2008` | Windows Server 2008 | 3.0 GB | | `2008` | Windows Server 2008 | 3.0 GB |
| `2003` | Windows Server 2003 | 0.6 GB | | `2003` | Windows Server 2003 | 0.6 GB |
|||| ||||
| `core11` | Tiny11 Core | 3.0 GB | | `core11` | Tiny11 Core | 3.0 GB |
| `tiny11` | Tiny11 | 5.3 GB | | `tiny11` | Tiny11 | 5.3 GB |
| `tiny10` | Tiny10 | 3.6 GB | | `tiny10` | Tiny10 | 3.6 GB |
| `reactos` | Reactos | 0.03 GB |
> [!TIP] > [!TIP]
> To install ARM64 versions of Windows use [dockur/windows-arm](https://github.com/dockur/windows-arm/). > To install ARM64 versions of Windows use [dockur/windows-arm](https://github.com/dockur/windows-arm/).
+36 -1
View File
@@ -67,7 +67,7 @@ SERVER_EDITION_ORDER=(
"-hv|hv|hv hv-*" "-hv|hv|hv hv-*"
) )
MIRRORS=3 MIRRORS=4
parseVersion() { parseVersion() {
@@ -184,6 +184,9 @@ parseVersion() {
"tiny10" | "tiny 10" ) "tiny10" | "tiny 10" )
VERSION="tiny10" VERSION="tiny10"
;; ;;
"reactos" | "react os" )
VERSION="reactos"
;;
esac esac
SUGGEST=$(getSuggestedVersion "$VERSION") SUGGEST=$(getSuggestedVersion "$VERSION")
@@ -483,6 +486,7 @@ printVersion() {
"tiny11"* ) desc="Tiny 11" ;; "tiny11"* ) desc="Tiny 11" ;;
"tiny10"* ) desc="Tiny 10" ;; "tiny10"* ) desc="Tiny 10" ;;
"core11"* ) desc="Core 11" ;; "core11"* ) desc="Core 11" ;;
"reactos"* ) desc="Reactos" ;;
"win7"* ) desc="Windows 7" ;; "win7"* ) desc="Windows 7" ;;
"win8"* ) desc="Windows 8" ;; "win8"* ) desc="Windows 8" ;;
"win10"* ) desc="Windows 10" ;; "win10"* ) desc="Windows 10" ;;
@@ -690,6 +694,8 @@ fromFile() {
id="tiny11" ;; id="tiny11" ;;
"tiny10"* | "tiny_10"* ) "tiny10"* | "tiny_10"* )
id="tiny10" ;; id="tiny10" ;;
"reactos"* )
id="reactos" ;;
*"_serverhypercore_"* ) *"_serverhypercore_"* )
id="win2019${add}-hv" ;; id="win2019${add}-hv" ;;
*"server2025"* | *"server_2025"* ) *"server2025"* | *"server_2025"* )
@@ -1299,6 +1305,35 @@ getLink2() {
getLink3() { getLink3() {
local id="$1"
local lang="$2"
local ret="$3"
local url=""
local sum=""
local size=""
local host="https://iso.reactos.org"
[[ "${lang,,}" != "en" && "${lang,,}" != "en-us" ]] && return 0
case "${id,,}" in
"reactos" )
size=0
sum=""
url="livecd/latest-x86-gcc-lin-rel"
;;
esac
case "${ret,,}" in
"sum" ) echo "$sum" ;;
"size" ) echo "$size" ;;
*) [ -n "$url" ] && echo "$host/$url";;
esac
return 0
}
getLink4() {
local id="$1" local id="$1"
local lang="$2" local lang="$2"
local ret="$3" local ret="$3"
+20 -2
View File
@@ -510,7 +510,7 @@ skipVersion() {
local id="$1" local id="$1"
case "${id,,}" in case "${id,,}" in
"win9"* | "winxp"* | "win2k"* | "win2003"* ) "win9"* | "winxp"* | "win2k"* | "win2003"* | "reactos" )
return 0 ;; return 0 ;;
esac esac
@@ -624,6 +624,24 @@ detectLegacy() {
return 1 return 1
} }
detectReactOS() {
local dir="$1"
local marker
marker=$(find "$dir" -maxdepth 2 -type f \
\( \
-ipath '*/reactos/reactos.inf' -o \
-ipath '*/reactos/unattend.inf' \
\) \
-print -quit) || return 1
[ -n "$marker" ] || return 1
DETECTED="reactos"
return 0
}
resolveImage() { resolveImage() {
local version="$1" local version="$1"
@@ -821,7 +839,7 @@ detectImage() {
info "Detecting version from ISO image..." info "Detecting version from ISO image..."
if detectLegacy "$dir"; then if detectLegacy "$dir" || detectReactOS "$dir"; then
desc=$(printEdition "$DETECTED" "$DETECTED" "Y") || return 1 desc=$(printEdition "$DETECTED" "$DETECTED" "Y") || return 1
info "Detected: $desc" info "Detected: $desc"
return 0 return 0
+25 -6
View File
@@ -655,8 +655,8 @@ extractImage() {
size=$(stat -c%s "$iso") size=$(stat -c%s "$iso")
if (( size < 100000000 )); then if (( size < 10000000 )); then
error "Invalid ISO file: Size is smaller than 100 MB" && return 1 error "Invalid ISO file: Size is smaller than 10 MB" && return 1
fi fi
checkFreeSpace "$dir" "$size" || return 1 checkFreeSpace "$dir" "$size" || return 1
@@ -684,15 +684,23 @@ extractImage() {
file=$(find "$dir" -maxdepth 1 -type f -iname "*.iso" -print -quit) file=$(find "$dir" -maxdepth 1 -type f -iname "*.iso" -print -quit)
if [ -z "$file" ]; then if [ -z "$file" ]; then
error "Failed to find any .iso file in archive!" && return 1 error "Failed to find any .iso file in archive!"
return 1
fi fi
if ! 7z x "$file" -o"$dir" > /dev/null; then if ! 7z x "$file" -o"$dir" > /dev/null; then
error "Failed to extract archive!" && return 1 error "Failed to extract archive!"
return 1
fi fi
LABEL=$(isoinfo -d -i "$file" | sed -n 's/Volume id: //p') || LABEL="" LABEL=$(isoinfo -d -i "$file" | sed -n 's/Volume id: //p') || LABEL=""
rm -f "$file" || warn "Failed to remove temporary ISO file: $file"
if ! mv -f -- "$file" "$iso"; then
error "Failed to preserve extracted ISO file: $file"
return 1
fi
UNPACK=""
fi fi
@@ -750,6 +758,16 @@ setMachine() {
"winvista"* | "win7"* | "win2008"* ) "winvista"* | "win7"* | "win2008"* )
BOOT_MODE="windows_legacy" ;; BOOT_MODE="windows_legacy" ;;
"reactos" )
VGA="cirrus"
MACHINE="pc"
REMOVE="N"
REBUILD="N"
USB="pci-ohci"
DISK_TYPE="auto"
BOOT_MODE="windows_legacy"
[ -z "${ADAPTER:-}" ] && ADAPTER="rtl8139" ;;
esac esac
case "${id,,}" in case "${id,,}" in
@@ -763,7 +781,8 @@ setMachine() {
case "${id,,}" in case "${id,,}" in
"winxp"* | "win2003"* | "winvistax86"* | "win7x86"* | "win2008r2x86"* ) "winxp"* | "win2003"* | "winvistax86"* | \
"win7x86"* | "win2008r2x86"* | "reactos")
if isQ35 "${MACHINE:-q35}"; then if isQ35 "${MACHINE:-q35}"; then
+12 -6
View File
@@ -841,11 +841,13 @@ getESD() {
isCompressed() { isCompressed() {
local file="$1" local url="${1%%\?*}"
case "${file,,}" in case "${url,,}" in
*".7z" | *".zip" | *".rar" | *".lzma" | *".bz" | *".bz2" ) *.7z | *.zip | *.rar | *.tar | *.cab | *.cpio | \
return 0 ;; *.lzh | *.lha | *.xar | */latest-x86-gcc-lin-rel )
return 0
;;
esac esac
return 1 return 1
@@ -950,14 +952,18 @@ tryDownload() {
local desc="$6" local desc="$6"
local seconds="$7" local seconds="$7"
local web_desc="$8" local web_desc="$8"
local total local total minimum="104857600"
if isCompressed "$url"; then
minimum="10485760"
fi
if downloadRetry \ if downloadRetry \
"$iso" \ "$iso" \
"${CONNECTIONS:-1}" \ "${CONNECTIONS:-1}" \
"$seconds" \ "$seconds" \
"$desc" \ "$desc" \
"100000000" \ "$minimum" \
"$iso" \ "$iso" \
"$url" \ "$url" \
"$size" \ "$size" \
+29 -9
View File
@@ -54,13 +54,23 @@ boot() {
legacyBootReady() { legacyBootReady() {
local last local line last recent
local bios="Booting from Hard" local hard="Booting from Hard"
local cdrom="Booting from DVD/CD"
last=$(grep "^Booting.*" "$QEMU_PTY" | tail -1) line=$(grep -n "^Booting.*" "$QEMU_PTY" | tail -1)
[[ "${last,,}" != "${bios,,}"* ]] && return 1 [ -z "$line" ] && return 1
grep -Fq "No bootable device." "$QEMU_PTY" && return 1
grep -Fq "BOOTMGR is missing" "$QEMU_PTY" && return 1 last="${line#*:}"
recent=$(tail -n +"${line%%:*}" "$QEMU_PTY")
[[ "${last,,}" != "${hard,,}"* ]] && return 1
grep -Fq "Loading FreeLoader..." <<< "$recent" && return 0
grep -Fq "No bootable device." <<< "$recent" && return 1
grep -Fq "BOOTMGR is missing" <<< "$recent" && return 1
grep -Fq "Boot failed: not a bootable disk" <<< "$recent" && return 1
grep -Fq "Boot failed: could not read the boot disk" <<< "$recent" && return 1
return 0 return 0
} }
@@ -75,8 +85,14 @@ ready() {
return 1 return 1
fi fi
local line="\"Windows Boot Manager\"" local last
grep -Fq "$line" "$QEMU_PTY" && return 0 last=$(grep -E \
'BdsDxe: starting Boot[[:xdigit:]]{4} ' \
"$QEMU_PTY" | tail -1)
grep -Eq \
'BdsDxe: starting Boot[[:xdigit:]]{4} "Windows Boot Manager" from HD\(' \
<<< "$last" && return 0
return 1 return 1
} }
@@ -150,7 +166,11 @@ abortDuringSetup() {
local code="$1" local code="$1"
info "Cannot send ACPI signal during $(app) setup, aborting..." if [[ "${DETECTED,,}" != "reactos" ]] || [ -n "${CUSTOM:-}" ]; then
info "Cannot send ACPI signal during $(app) setup, aborting..."
else
info "ReactOS LiveCD does not support ACPI shutdown, terminating..."
fi
terminateQemu terminateQemu