fix: Always create cdrom drive (#387)
This commit is contained in:
parent
c6dc58effc
commit
c568b5cfe4
1 changed files with 8 additions and 6 deletions
14
src/disk.sh
14
src/disk.sh
|
@ -10,14 +10,16 @@ set -Eeuo pipefail
|
||||||
: "${DISK_DISCARD:="on"}" # Controls whether unmap (TRIM) commands are passed to the host.
|
: "${DISK_DISCARD:="on"}" # Controls whether unmap (TRIM) commands are passed to the host.
|
||||||
: "${DISK_ROTATION:="1"}" # Rotation rate, set to 1 for SSD storage and increase for HDD
|
: "${DISK_ROTATION:="1"}" # Rotation rate, set to 1 for SSD storage and increase for HDD
|
||||||
|
|
||||||
BOOT="$STORAGE/$BASE"
|
|
||||||
DISK_OPTS="-object iothread,id=io2"
|
DISK_OPTS="-object iothread,id=io2"
|
||||||
|
DISK_OPTS="$DISK_OPTS -device virtio-scsi-pci,id=scsi0,iothread=io2,addr=0x5"
|
||||||
|
DISK_OPTS="$DISK_OPTS -device scsi-cd,bus=scsi0.0,drive=cdrom0,bootindex=$BOOT_INDEX"
|
||||||
|
|
||||||
if [ -f "$BOOT" ]; then
|
BOOT="$STORAGE/$BASE"
|
||||||
DISK_OPTS="$DISK_OPTS \
|
|
||||||
-device virtio-scsi-pci,id=scsi0,iothread=io2,addr=0x5 \
|
if [ ! -f "$BOOT" ]; then
|
||||||
-drive id=cdrom0,if=none,format=raw,readonly=on,file=$BOOT \
|
DISK_OPTS="$DISK_OPTS -drive id=cdrom0,if=none,format=raw,readonly=on"
|
||||||
-device scsi-cd,bus=scsi0.0,drive=cdrom0,bootindex=$BOOT_INDEX"
|
else
|
||||||
|
DISK_OPTS="$DISK_OPTS -drive id=cdrom0,if=none,format=raw,readonly=on,file=$BOOT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DRIVERS="$STORAGE/drivers.iso"
|
DRIVERS="$STORAGE/drivers.iso"
|
||||||
|
|
Loading…
Reference in a new issue