Unverified Commit d4a56a28 authored by Kroese's avatar Kroese Committed by GitHub
Browse files

feat: Passthrough BIOS serial (#725)

parent 06d8cfcb
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -16,7 +16,12 @@ CPU_OPTS="-cpu $CPU_FLAGS -smp $SMP"
RAM_OPTS=$(echo "-m ${RAM_SIZE^^}" | sed 's/MB/M/g;s/GB/G/g;s/TB/T/g')
MON_OPTS="-monitor $MONITOR -name $PROCESS,process=$PROCESS,debug-threads=on"
MAC_OPTS="-machine type=${MACHINE},smm=${SECURE},graphics=off,vmport=${VMPORT},dump-guest-core=off,hpet=${HPET}${KVM_OPTS}"
[ -n "$UUID" ] && MAC_OPTS="$MAC_OPTS -uuid $UUID"
[ -n "$UUID" ] && MAC_OPTS+=" -uuid $UUID"

if [ -s "/sys/class/dmi/id/product_serial" ]; then
  BIOS_SERIAL=$(</sys/class/dmi/id/product_serial)
  MAC_OPTS+=" -smbios type=1,serial=$BIOS_SERIAL"
fi

if [[ "${MACHINE,,}" != "pc-i440fx-2"* ]]; then
  DEV_OPTS="-object rng-random,id=objrng0,filename=/dev/urandom"
+1 −1
Original line number Diff line number Diff line
@@ -202,7 +202,7 @@ findFile() {
  local fname="boot.$ext"

  if [ -d "/$fname" ]; then
    warn "The file /$fname has an invalid path!" && exit 37
    error "The file /$fname does not exist, please check that you mapped it to a valid path!" && exit 37
  fi

  file=$(find / -maxdepth 1 -type f -iname "$fname" | head -n 1)