Compare commits

...

8 commits

27 changed files with 179 additions and 97 deletions

View file

@ -8,12 +8,13 @@
"portsAttributes": { "portsAttributes": {
"8006": { "8006": {
"label": "Web", "label": "Web",
"onAutoForward": "openBrowser" "onAutoForward": "notify"
} }
}, },
"otherPortsAttributes": { "otherPortsAttributes": {
"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

@ -8,12 +8,13 @@
"portsAttributes": { "portsAttributes": {
"8006": { "8006": {
"label": "Web", "label": "Web",
"onAutoForward": "openBrowser" "onAutoForward": "notify"
} }
}, },
"otherPortsAttributes": { "otherPortsAttributes": {
"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

@ -8,12 +8,13 @@
"portsAttributes": { "portsAttributes": {
"8006": { "8006": {
"label": "Web", "label": "Web",
"onAutoForward": "openBrowser" "onAutoForward": "notify"
} }
}, },
"otherPortsAttributes": { "otherPortsAttributes": {
"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

@ -8,12 +8,13 @@
"portsAttributes": { "portsAttributes": {
"8006": { "8006": {
"label": "Web", "label": "Web",
"onAutoForward": "openBrowser" "onAutoForward": "notify"
} }
}, },
"otherPortsAttributes": { "otherPortsAttributes": {
"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

@ -8,12 +8,13 @@
"portsAttributes": { "portsAttributes": {
"8006": { "8006": {
"label": "Web", "label": "Web",
"onAutoForward": "openBrowser" "onAutoForward": "notify"
} }
}, },
"otherPortsAttributes": { "otherPortsAttributes": {
"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

@ -8,12 +8,13 @@
"portsAttributes": { "portsAttributes": {
"8006": { "8006": {
"label": "Web", "label": "Web",
"onAutoForward": "openBrowser" "onAutoForward": "notify"
} }
}, },
"otherPortsAttributes": { "otherPortsAttributes": {
"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

@ -8,12 +8,13 @@
"portsAttributes": { "portsAttributes": {
"8006": { "8006": {
"label": "Web", "label": "Web",
"onAutoForward": "openBrowser" "onAutoForward": "notify"
} }
}, },
"otherPortsAttributes": { "otherPortsAttributes": {
"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

@ -8,12 +8,13 @@
"portsAttributes": { "portsAttributes": {
"8006": { "8006": {
"label": "Web", "label": "Web",
"onAutoForward": "openBrowser" "onAutoForward": "notify"
} }
}, },
"otherPortsAttributes": { "otherPortsAttributes": {
"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

@ -8,12 +8,13 @@
"portsAttributes": { "portsAttributes": {
"8006": { "8006": {
"label": "Web", "label": "Web",
"onAutoForward": "openBrowser" "onAutoForward": "notify"
} }
}, },
"otherPortsAttributes": { "otherPortsAttributes": {
"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

@ -8,12 +8,13 @@
"portsAttributes": { "portsAttributes": {
"8006": { "8006": {
"label": "Web", "label": "Web",
"onAutoForward": "openBrowser" "onAutoForward": "notify"
} }
}, },
"otherPortsAttributes": { "otherPortsAttributes": {
"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

@ -8,12 +8,13 @@
"portsAttributes": { "portsAttributes": {
"8006": { "8006": {
"label": "Web", "label": "Web",
"onAutoForward": "openBrowser" "onAutoForward": "notify"
} }
}, },
"otherPortsAttributes": { "otherPortsAttributes": {
"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

@ -8,12 +8,13 @@
"portsAttributes": { "portsAttributes": {
"8006": { "8006": {
"label": "Web", "label": "Web",
"onAutoForward": "openBrowser" "onAutoForward": "notify"
} }
}, },
"otherPortsAttributes": { "otherPortsAttributes": {
"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

@ -8,12 +8,13 @@
"portsAttributes": { "portsAttributes": {
"8006": { "8006": {
"label": "Web", "label": "Web",
"onAutoForward": "openBrowser" "onAutoForward": "notify"
} }
}, },
"otherPortsAttributes": { "otherPortsAttributes": {
"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

@ -8,12 +8,13 @@
"portsAttributes": { "portsAttributes": {
"8006": { "8006": {
"label": "Web", "label": "Web",
"onAutoForward": "openBrowser" "onAutoForward": "notify"
} }
}, },
"otherPortsAttributes": { "otherPortsAttributes": {
"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

@ -8,12 +8,13 @@
"portsAttributes": { "portsAttributes": {
"8006": { "8006": {
"label": "Web", "label": "Web",
"onAutoForward": "openBrowser" "onAutoForward": "notify"
} }
}, },
"otherPortsAttributes": { "otherPortsAttributes": {
"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

@ -8,12 +8,13 @@
"portsAttributes": { "portsAttributes": {
"8006": { "8006": {
"label": "Web", "label": "Web",
"onAutoForward": "openBrowser" "onAutoForward": "notify"
} }
}, },
"otherPortsAttributes": { "otherPortsAttributes": {
"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

@ -8,12 +8,13 @@
"portsAttributes": { "portsAttributes": {
"8006": { "8006": {
"label": "Web", "label": "Web",
"onAutoForward": "openBrowser" "onAutoForward": "notify"
} }
}, },
"otherPortsAttributes": { "otherPortsAttributes": {
"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

@ -8,12 +8,13 @@
"portsAttributes": { "portsAttributes": {
"8006": { "8006": {
"label": "Web", "label": "Web",
"onAutoForward": "openBrowser" "onAutoForward": "notify"
} }
}, },
"otherPortsAttributes": { "otherPortsAttributes": {
"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

@ -8,12 +8,13 @@
"portsAttributes": { "portsAttributes": {
"8006": { "8006": {
"label": "Web", "label": "Web",
"onAutoForward": "openBrowser" "onAutoForward": "notify"
} }
}, },
"otherPortsAttributes": { "otherPortsAttributes": {
"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

@ -8,12 +8,13 @@
"portsAttributes": { "portsAttributes": {
"8006": { "8006": {
"label": "Web", "label": "Web",
"onAutoForward": "openBrowser" "onAutoForward": "notify"
} }
}, },
"otherPortsAttributes": { "otherPortsAttributes": {
"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

@ -8,12 +8,13 @@
"portsAttributes": { "portsAttributes": {
"8006": { "8006": {
"label": "Web", "label": "Web",
"onAutoForward": "openBrowser" "onAutoForward": "notify"
} }
}, },
"otherPortsAttributes": { "otherPortsAttributes": {
"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

@ -1,9 +1,8 @@
services: services:
windows: windows:
image: dockurr/windows
container_name: windows container_name: windows
image: ghcr.io/dockur/windows
environment: environment:
ALLOCATE: "Y"
RAM_SIZE: "half" RAM_SIZE: "half"
DISK_SIZE: "max" DISK_SIZE: "max"
CPU_CORES: "max" CPU_CORES: "max"

View file

@ -8,12 +8,13 @@
"portsAttributes": { "portsAttributes": {
"8006": { "8006": {
"label": "Web", "label": "Web",
"onAutoForward": "openBrowser" "onAutoForward": "notify"
} }
}, },
"otherPortsAttributes": { "otherPortsAttributes": {
"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

@ -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.25 / / COPY --from=qemux/qemu:7.26 / /
ARG TARGETARCH ARG TARGETARCH
ARG DEBCONF_NOWARNINGS="yes" ARG DEBCONF_NOWARNINGS="yes"

View file

@ -1108,14 +1108,14 @@ getLink4() {
url="nano11_25h2/nano11%2025h2.iso" url="nano11_25h2/nano11%2025h2.iso"
;; ;;
"core11" ) "core11" )
size=2159738880 size=3176654848
sum="78f0f44444ff95b97125b43e560a72e0d6ce0a665cf9f5573bf268191e5510c1" sum="29c055fcfb7b089abd9e007e7abe4bb82c70a03aac9d65e56a38b87ab32d04d2"
url="tiny-11-core-x-64-beta-1/tiny11%20core%20x64%20beta%201.iso" url="tiny11_25H2/tiny11core_25H2_Oct25.iso"
;; ;;
"tiny11" ) "tiny11" )
size=3788177408 size=5514559488
sum="a028800a91addc35d8ae22dce7459b67330f7d69d2f11c70f53c0fdffa5b4280" sum="92484f2b7f707e42383294402a9eabbadeaa5ede80ac633390ae7f3537e36275"
url="tiny11-2311/tiny11%202311%20x64.iso" url="tiny11_25H2/tiny11_25H2_Oct25.iso"
;; ;;
"tiny10" ) "tiny10" )
size=3839819776 size=3839819776
@ -1123,9 +1123,9 @@ getLink4() {
url="tiny-10-23-h2/tiny10%20x64%2023h2.iso" url="tiny-10-23-h2/tiny10%20x64%2023h2.iso"
;; ;;
"win11x64" ) "win11x64" )
size=5819484160 size=7736125440
sum="b56b911bf18a2ceaeb3904d87e7c770bdf92d3099599d61ac2497b91bf190b11" sum="d141f6030fed50f75e2b03e1eb2e53646c4b21e5386047cb860af5223f102a32"
url="windows-11-24h2-x64/Windows%2011%2024H2%20x64.iso" url="W11x64_26200.6584/26200.6584.250915-1905.25h2_ge_release_svc_refresh_CLIENT_CONSUMER_x64FRE_en-us.iso"
;; ;;
"win11x64-enterprise" | "win11x64-enterprise-eval" ) "win11x64-enterprise" | "win11x64-enterprise-eval" )
size=6209064960 size=6209064960

View file

@ -339,10 +339,12 @@ extractESD() {
local dir="$2" local dir="$2"
local version="$3" local version="$3"
local desc="$4" local desc="$4"
local size size_gb space space_gb desc local size size_gb sizes space space_gb
local desc total total1 total2 total3 total4
local imageIndex links links1 links2 links3 links4
local msg="Extracting $desc bootdisk..." local msg="Extracting $desc bootdisk"
info "$msg" && html "$msg" info "$msg..." && html "$msg..."
if [ "$(stat -c%s "$iso")" -lt 100000000 ]; then if [ "$(stat -c%s "$iso")" -lt 100000000 ]; then
error "Invalid ESD file: Size is smaller than 100 MB" && return 1 error "Invalid ESD file: Size is smaller than 100 MB" && return 1
@ -351,7 +353,7 @@ extractESD() {
rm -rf "$dir" rm -rf "$dir"
mkdir -p "$dir" mkdir -p "$dir"
size=16106127360 size=9606127360
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")
@ -367,40 +369,68 @@ extractESD() {
error "Cannot read the image count in ESD file!" && return 1 error "Cannot read the image count in ESD file!" && return 1
fi fi
wimlib-imagex apply "$iso" 1 "$dir" --quiet 2>/dev/null || { sizes=$(wimlib-imagex info "$iso" | grep "Total Bytes:")
links=$(wimlib-imagex info "$iso" | grep "Hard Link Bytes:")
total1=$(awk "NR==1{ print; }" <<< "$sizes" | cut -d':' -f2 | sed 's/^ *//')
links1=$(awk "NR==1{ print; }" <<< "$links" | cut -d':' -f2 | sed 's/^ *//')
total=$(( total1 - links1 ))
total3=$(awk "NR==3{ print; }" <<< "$sizes" | cut -d':' -f2 | sed 's/^ *//')
links3=$(awk "NR==3{ print; }" <<< "$links" | cut -d':' -f2 | sed 's/^ *//')
total3=$(( total3 - links3 ))
total3=$(( total3 + 60000000 ))
/run/progress.sh "$dir" "$total" "$msg ([P])..." &
imageIndex="1"
wimlib-imagex apply "$iso" "$imageIndex" "$dir" --quiet 2>/dev/null || {
retVal=$? retVal=$?
error "Extracting $desc bootdisk failed" && return $retVal fKill "progress.sh"
error "Extracting $desc bootdisk failed ($retVal)" && return 1
} }
fKill "progress.sh"
local bootWimFile="$dir/sources/boot.wim" local bootWimFile="$dir/sources/boot.wim"
local installWimFile="$dir/sources/install.wim" local installWimFile="$dir/sources/install.wim"
local msg="Extracting $desc environment..." local msg="Extracting $desc environment"
info "$msg" && html "$msg" info "$msg..." && html "$msg..."
wimlib-imagex export "$iso" 2 "$bootWimFile" --compress=none --quiet || { imageIndex="2"
/run/progress.sh "$bootWimFile" "$total3" "$msg ([P])..." &
wimlib-imagex export "$iso" "$imageIndex" "$bootWimFile" --compress=none --quiet || {
retVal=$? retVal=$?
error "Adding WinPE failed" && return ${retVal} fKill "progress.sh"
error "Adding WinPE failed ($retVal)" && return 1
} }
local msg="Extracting $desc setup..." local msg="Extracting $desc setup"
info "$msg" && html "$msg" info "$msg..."
wimlib-imagex export "$iso" 3 "$bootWimFile" --compress=none --boot --quiet || { imageIndex="3"
/run/progress.sh "$bootWimFile" "$total3" "$msg ([P])..." &
wimlib-imagex export "$iso" "$imageIndex" "$bootWimFile" --compress=none --boot --quiet || {
retVal=$? retVal=$?
error "Adding Windows Setup failed" && return ${retVal} fKill "progress.sh"
error "Adding Windows Setup failed ($retVal)" && return 1
} }
fKill "progress.sh"
if [[ "${PLATFORM,,}" == "x64" ]]; then if [[ "${PLATFORM,,}" == "x64" ]]; then
LABEL="CCCOMA_X64FRE_EN-US_DV9" LABEL="CCCOMA_X64FRE_EN-US_DV9"
else else
LABEL="CPBA_A64FRE_EN-US_DV9" LABEL="CPBA_A64FRE_EN-US_DV9"
fi fi
local msg="Extracting $desc image..." local msg="Extracting $desc image"
info "$msg" && html "$msg" info "$msg..." && html "$msg..."
local edition imageIndex imageEdition local edition imageEdition
edition=$(getCatalog "$version" "name") edition=$(getCatalog "$version" "name")
if [ -z "$edition" ]; then if [ -z "$edition" ]; then
@ -408,15 +438,27 @@ extractESD() {
fi fi
for (( imageIndex=4; imageIndex<=esdImageCount; imageIndex++ )); do for (( imageIndex=4; imageIndex<=esdImageCount; imageIndex++ )); do
imageEdition=$(wimlib-imagex info "$iso" ${imageIndex} | grep '^Description:' | sed 's/Description:[ \t]*//')
imageEdition=$(wimlib-imagex info "$iso" "$imageIndex" | grep '^Description:' | sed 's/Description:[ \t]*//')
[[ "${imageEdition,,}" != "${edition,,}" ]] && continue [[ "${imageEdition,,}" != "${edition,,}" ]] && continue
wimlib-imagex export "$iso" ${imageIndex} "$installWimFile" --compress=LZMS --chunk-size 128K --quiet || {
total4=$(du -sb "$iso" | cut -f1)
total4=$(( total4 + 3000000 ))
/run/progress.sh "$installWimFile" "$total4" "$msg ([P])..." &
wimlib-imagex export "$iso" "$imageIndex" "$installWimFile" --compress=LZMS --chunk-size 128K --quiet || {
retVal=$? retVal=$?
error "Addition of $imageIndex to the $desc image failed" && return $retVal fKill "progress.sh"
error "Addition of $imageIndex to the $desc image failed ($retVal)" && return 1
} }
fKill "progress.sh"
return 0 return 0
done done
fKill "progress.sh"
error "Failed to find product '$edition' in install.wim!" && return 1 error "Failed to find product '$edition' in install.wim!" && return 1
} }
@ -440,8 +482,8 @@ extractImage() {
return 1 return 1
fi fi
local msg="Extracting $desc image..." local msg="Extracting $desc image"
info "$msg" && html "$msg" info "$msg..." && html "$msg..."
rm -rf "$dir" rm -rf "$dir"
mkdir -p "$dir" mkdir -p "$dir"
@ -460,11 +502,15 @@ extractImage() {
fi fi
rm -rf "$dir" rm -rf "$dir"
/run/progress.sh "$dir" "$size" "$msg ([P])..." &
if ! 7z x "$iso" -o"$dir" > /dev/null; then if ! 7z x "$iso" -o"$dir" > /dev/null; then
fKill "progress.sh"
error "Failed to extract ISO file: $iso" && return 1 error "Failed to extract ISO file: $iso" && return 1
fi fi
fKill "progress.sh"
if [[ "${UNPACK:-}" != [Yy1]* ]]; then if [[ "${UNPACK:-}" != [Yy1]* ]]; then
LABEL=$(isoinfo -d -i "$iso" | sed -n 's/Volume id: //p') LABEL=$(isoinfo -d -i "$iso" | sed -n 's/Volume id: //p')
@ -1077,8 +1123,8 @@ buildImage() {
desc=$(printVersion "$DETECTED" "ISO") desc=$(printVersion "$DETECTED" "ISO")
local msg="Building $desc image..." local msg="Building $desc image"
info "$msg" && html "$msg" info "$msg..." && html "$msg..."
[ -z "$LABEL" ] && LABEL="Windows" [ -z "$LABEL" ] && LABEL="Windows"
@ -1095,6 +1141,8 @@ buildImage() {
error "Not enough free space in $STORAGE, have $space_gb available but need at least $size_gb." && return 1 error "Not enough free space in $STORAGE, have $space_gb available but need at least $size_gb." && return 1
fi fi
/run/progress.sh "$out" "$size" "$msg ([P])..." &
if [[ "${BOOT_MODE,,}" != "windows_legacy" ]]; then if [[ "${BOOT_MODE,,}" != "windows_legacy" ]]; then
genisoimage -o "$out" -b "$ETFS" -no-emul-boot -c "$cat" -iso-level 4 -J -l -D -N -joliet-long -relaxed-filenames -V "${LABEL::30}" \ genisoimage -o "$out" -b "$ETFS" -no-emul-boot -c "$cat" -iso-level 4 -J -l -D -N -joliet-long -relaxed-filenames -V "${LABEL::30}" \
@ -1115,6 +1163,8 @@ buildImage() {
fi fi
fKill "progress.sh"
if [ -n "$failed" ]; then if [ -n "$failed" ]; then
[ -s "$log" ] && echo "$(<"$log")" [ -s "$log" ] && echo "$(<"$log")"
error "Failed to build image!" && return 1 error "Failed to build image!" && return 1

View file

@ -74,6 +74,7 @@ ready() {
finish() { finish() {
local pid local pid
local cnt=0
local reason=$1 local reason=$1
touch "$QEMU_END" touch "$QEMU_END"
@ -81,14 +82,24 @@ finish() {
if [ -s "$QEMU_PID" ]; then if [ -s "$QEMU_PID" ]; then
pid=$(<"$QEMU_PID") pid=$(<"$QEMU_PID")
error "Forcefully terminating Windows, reason: $reason..." echo && error "Forcefully terminating Windows, reason: $reason..."
{ kill -15 "$pid" || true; } 2>/dev/null { kill -15 "$pid" || true; } 2>/dev/null
while isAlive "$pid"; do while isAlive "$pid"; do
sleep 1 sleep 1
cnt=$((cnt+1))
# Workaround for zombie pid # Workaround for zombie pid
[ ! -s "$QEMU_PID" ] && break [ ! -s "$QEMU_PID" ] && break
if [ "$cnt" == "5" ]; then
echo && error "QEMU did not terminate itself, forcefully killing process..."
{ kill -9 "$pid" || true; } 2>/dev/null
fi
done done
fi fi
if [ ! -f "$STORAGE/windows.boot" ] && [ -f "$BOOT" ]; then if [ ! -f "$STORAGE/windows.boot" ] && [ -f "$BOOT" ]; then