qemu-oe-bridge-helper 548 B

12345678910111213141516171819202122232425
  1. #! /bin/sh
  2. # Copyright 2020 Garmin Ltd. or its subsidiaries
  3. #
  4. # SPDX-License-Identifier: GPL-2.0
  5. #
  6. # Attempts to find and exec the host qemu-bridge-helper program
  7. # If the QEMU_BRIDGE_HELPER variable is set by the user, exec it.
  8. if [ -n "$QEMU_BRIDGE_HELPER" ]; then
  9. exec "$QEMU_BRIDGE_HELPER" "$@"
  10. fi
  11. # Search common paths for the helper program
  12. BN="qemu-bridge-helper"
  13. PATHS="/usr/libexec/ /usr/lib/qemu/"
  14. for p in $PATHS; do
  15. if [ -e "$p/$BN" ]; then
  16. exec "$p/$BN" "$@"
  17. fi
  18. done
  19. echo "$BN not found!" > /dev/stderr
  20. exit 1