Update install.sh
This commit is contained in:
parent
b6025f1adf
commit
572b98bc8f
1 changed files with 47 additions and 3 deletions
|
@ -128,6 +128,8 @@ finishInstall() {
|
|||
|
||||
rm -f "$STORAGE/windows.old"
|
||||
rm -f "$STORAGE/windows.vga"
|
||||
rm -f "$STORAGE/windows.net"
|
||||
rm -f "$STORAGE/windows.usb"
|
||||
rm -f "$STORAGE/windows.args"
|
||||
rm -f "$STORAGE/windows.base"
|
||||
rm -f "$STORAGE/windows.boot"
|
||||
|
@ -170,10 +172,18 @@ finishInstall() {
|
|||
echo "$ARGS" > "$STORAGE/windows.args"
|
||||
fi
|
||||
|
||||
if [ -n "${USB:-}" ] && [[ "${USB:-}" != "qemu-xhci"* ]]; then
|
||||
echo "$USB" > "$STORAGE/windows.usb"
|
||||
fi
|
||||
|
||||
if [ -n "${DISK_TYPE:-}" ] && [[ "${DISK_TYPE:-}" != "scsi" ]]; then
|
||||
echo "$DISK_TYPE" > "$STORAGE/windows.type"
|
||||
fi
|
||||
|
||||
if [ -n "${ADAPTER:-}" ] && [[ "${ADAPTER:-}" != "virtio-net-pci" ]]; then
|
||||
echo "$ADAPTER" > "$STORAGE/windows.net"
|
||||
fi
|
||||
|
||||
rm -rf "$TMP"
|
||||
return 0
|
||||
}
|
||||
|
@ -185,6 +195,7 @@ abortInstall() {
|
|||
local efi
|
||||
|
||||
[[ "${iso,,}" == *".esd" ]] && exit 60
|
||||
[[ "${UNPACK:-}" == [Yy1]* ]] && exit 60
|
||||
|
||||
efi=$(find "$dir" -maxdepth 1 -type d -iname efi | head -n 1)
|
||||
|
||||
|
@ -336,7 +347,7 @@ extractImage() {
|
|||
local dir="$2"
|
||||
local version="$3"
|
||||
local desc="local ISO"
|
||||
local size size_gb space space_gb
|
||||
local file size size_gb space space_gb
|
||||
|
||||
if [ -z "$CUSTOM" ]; then
|
||||
desc="downloaded ISO"
|
||||
|
@ -375,7 +386,26 @@ extractImage() {
|
|||
error "Failed to extract ISO file: $iso" && return 1
|
||||
fi
|
||||
|
||||
LABEL=$(isoinfo -d -i "$iso" | sed -n 's/Volume id: //p')
|
||||
if [[ "${UNPACK:-}" != [Yy1]* ]]; then
|
||||
|
||||
LABEL=$(isoinfo -d -i "$iso" | sed -n 's/Volume id: //p')
|
||||
|
||||
else
|
||||
|
||||
file=$(find "$dir" -maxdepth 1 -type f -iname "*.iso" | head -n 1)
|
||||
|
||||
if [ -z "$file" ]; then
|
||||
error "Failed to find any .iso file in archive!" && return 1
|
||||
fi
|
||||
|
||||
if ! 7z x "$file" -o"$dir" > /dev/null; then
|
||||
error "Failed to extract archive!" && return 1
|
||||
fi
|
||||
|
||||
LABEL=$(isoinfo -d -i "$file" | sed -n 's/Volume id: //p')
|
||||
rm -f "$file"
|
||||
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
@ -1034,6 +1064,20 @@ bootWindows() {
|
|||
ARGUMENTS="$ARGS ${ARGUMENTS:-}"
|
||||
fi
|
||||
|
||||
if [ -s "$STORAGE/windows.usb" ] && [ -f "$STORAGE/windows.usb" ]; then
|
||||
if [ -z "${USB:-}" ]; then
|
||||
USB=$(<"$STORAGE/windows.usb")
|
||||
USB="${USB//[![:print:]]/}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -s "$STORAGE/windows.net" ] && [ -f "$STORAGE/windows.net" ]; then
|
||||
if [ -z "${ADAPTER:-}" ]; then
|
||||
ADAPTER=$(<"$STORAGE/windows.net")
|
||||
ADAPTER="${ADAPTER//[![:print:]]/}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -s "$STORAGE/windows.type" ] && [ -f "$STORAGE/windows.type" ]; then
|
||||
if [ -z "${DISK_TYPE:-}" ]; then
|
||||
DISK_TYPE=$(<"$STORAGE/windows.type")
|
||||
|
|
Loading…
Reference in a new issue