fix: Do not ignore unrecognized bootmodes (#96)
This commit is contained in:
parent
7234632a74
commit
9eb0b703f1
3 changed files with 12 additions and 16 deletions
|
@ -130,7 +130,7 @@ kubectl apply -f kubernetes.yml
|
||||||
|
|
||||||
* ### How do I change the amount of CPU or RAM?
|
* ### How do I change the amount of CPU or RAM?
|
||||||
|
|
||||||
By default, the container is allowed to use a maximum of 1 CPU core and 1 GB of RAM.
|
By default, the container will be allowed to use a maximum of 1 CPU core and 1 GB of RAM.
|
||||||
|
|
||||||
If you want to adjust this, you can specify the desired amount using the following environment variables:
|
If you want to adjust this, you can specify the desired amount using the following environment variables:
|
||||||
|
|
||||||
|
|
|
@ -33,10 +33,8 @@ case "${BOOT_MODE,,}" in
|
||||||
BOOT_OPTS="-rtc base=localtime"
|
BOOT_OPTS="-rtc base=localtime"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
info "Unknown boot mode '${BOOT_MODE}', defaulting to 'uefi'"
|
error "Unknown BOOT_MODE, value \"${BOOT_MODE}\" is not recognized!"
|
||||||
BOOT_MODE="uefi"
|
exit 33
|
||||||
ROM="AAVMF_CODE.no-secboot.fd"
|
|
||||||
VARS="AAVMF_VARS.fd"
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
20
src/disk.sh
20
src/disk.sh
|
@ -514,25 +514,22 @@ case "${DISK_TYPE,,}" in
|
||||||
* ) error "Invalid DISK_TYPE, value \"$DISK_TYPE\" is unrecognized!" && exit 80 ;;
|
* ) error "Invalid DISK_TYPE, value \"$DISK_TYPE\" is unrecognized!" && exit 80 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
DRIVER_TYPE="ide"
|
|
||||||
MEDIA_TYPE="$DISK_TYPE"
|
|
||||||
|
|
||||||
case "${MACHINE,,}" in
|
|
||||||
"virt" )
|
|
||||||
DRIVER_TYPE="usb" ;;
|
|
||||||
"pc-q35-2"* )
|
|
||||||
DISK_TYPE="blk"
|
|
||||||
MEDIA_TYPE="ide" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -f "$BOOT" ] && [ -s "$BOOT" ]; then
|
if [ -f "$BOOT" ] && [ -s "$BOOT" ]; then
|
||||||
|
MEDIA_TYPE="$DISK_TYPE"
|
||||||
|
if [ -z "${BOOT_MODE:-}" ] || [[ "${BOOT_MODE:-}" == *"legacy" ]]; then
|
||||||
|
if [[ "${MACHINE,,}" != "virt" ]] && [[ "${MEDIA_TYPE,,}" == "blk" ]]; then
|
||||||
|
MEDIA_TYPE="ide"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
DISK_OPTS=$(addMedia "$BOOT" "$MEDIA_TYPE" "0" "$BOOT_INDEX" "0x5")
|
DISK_OPTS=$(addMedia "$BOOT" "$MEDIA_TYPE" "0" "$BOOT_INDEX" "0x5")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
DRIVER_TYPE="ide"
|
||||||
DRIVERS="/drivers.iso"
|
DRIVERS="/drivers.iso"
|
||||||
[ ! -f "$DRIVERS" ] || [ ! -s "$DRIVERS" ] && DRIVERS="$STORAGE/drivers.iso"
|
[ ! -f "$DRIVERS" ] || [ ! -s "$DRIVERS" ] && DRIVERS="$STORAGE/drivers.iso"
|
||||||
|
|
||||||
if [ -f "$DRIVERS" ] && [ -s "$DRIVERS" ]; then
|
if [ -f "$DRIVERS" ] && [ -s "$DRIVERS" ]; then
|
||||||
|
[[ "${MACHINE,,}" == "virt" ]] && DRIVER_TYPE="usb"
|
||||||
DRIVER_OPTS=$(addMedia "$DRIVERS" "$DRIVER_TYPE" "1" "" "0x6")
|
DRIVER_OPTS=$(addMedia "$DRIVERS" "$DRIVER_TYPE" "1" "" "0x6")
|
||||||
DISK_OPTS="$DISK_OPTS $DRIVER_OPTS"
|
DISK_OPTS="$DISK_OPTS $DRIVER_OPTS"
|
||||||
fi
|
fi
|
||||||
|
@ -609,4 +606,5 @@ fi
|
||||||
DISK_OPTS="$DISK_OPTS -object iothread,id=io2"
|
DISK_OPTS="$DISK_OPTS -object iothread,id=io2"
|
||||||
|
|
||||||
html "Initialized disks successfully..."
|
html "Initialized disks successfully..."
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
Loading…
Reference in a new issue