Skip to content

Commit 2d065f0

Browse files
authored
feat: Support boot.iso files (#1204)
1 parent 46a9295 commit 2d065f0

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/mas
226226

227227
```yaml
228228
volumes:
229-
- ./example.iso:/custom.iso
229+
- ./example.iso:/boot.iso
230230
```
231231

232232
Replace the example path `./example.iso` with the filename of your desired ISO file. The value of `VERSION` will be ignored in this case.

src/install.sh

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,12 @@ abortInstall() {
222222
return 1
223223
}
224224

225-
detectCustom() {
225+
findFile() {
226226

227227
local dir file base
228-
local fname="custom.iso"
228+
local fname="$1"
229229
local boot="$STORAGE/windows.boot"
230230

231-
CUSTOM=""
232-
233231
dir=$(find / -maxdepth 1 -type d -iname "$fname" -print -quit)
234232
[ ! -d "$dir" ] && dir=$(find "$STORAGE" -maxdepth 1 -type d -iname "$fname" -print -quit)
235233

@@ -256,12 +254,25 @@ detectCustom() {
256254
[ -z "$size" ] || [[ "$size" == "0" ]] && return 0
257255

258256
ISO="$file"
259-
CUSTOM="$ISO"
257+
CUSTOM="$file"
260258
BOOT="$STORAGE/windows.$size.iso"
261259

262260
return 0
263261
}
264262

263+
detectCustom() {
264+
265+
CUSTOM=""
266+
267+
! findFile "custom.iso" && return 1
268+
[ -n "$CUSTOM" ] && return 0
269+
270+
! findFile "boot.iso" && return 1
271+
[ -n "$CUSTOM" ] && return 0
272+
273+
return 0
274+
}
275+
265276
extractESD() {
266277

267278
local iso="$1"

0 commit comments

Comments
 (0)