feat: Add support for USB booting (#83)

This commit is contained in:
Kroese 2024-05-21 12:00:45 +02:00 committed by GitHub
parent 5eb3645401
commit 38830c6f7a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 7 deletions

View file

@ -391,18 +391,24 @@ addMedia () {
local index=""
local DISK_ID="cdrom$DISK_BUS"
[ -n "$DISK_INDEX" ] && index=",bootindex=$DISK_INDEX"
local result="-drive file=$DISK_FILE,id=$DISK_ID,if=none,format=raw,media=cdrom,readonly=on"
local result="-drive file=$DISK_FILE,id=$DISK_ID,if=none,format=raw,readonly=on,media=cdrom"
case "${DISK_TYPE,,}" in
"usb" )
result="$result \
-device usb-storage,drive=${DISK_ID}${index}"
-device usb-storage,drive=${DISK_ID}${index},removable=on"
echo "$result"
;;
"ide" | "blk" | "virtio-blk" )
"ide" )
result="$result \
-device ide-cd,drive=${DISK_ID},bus=ide.${DISK_BUS}${index}"
echo "$result"
;;
"blk" | "virtio-blk" )
result="$result \
-device virtio-blk-pci,drive=${DISK_ID},scsi=off,bus=pcie.0,addr=$DISK_ADDRESS,iothread=io2${index}"
echo "$result"
;;
"scsi" | "virtio-scsi" )
result="$result \
-device virtio-scsi-pci,id=${DISK_ID}b,bus=pcie.0,addr=$DISK_ADDRESS,iothread=io2 \

View file

@ -326,7 +326,7 @@ fi
if [[ "$DHCP" == [Yy1]* ]]; then
! checkOS && exit 19
! checkOS && [[ "$DEBUG" != [Yy1]* ]] && exit 19
if [[ "$GATEWAY" == "172."* ]]; then
warn "your gateway IP starts with 172.* which is often a sign that you are not on a macvlan network (required for DHCP)!"
@ -337,8 +337,8 @@ if [[ "$DHCP" == [Yy1]* ]]; then
else
if [[ "$GATEWAY" != "172."* ]] && [[ "$GATEWAY" != "10."* ]]; then
! checkOS && exit 19
if [[ "$GATEWAY" != "172."* ]] && [[ "$GATEWAY" != "10.8"* ]] && [[ "$GATEWAY" != "10.9"* ]]; then
! checkOS && [[ "$DEBUG" != [Yy1]* ]] && exit 19
fi
# Configuration for static IP

View file

@ -10,7 +10,7 @@ set -Eeuo pipefail
if [[ "${ARCH,,}" != "arm64" ]]; then
KVM="N"
warn "your CPU architecture is ${ARCH} and cannot provide KVM acceleration for ARM64 instructions, this will cause a major loss of performance."
warn "your CPU architecture is ${ARCH^^} and cannot provide KVM acceleration for ARM64 instructions, this will cause a major loss of performance."
fi
if [[ "$KVM" != [Nn]* ]]; then