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

fix: Display signal names (#1760)

parent 0c9472b6
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -33,10 +33,6 @@ cmd=(qemu-system-x86_64)
version=$("${cmd[@]}" --version | awk 'NR==1 { print $4 }')
info "Booting ${APP}${BOOT_DESC} using QEMU v$version..."

if [[ "$SHUTDOWN" != [Yy1]* ]]; then
  exec "${cmd[@]}" ${ARGS:+ $ARGS}
fi

pipe="$QEMU_DIR/qemu.pipe"
rm -f "$pipe" && mkfifo "$pipe"

@@ -50,6 +46,10 @@ sed -u \
  -e 's/failed to load Boot/skipped Boot/g' \
  -e 's/0): Not Found/0)/g' &

if [[ "$SHUTDOWN" != [Yy1]* ]]; then
  exec "${cmd[@]}" ${ARGS:+ $ARGS} >"$pipe"
fi

"${cmd[@]}" ${ARGS:+ $ARGS} >"$pipe" &

pid=$!
+2 −2
Original line number Diff line number Diff line
@@ -135,13 +135,13 @@ graceful_shutdown() {
  esac

  if [ -f "$QEMU_END" ]; then
    echo && info "Received $1 while already shutting down..."
    echo && info "Received $1 signal while already shutting down..."
    return
  fi

  set +e
  touch "$QEMU_END"
  echo && info "Received $1, sending ACPI shutdown signal..."
  echo && info "Received $1 signal, sending ACPI shutdown signal..."

  if [ ! -s "$QEMU_PID" ] || ! read -r pid <"$QEMU_PID"; then
    warn "QEMU PID file ($QEMU_PID) does not exist?"