Compare commits

..

No commits in common. "master" and "v5.11" have entirely different histories.

34 changed files with 97 additions and 202 deletions

View file

@ -15,5 +15,6 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View file

@ -15,5 +15,6 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View file

@ -15,5 +15,6 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View file

@ -15,5 +15,6 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View file

@ -15,5 +15,6 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View file

@ -15,5 +15,6 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View file

@ -15,5 +15,6 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View file

@ -15,5 +15,6 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View file

@ -15,5 +15,6 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View file

@ -15,5 +15,6 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View file

@ -15,5 +15,6 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View file

@ -15,5 +15,6 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View file

@ -15,5 +15,6 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View file

@ -15,5 +15,6 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View file

@ -15,5 +15,6 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View file

@ -15,5 +15,6 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View file

@ -15,5 +15,6 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View file

@ -15,5 +15,6 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View file

@ -15,5 +15,6 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View file

@ -15,5 +15,6 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View file

@ -15,5 +15,6 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "../codespaces.yml", "dockerComposeFile": "../codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View file

@ -15,5 +15,6 @@
"onAutoForward": "ignore" "onAutoForward": "ignore"
}, },
"dockerComposeFile": "codespaces.yml", "dockerComposeFile": "codespaces.yml",
"workspaceFolder": "/workspaces/windows",
"initializeCommand": "docker system prune --all --force" "initializeCommand": "docker system prune --all --force"
} }

View file

@ -22,7 +22,7 @@ jobs:
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@v6 uses: actions/checkout@v5
with: with:
fetch-depth: 0 fetch-depth: 0
- -

View file

@ -9,7 +9,7 @@ jobs:
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@v6 uses: actions/checkout@v5
- -
name: Run ShellCheck name: Run ShellCheck
uses: ludeeus/action-shellcheck@master uses: ludeeus/action-shellcheck@master

View file

@ -12,15 +12,13 @@ jobs:
dockerHubDescription: dockerHubDescription:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- - uses: actions/checkout@v5
name: Checkout repo -
uses: actions/checkout@v6 name: Docker Hub Description
- uses: peter-evans/dockerhub-description@v5
name: Docker Hub Description with:
uses: peter-evans/dockerhub-description@v5 username: ${{ secrets.DOCKERHUB_USERNAME }}
with: password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ secrets.DOCKERHUB_USERNAME }} repository: ${{ secrets.DOCKERHUB_REPO }}
password: ${{ secrets.DOCKERHUB_TOKEN }} short-description: ${{ github.event.repository.description }}
repository: ${{ secrets.DOCKERHUB_REPO }} readme-filepath: ./readme.md
short-description: ${{ github.event.repository.description }}
readme-filepath: ./readme.md

View file

@ -1,66 +0,0 @@
on:
pull_request:
name: "Review"
permissions:
contents: read
pull-requests: write
checks: write
jobs:
review:
name: review
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v6
-
name: Spelling
uses: reviewdog/action-misspell@v1
with:
locale: "US"
level: warning
pattern: |
*.md
*.sh
reporter: github-pr-review
github_token: ${{ secrets.GITHUB_TOKEN }}
-
name: Hadolint
uses: reviewdog/action-hadolint@v1
with:
level: warning
reporter: github-pr-review
hadolint_ignore: DL3006 DL3008
github_token: ${{ secrets.GITHUB_TOKEN }}
-
name: YamlLint
uses: reviewdog/action-yamllint@v1
with:
level: warning
reporter: github-pr-review
github_token: ${{ secrets.GITHUB_TOKEN }}
-
name: ActionLint
uses: reviewdog/action-actionlint@v1
with:
level: warning
reporter: github-pr-review
github_token: ${{ secrets.GITHUB_TOKEN }}
-
name: Shellformat
uses: reviewdog/action-shfmt@v1
with:
level: warning
shfmt_flags: "-i 2 -ci -bn"
github_token: ${{ secrets.GITHUB_TOKEN }}
-
name: Shellcheck
uses: reviewdog/action-shellcheck@v1
with:
level: warning
reporter: github-pr-review
shellcheck_flags: -x -e SC1091 -e SC2001 -e SC2002 -e SC2034 -e SC2064 -e SC2153 -e SC2317 -e SC2028
github_token: ${{ secrets.GITHUB_TOKEN }}

View file

@ -3,7 +3,7 @@
ARG VERSION_ARG="latest" ARG VERSION_ARG="latest"
FROM scratch AS build-amd64 FROM scratch AS build-amd64
COPY --from=qemux/qemu:7.29 / / COPY --from=qemux/qemu:7.26 / /
ARG TARGETARCH ARG TARGETARCH
ARG DEBCONF_NOWARNINGS="yes" ARG DEBCONF_NOWARNINGS="yes"
@ -19,7 +19,7 @@ RUN set -eu && \
cabextract \ cabextract \
libxml2-utils \ libxml2-utils \
libarchive-tools && \ libarchive-tools && \
wget "https://github.com/gershnik/wsdd-native/releases/download/v1.22/wsddn_1.22_${TARGETARCH}.deb" -O /tmp/wsddn.deb -q && \ wget "https://github.com/gershnik/wsdd-native/releases/download/v1.21/wsddn_1.21_${TARGETARCH}.deb" -O /tmp/wsddn.deb -q && \
dpkg -i /tmp/wsddn.deb && \ dpkg -i /tmp/wsddn.deb && \
apt-get clean && \ apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
@ -27,7 +27,7 @@ RUN set -eu && \
COPY --chmod=755 ./src /run/ COPY --chmod=755 ./src /run/
COPY --chmod=755 ./assets /run/assets COPY --chmod=755 ./assets /run/assets
ADD --chmod=664 https://github.com/qemus/virtiso-whql/releases/download/v1.9.49-0/virtio-win-1.9.49.tar.xz /var/drivers.txz ADD --chmod=664 https://github.com/qemus/virtiso-whql/releases/download/v1.9.48-0/virtio-win-1.9.48.tar.xz /var/drivers.txz
FROM dockurr/windows-arm:${VERSION_ARG} AS build-arm64 FROM dockurr/windows-arm:${VERSION_ARG} AS build-arm64
FROM build-${TARGETARCH} FROM build-${TARGETARCH}

View file

@ -22,7 +22,7 @@ Windows inside a Docker container.
## Video 📺 ## Video 📺
[![Youtube](https://img.youtube.com/vi/xhGYobuG508/maxresdefault.jpg)](https://www.youtube.com/watch?v=xhGYobuG508) [![Youtube](https://img.youtube.com/vi/xhGYobuG508/0.jpg)](https://www.youtube.com/watch?v=xhGYobuG508)
## Usage 🐳 ## Usage 🐳
@ -53,7 +53,7 @@ services:
##### Via Docker CLI: ##### Via Docker CLI:
```bash ```bash
docker run -it --rm --name windows -e "VERSION=11" -p 8006:8006 --device=/dev/kvm --device=/dev/net/tun --cap-add NET_ADMIN -v "${PWD:-.}/windows:/storage" --stop-timeout 120 docker.io/dockurr/windows docker run -it --rm --name windows -p 8006:8006 --device=/dev/kvm --device=/dev/net/tun --cap-add NET_ADMIN -v "${PWD:-.}/windows:/storage" --stop-timeout 120 dockurr/windows
``` ```
##### Via Kubernetes: ##### Via Kubernetes:

View file

@ -857,14 +857,14 @@ getLink1() {
url="8.x/8.1/en_windows_8.1_enterprise_with_update_x64_dvd_6054382.iso" url="8.x/8.1/en_windows_8.1_enterprise_with_update_x64_dvd_6054382.iso"
;; ;;
"win2025" | "win2025-eval" ) "win2025" | "win2025-eval" )
size=7571058688 size=6786627584
sum="d273d0a85565ffbc06a3d46313f619103e2830a3373306ddbb9a08b8824f509d" sum="bf3ef0849c7cb5e818e1035b7466d206af5aa227ace1a3f4b0de2bf00d2e2144"
url="server/2025/en-us_windows_server_2025_updated_oct_2025_x64_dvd_6c0c5aa8.iso" url="server/2025/en-us_windows_server_2025_updated_april_2025_x64_dvd_ea86301d.iso"
;; ;;
"win2022" | "win2022-eval" ) "win2022" | "win2022-eval" )
size=6023239680 size=6005706752
sum="5d6d91efa972cbdd6701d78db1dcf6a34c7024ca931c1718e7cb3d0c6dd54e88" sum="cea2cb2c09de9910c236e64eae3a801c55e9c77ec25e8d81585e3a4581d24bfb"
url="server/2022/en-us_windows_server_2022_updated_oct_2025_x64_dvd_26e9af36.iso" url="server/2022/en-us_windows_server_2022_updated_april_2025_x64_dvd_3f755ec1.iso"
;; ;;
"win2019" | "win2019-eval" ) "win2019" | "win2019-eval" )
size=5575774208 size=5575774208
@ -1766,7 +1766,7 @@ prepareInstall() {
echo "" echo ""
echo "Call Domain.MoveHere(LocalAdminADsPath, \"$username\")" echo "Call Domain.MoveHere(LocalAdminADsPath, \"$username\")"
echo "" echo ""
echo "Set oLink = WshShell.CreateShortcut(WshShell.SpecialFolders(\"Desktop\") & \"\\Shared.lnk\")" echo "Set oLink = WshShell.CreateShortcut(WshShell.ExpandEnvironmentStrings(\"%userprofile%\\Desktop\\Shared.lnk\"))"
echo "With oLink" echo "With oLink"
echo " .TargetPath = \"\\\\host.lan\\Data\"" echo " .TargetPath = \"\\\\host.lan\\Data\""
echo " .Save" echo " .Save"
@ -1915,16 +1915,16 @@ setMachine() {
USB="no" USB="no"
VGA="cirrus" VGA="cirrus"
DISK_TYPE="auto" DISK_TYPE="auto"
ADAPTER="rtl8139"
MACHINE="pc-i440fx-2.4" MACHINE="pc-i440fx-2.4"
BOOT_MODE="windows_legacy" BOOT_MODE="windows_legacy" ;;
[ -z "${ADAPTER:-}" ] && ADAPTER="pcnet" ;;
"win2k"* ) "win2k"* )
VGA="cirrus" VGA="cirrus"
MACHINE="pc" MACHINE="pc"
USB="pci-ohci" USB="pci-ohci"
DISK_TYPE="auto" DISK_TYPE="auto"
BOOT_MODE="windows_legacy" ADAPTER="rtl8139"
[ -z "${ADAPTER:-}" ] && ADAPTER="rtl8139" ;; BOOT_MODE="windows_legacy" ;;
"winxp"* | "win2003"* ) "winxp"* | "win2003"* )
DISK_TYPE="blk" DISK_TYPE="blk"
BOOT_MODE="windows_legacy" ;; BOOT_MODE="windows_legacy" ;;

View file

@ -39,8 +39,6 @@ terminal
tail -fn +0 "$QEMU_LOG" --pid=$$ 2>/dev/null & tail -fn +0 "$QEMU_LOG" --pid=$$ 2>/dev/null &
cat "$QEMU_TERM" 2> /dev/null | tee "$QEMU_PTY" | \ cat "$QEMU_TERM" 2> /dev/null | tee "$QEMU_PTY" | \
sed -u -e 's/\x1B\[[=0-9;]*[a-z]//gi' \ sed -u -e 's/\x1B\[[=0-9;]*[a-z]//gi' \
-e 's/\x1B\x63//g' -e 's/\x1B\[[=?]7l//g' \
-e '/^$/d' -e 's/\x44\x53\x73//g' \
-e 's/failed to load Boot/skipped Boot/g' \ -e 's/failed to load Boot/skipped Boot/g' \
-e 's/0): Not Found/0)/g' & wait $! || : -e 's/0): Not Found/0)/g' & wait $! || :

View file

@ -22,11 +22,7 @@ backup () {
fi fi
if ! makeDir "$root"; then mkdir -p "$root"
error "Failed to create directory \"$root\" !"
return 1
fi
local folder="$name" local folder="$name"
local dir="$root/$folder" local dir="$root/$folder"
@ -38,11 +34,7 @@ backup () {
done done
rm -rf "$dir" rm -rf "$dir"
mkdir -p "$dir"
if ! makeDir "$dir"; then
error "Failed to create directory \"$dir\" !"
return 1
fi
[ -f "$iso" ] && mv -f "$iso" "$dir/" [ -f "$iso" ] && mv -f "$iso" "$dir/"
find "$STORAGE" -maxdepth 1 -type f -iname 'data.*' -not -iname '*.iso' -exec mv -n {} "$dir/" \; find "$STORAGE" -maxdepth 1 -type f -iname 'data.*' -not -iname '*.iso' -exec mv -n {} "$dir/" \;
@ -135,6 +127,7 @@ startInstall() {
if [[ "${VERSION,,}" == "http"* ]]; then if [[ "${VERSION,,}" == "http"* ]]; then
file=$(basename "${VERSION%%\?*}") file=$(basename "${VERSION%%\?*}")
file="${file//+/ }"
printf -v file '%b' "${file//%/\\x}" printf -v file '%b' "${file//%/\\x}"
file="${file//[!A-Za-z0-9._-]/_}" file="${file//[!A-Za-z0-9._-]/_}"
@ -163,9 +156,7 @@ startInstall() {
! backup "" && error "Backup failed!" ! backup "" && error "Backup failed!"
fi fi
if ! makeDir "$TMP"; then mkdir -p "$TMP"
error "Failed to create directory \"$TMP\" !"
fi
if [ -z "$CUSTOM" ]; then if [ -z "$CUSTOM" ]; then
@ -187,20 +178,6 @@ startInstall() {
return 0 return 0
} }
writeFile() {
local txt="$1"
local path="$2"
echo "$txt" >"$path"
if ! setOwner "$path"; then
error "Failed to set the owner for \"$path\" !"
fi
return 0
}
finishInstall() { finishInstall() {
local iso="$1" local iso="$1"
@ -211,10 +188,6 @@ finishInstall() {
error "Failed to find ISO file: $iso" && return 1 error "Failed to find ISO file: $iso" && return 1
fi fi
if [[ "$iso" == "$STORAGE/"* ]]; then
! setOwner "$iso" && error "Failed to set the owner for \"$iso\" !"
fi
if [[ "$aborted" != [Yy1]* ]]; then if [[ "$aborted" != [Yy1]* ]]; then
# Mark ISO as prepared via magic byte # Mark ISO as prepared via magic byte
byte="16" && [[ "$MANUAL" == [Yy1]* ]] && byte="17" byte="16" && [[ "$MANUAL" == [Yy1]* ]] && byte="17"
@ -223,68 +196,56 @@ finishInstall() {
fi fi
fi fi
local file="$STORAGE/windows.ver" cp -f /run/version "$STORAGE/windows.ver"
cp -f /run/version "$file"
! setOwner "$file" && error "Failed to set the owner for \"$file\" !"
if [[ "$iso" == "$STORAGE/"* ]]; then if [[ "$iso" == "$STORAGE/"* ]]; then
if [[ "$aborted" != [Yy1]* ]] || [ -z "$CUSTOM" ]; then if [[ "$aborted" != [Yy1]* ]] || [ -z "$CUSTOM" ]; then
base=$(basename "$iso") base=$(basename "$iso")
file="$STORAGE/windows.base" echo "$base" > "$STORAGE/windows.base"
writeFile "$base" "$file"
fi fi
fi fi
if [[ "${PLATFORM,,}" == "x64" ]]; then if [[ "${PLATFORM,,}" == "x64" ]]; then
if [[ "${BOOT_MODE,,}" == "windows_legacy" ]]; then if [[ "${BOOT_MODE,,}" == "windows_legacy" ]]; then
file="$STORAGE/windows.mode" echo "$BOOT_MODE" > "$STORAGE/windows.mode"
writeFile "$BOOT_MODE" "$file"
if [[ "${MACHINE,,}" != "q35" ]]; then if [[ "${MACHINE,,}" != "q35" ]]; then
file="$STORAGE/windows.old" echo "$MACHINE" > "$STORAGE/windows.old"
writeFile "$MACHINE" "$file"
fi fi
else else
# Enable secure boot + TPM on manual installs as Win11 requires # Enable secure boot + TPM on manual installs as Win11 requires
if [[ "$MANUAL" == [Yy1]* || "$aborted" == [Yy1]* ]]; then if [[ "$MANUAL" == [Yy1]* || "$aborted" == [Yy1]* ]]; then
if [[ "${DETECTED,,}" == "win11"* ]]; then if [[ "${DETECTED,,}" == "win11"* ]]; then
BOOT_MODE="windows_secure" BOOT_MODE="windows_secure"
file="$STORAGE/windows.mode" echo "$BOOT_MODE" > "$STORAGE/windows.mode"
writeFile "$BOOT_MODE" "$file"
fi fi
fi fi
# Enable secure boot on multi-socket systems to workaround freeze # Enable secure boot on multi-socket systems to workaround freeze
if [ -n "$SOCKETS" ] && [[ "$SOCKETS" != "1" ]]; then if [ -n "$SOCKETS" ] && [[ "$SOCKETS" != "1" ]]; then
BOOT_MODE="windows_secure" BOOT_MODE="windows_secure"
file="$STORAGE/windows.mode" echo "$BOOT_MODE" > "$STORAGE/windows.mode"
writeFile "$BOOT_MODE" "$file"
fi fi
fi fi
fi fi
if [ -n "${ARGS:-}" ]; then if [ -n "${ARGS:-}" ]; then
ARGUMENTS="$ARGS ${ARGUMENTS:-}" ARGUMENTS="$ARGS ${ARGUMENTS:-}"
file="$STORAGE/windows.args" echo "$ARGS" > "$STORAGE/windows.args"
writeFile "$ARGS" "$file"
fi fi
if [ -n "${VGA:-}" ] && [[ "${VGA:-}" != "virtio"* ]]; then if [ -n "${VGA:-}" ] && [[ "${VGA:-}" != "virtio"* ]]; then
file="$STORAGE/windows.vga" echo "$VGA" > "$STORAGE/windows.vga"
writeFile "$VGA" "$file"
fi fi
if [ -n "${USB:-}" ] && [[ "${USB:-}" != "qemu-xhci"* ]]; then if [ -n "${USB:-}" ] && [[ "${USB:-}" != "qemu-xhci"* ]]; then
file="$STORAGE/windows.usb" echo "$USB" > "$STORAGE/windows.usb"
writeFile "$USB" "$file"
fi fi
if [ -n "${DISK_TYPE:-}" ] && [[ "${DISK_TYPE:-}" != "scsi" ]]; then if [ -n "${DISK_TYPE:-}" ] && [[ "${DISK_TYPE:-}" != "scsi" ]]; then
file="$STORAGE/windows.type" echo "$DISK_TYPE" > "$STORAGE/windows.type"
writeFile "$DISK_TYPE" "$file"
fi fi
if [ -n "${ADAPTER:-}" ] && [[ "${ADAPTER:-}" != "virtio-net-pci" ]]; then if [ -n "${ADAPTER:-}" ] && [[ "${ADAPTER:-}" != "virtio-net-pci" ]]; then
file="$STORAGE/windows.net" echo "$ADAPTER" > "$STORAGE/windows.net"
writeFile "$ADAPTER" "$file"
fi fi
rm -rf "$TMP" rm -rf "$TMP"
@ -390,10 +351,7 @@ extractESD() {
fi fi
rm -rf "$dir" rm -rf "$dir"
mkdir -p "$dir"
if ! makeDir "$dir"; then
error "Failed to create directory \"$dir\" !" && return 1
fi
size=9606127360 size=9606127360
size_gb=$(formatBytes "$size") size_gb=$(formatBytes "$size")
@ -449,8 +407,6 @@ extractESD() {
error "Adding WinPE failed ($retVal)" && return 1 error "Adding WinPE failed ($retVal)" && return 1
} }
fKill "progress.sh"
local msg="Extracting $desc setup" local msg="Extracting $desc setup"
info "$msg..." info "$msg..."
@ -530,17 +486,14 @@ extractImage() {
info "$msg..." && html "$msg..." info "$msg..." && html "$msg..."
rm -rf "$dir" rm -rf "$dir"
mkdir -p "$dir"
if ! makeDir "$dir"; then
error "Failed to create directory \"$dir\" !" && return 1
fi
size=$(stat -c%s "$iso") size=$(stat -c%s "$iso")
size_gb=$(formatBytes "$size") size_gb=$(formatBytes "$size")
space=$(df --output=avail -B 1 "$dir" | tail -n 1) space=$(df --output=avail -B 1 "$dir" | tail -n 1)
space_gb=$(formatBytes "$space") space_gb=$(formatBytes "$space")
if (( size < 100000000 )); then if ((size<100000000)); then
error "Invalid ISO file: Size is smaller than 100 MB" && return 1 error "Invalid ISO file: Size is smaller than 100 MB" && return 1
fi fi
@ -1224,8 +1177,6 @@ buildImage() {
[[ "$error" != "$hide" ]] && echo "$error" [[ "$error" != "$hide" ]] && echo "$error"
mv -f "$out" "$BOOT" || return 1 mv -f "$out" "$BOOT" || return 1
! setOwner "$BOOT" && error "Failed to set the owner for \"$BOOT\" !"
return 0 return 0
} }

View file

@ -487,11 +487,8 @@ getESD() {
info "$msg" && html "$msg" info "$msg" && html "$msg"
rm -rf "$dir" rm -rf "$dir"
mkdir -p "$dir"
if ! makeDir "$dir"; then
error "Failed to create directory \"$dir\" !" && return 1
fi
local xFile="products.xml" local xFile="products.xml"
local eFile="esd_edition.xml" local eFile="esd_edition.xml"
local fFile="products_filter.xml" local fFile="products_filter.xml"

View file

@ -76,12 +76,6 @@ finish() {
local pid local pid
local cnt=0 local cnt=0
local reason=$1 local reason=$1
local pids=(
"/var/run/tpm.pid"
"/var/run/wsdd.pid"
"/var/run/samba/nmbd.pid"
"/var/run/samba/smbd.pid"
)
touch "$QEMU_END" touch "$QEMU_END"
@ -111,21 +105,28 @@ finish() {
if [ ! -f "$STORAGE/windows.boot" ] && [ -f "$BOOT" ]; then if [ ! -f "$STORAGE/windows.boot" ] && [ -f "$BOOT" ]; then
# Remove CD-ROM ISO after install # Remove CD-ROM ISO after install
if ready; then if ready; then
local file="$STORAGE/windows.boot" touch "$STORAGE/windows.boot"
touch "$file"
! setOwner "$file" && error "Failed to set the owner for \"$file\" !"
if [[ "$REMOVE" != [Nn]* ]]; then if [[ "$REMOVE" != [Nn]* ]]; then
rm -f "$BOOT" 2>/dev/null || true rm -f "$BOOT" 2>/dev/null || true
fi fi
fi fi
fi fi
for pid in "${pids[@]}"; do pid="/var/run/tpm.pid"
if [[ -s "$pid" ]]; then [ -s "$pid" ] && pKill "$(<"$pid")"
pKill "$(cat "$pid")" rm -f "$pid"
fi
rm -f "$pid" pid="/var/run/wsdd.pid"
done [ -s "$pid" ] && pKill "$(<"$pid")"
rm -f "$pid"
pid="/var/run/samba/nmbd.pid"
[ -s "$pid" ] && pKill "$(<"$pid")"
rm -f "$pid"
pid="/var/run/samba/smbd.pid"
[ -s "$pid" ] && pKill "$(<"$pid")"
rm -f "$pid"
closeNetwork closeNetwork

View file

@ -46,21 +46,10 @@ addShare() {
local cfg="$5" local cfg="$5"
local owner="" local owner=""
if [ ! -d "$dir" ]; then mkdir -p "$dir" || return 1
if ! mkdir -p "$dir"; then
error "Failed to create shared folder ($dir)." && return 1
fi
fi
if ! ls -A "$dir" >/dev/null 2>&1; then if ! ls -A "$dir" >/dev/null 2>&1; then
msg="No permission to access shared folder ($dir)." error "Failed to access directory $dir" && return 1
msg+=" If SELinux is active, you need to add the \":Z\" flag to the bind mount."
error "$msg" && return 1
fi
if [ ! -w "$dir" ]; then
msg="shared folder ($dir) is not writeable!"
warn "$msg"
fi fi
if [ -z "$(ls -A "$dir")" ]; then if [ -z "$(ls -A "$dir")" ]; then
@ -147,21 +136,26 @@ share="/shared"
[ ! -d "$share" ] && [ -d "$STORAGE/data" ] && share="$STORAGE/data" [ ! -d "$share" ] && [ -d "$STORAGE/data" ] && share="$STORAGE/data"
[ ! -d "$share" ] && share="$tmp" [ ! -d "$share" ] && share="$tmp"
! addShare "$share" "/shared" "Data" "Shared" "$SAMBA_CONFIG" && return 0 m1="Failed to add shared folder"
m2="Please check its permissions."
if ! addShare "$share" "/shared" "Data" "Shared" "$SAMBA_CONFIG"; then
error "$m1 '$share'. $m2" && return 0
fi
if [ -d "/shared2" ]; then if [ -d "/shared2" ]; then
addShare "/shared2" "/shared2" "Data2" "Shared" "$SAMBA_CONFIG" || : addShare "/shared2" "/shared2" "Data2" "Shared" "$SAMBA_CONFIG" || error "$m1 '/shared2'. $m2"
else else
if [ -d "/data2" ]; then if [ -d "/data2" ]; then
addShare "/data2" "/shared2" "Data2" "Shared" "$SAMBA_CONFIG" || : addShare "/data2" "/shared2" "Data2" "Shared" "$SAMBA_CONFIG" || error "$m1 '/data2'. $m2."
fi fi
fi fi
if [ -d "/shared3" ]; then if [ -d "/shared3" ]; then
addShare "/shared3" "/shared3" "Data3" "Shared" "$SAMBA_CONFIG" || : addShare "/shared3" "/shared3" "Data3" "Shared" "$SAMBA_CONFIG" || error "$m1 '/shared3'. $m2"
else else
if [ -d "/data3" ]; then if [ -d "/data3" ]; then
addShare "/data3" "/shared3" "Data3" "Shared" "$SAMBA_CONFIG" || : addShare "/data3" "/shared3" "Data3" "Shared" "$SAMBA_CONFIG" || error "$m1 '/data3'. $m2"
fi fi
fi fi