feat: Use IDE for old machines (#418)
This commit is contained in:
parent
019169ed0e
commit
cd953c3650
2 changed files with 12 additions and 7 deletions
|
@ -16,7 +16,7 @@ DEV_OPTS="-device virtio-balloon-pci,id=balloon0,bus=pcie.0,addr=0x4"
|
||||||
DEV_OPTS="$DEV_OPTS -object rng-random,id=objrng0,filename=/dev/urandom"
|
DEV_OPTS="$DEV_OPTS -object rng-random,id=objrng0,filename=/dev/urandom"
|
||||||
DEV_OPTS="$DEV_OPTS -device virtio-rng-pci,rng=objrng0,id=rng0,bus=pcie.0,addr=0x1c"
|
DEV_OPTS="$DEV_OPTS -device virtio-rng-pci,rng=objrng0,id=rng0,bus=pcie.0,addr=0x1c"
|
||||||
|
|
||||||
ARGS="$DEF_OPTS $CPU_OPTS $RAM_OPTS $MAC_OPTS $DISPLAY_OPTS $MON_OPTS $SERIAL_OPTS $NET_OPTS $DISK_OPTS $BOOT_OPTS $DEV_OPTS $USB_OPTS $ARGUMENTS"
|
ARGS="$DEF_OPTS $CPU_OPTS $RAM_OPTS $MAC_OPTS $DISPLAY_OPTS $MON_OPTS $SERIAL_OPTS $USB_OPTS $NET_OPTS $DISK_OPTS $BOOT_OPTS $DEV_OPTS $ARGUMENTS"
|
||||||
ARGS=$(echo "$ARGS" | sed 's/\t/ /g' | tr -s ' ')
|
ARGS=$(echo "$ARGS" | sed 's/\t/ /g' | tr -s ' ')
|
||||||
|
|
||||||
if [[ "${DISPLAY,,}" == "web" ]]; then
|
if [[ "${DISPLAY,,}" == "web" ]]; then
|
||||||
|
|
17
src/disk.sh
17
src/disk.sh
|
@ -10,19 +10,24 @@ 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
|
||||||
|
|
||||||
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"
|
|
||||||
|
|
||||||
BOOT="$STORAGE/$BASE"
|
BOOT="$STORAGE/$BASE"
|
||||||
[ ! -f "$BOOT" ] && BOOT="/dev/null"
|
[ ! -f "$BOOT" ] && BOOT="/dev/null"
|
||||||
DISK_OPTS="$DISK_OPTS -drive id=cdrom0,if=none,format=raw,readonly=on,file=$BOOT"
|
|
||||||
|
DISK_OPTS="-object iothread,id=io2"
|
||||||
|
DISK_OPTS="$DISK_OPTS -drive id=cdrom0,media=cdrom,if=none,format=raw,readonly=on,file=$BOOT"
|
||||||
|
|
||||||
|
if [[ "${MACHINE,,}" != "pc-q35-2"* ]]; then
|
||||||
|
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"
|
||||||
|
else
|
||||||
|
DISK_OPTS="$DISK_OPTS -device ide-cd,drive=cdrom0,bootindex=$BOOT_INDEX"
|
||||||
|
fi
|
||||||
|
|
||||||
DRIVERS="$STORAGE/drivers.iso"
|
DRIVERS="$STORAGE/drivers.iso"
|
||||||
[ ! -f "$DRIVERS" ] && DRIVERS="/run/drivers.iso"
|
[ ! -f "$DRIVERS" ] && DRIVERS="/run/drivers.iso"
|
||||||
|
|
||||||
if [ -f "$DRIVERS" ]; then
|
if [ -f "$DRIVERS" ]; then
|
||||||
DISK_OPTS="$DISK_OPTS -drive id=cdrom1,if=none,format=raw,readonly=on,file=$DRIVERS"
|
DISK_OPTS="$DISK_OPTS -drive id=cdrom1,media=cdrom,if=none,format=raw,readonly=on,file=$DRIVERS"
|
||||||
if [[ "${MACHINE,,}" != "pc-q35-2"* ]]; then
|
if [[ "${MACHINE,,}" != "pc-q35-2"* ]]; then
|
||||||
DISK_OPTS="$DISK_OPTS -device ide-cd,drive=cdrom1"
|
DISK_OPTS="$DISK_OPTS -device ide-cd,drive=cdrom1"
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue