mirror of
https://github.com/dockur/windows.git
synced 2025-10-29 04:05:50 +00:00
Update install.sh
This commit is contained in:
parent
beaeddac0b
commit
a0a812d188
1 changed files with 16 additions and 11 deletions
|
|
@ -515,7 +515,12 @@ detectImage() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
info "Detecting version from ISO image..."
|
info "Detecting version from ISO image..."
|
||||||
detectLegacy "$dir" && return 0
|
|
||||||
|
if detectLegacy "$dir"; then
|
||||||
|
desc=$(printEdition "$DETECTED" "$DETECTED")
|
||||||
|
info "Detected: $desc"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
local src wim info
|
local src wim info
|
||||||
src=$(find "$dir" -maxdepth 1 -type d -iname sources | head -n 1)
|
src=$(find "$dir" -maxdepth 1 -type d -iname sources | head -n 1)
|
||||||
|
|
@ -597,12 +602,12 @@ prepareImage() {
|
||||||
case "${DETECTED,,}" in
|
case "${DETECTED,,}" in
|
||||||
"win9"* )
|
"win9"* )
|
||||||
DISK_TYPE="auto"
|
DISK_TYPE="auto"
|
||||||
prepare9x "$iso" "$dir" "$desc" && return 0
|
ETFS="[BOOT]/Boot-1.44M.img"
|
||||||
error "Failed to prepare $desc ISO!" && return 1 ;;
|
return 0
|
||||||
"win2k"* )
|
"win2k"* )
|
||||||
DISK_TYPE="auto"
|
DISK_TYPE="auto"
|
||||||
prepare2k "$iso" "$dir" "$desc" && return 0
|
ETFS="[BOOT]/Boot-NoEmul.img"
|
||||||
error "Failed to prepare $desc ISO!" && return 1 ;;
|
return 0
|
||||||
"winxp"* )
|
"winxp"* )
|
||||||
DISK_TYPE="blk"
|
DISK_TYPE="blk"
|
||||||
prepareXP "$iso" "$dir" "$desc" && return 0
|
prepareXP "$iso" "$dir" "$desc" && return 0
|
||||||
|
|
@ -927,10 +932,6 @@ buildImage() {
|
||||||
error "File $BOOT does already exist?!" && return 1
|
error "File $BOOT does already exist?!" && return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "$dir/$ETFS" ]; then
|
|
||||||
error "Failed to locate file \"$ETFS\" in ISO image!" && return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
base=$(basename "$BOOT")
|
base=$(basename "$BOOT")
|
||||||
local out="$TMP/${base%.*}.tmp"
|
local out="$TMP/${base%.*}.tmp"
|
||||||
rm -f "$out"
|
rm -f "$out"
|
||||||
|
|
@ -940,6 +941,12 @@ buildImage() {
|
||||||
local msg="Building $desc image..."
|
local msg="Building $desc image..."
|
||||||
info "$msg" && html "$msg"
|
info "$msg" && html "$msg"
|
||||||
|
|
||||||
|
[ -z "$LABEL" ] && LABEL="Windows"
|
||||||
|
|
||||||
|
if [ ! -f "$dir/$ETFS" ]; then
|
||||||
|
error "Failed to locate file \"$ETFS\" in ISO image!" && return 1
|
||||||
|
fi
|
||||||
|
|
||||||
size=$(du -h -b --max-depth=0 "$dir" | cut -f1)
|
size=$(du -h -b --max-depth=0 "$dir" | cut -f1)
|
||||||
size_gb=$(( (size + 1073741823)/1073741824 ))
|
size_gb=$(( (size + 1073741823)/1073741824 ))
|
||||||
space=$(df --output=avail -B 1 "$TMP" | tail -n 1)
|
space=$(df --output=avail -B 1 "$TMP" | tail -n 1)
|
||||||
|
|
@ -949,8 +956,6 @@ buildImage() {
|
||||||
error "Not enough free space in $STORAGE, have $space_gb GB available but need at least $size_gb GB." && return 1
|
error "Not enough free space in $STORAGE, have $space_gb GB available but need at least $size_gb GB." && return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -z "$LABEL" ] && LABEL="Windows"
|
|
||||||
|
|
||||||
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}" \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue