mirror of
https://github.com/dockur/windows.git
synced 2025-10-27 19:35:49 +00:00
Update install.sh
This commit is contained in:
parent
55f197db00
commit
367f70bd28
1 changed files with 16 additions and 1 deletions
|
|
@ -525,18 +525,25 @@ extractESD() {
|
|||
|
||||
local iso="$1"
|
||||
local dir="$2"
|
||||
local size desc
|
||||
local size size_gb space space_gb desc
|
||||
|
||||
desc=$(printVersion "$VERSION")
|
||||
local msg="Extracting $desc bootdisk..."
|
||||
info "$msg" && html "$msg"
|
||||
|
||||
size=$(stat -c%s "$iso")
|
||||
size_gb=$(( (size + 1073741823)/1073741824 ))
|
||||
space=$(df --output=avail -B 1 "$TMP" | tail -n 1)
|
||||
space_gb=$(( (space + 1073741823)/1073741824 ))
|
||||
|
||||
if ((size<10000000)); then
|
||||
error "Invalid ESD file: Size is smaller than 10 MB" && exit 62
|
||||
fi
|
||||
|
||||
if (( size > space )); then
|
||||
error "Not enough free space in $STORAGE, have $space_gb GB available but need at least $size_gb GB." && exit 63
|
||||
fi
|
||||
|
||||
rm -rf "$dir"
|
||||
mkdir -p "$dir"
|
||||
|
||||
|
|
@ -606,6 +613,14 @@ extractImage() {
|
|||
local desc="downloaded ISO"
|
||||
local size size_gb space space_gb
|
||||
|
||||
if [[ "${iso,,}" == *".esd" ]]; then
|
||||
if ! extractESD "$iso" "$dir"; then
|
||||
error "Failed to extract ESD file!"
|
||||
exit 67
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ "$EXTERNAL" != [Yy1]* ]] && [ -z "$CUSTOM" ]; then
|
||||
desc=$(printVersion "$VERSION")
|
||||
[ -z "$desc" ] && desc="downloaded ISO"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue