You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
371 B

  1. #!/bin/sh
  2. # Copyright (C) 2016 OpenWrt.org
  3. [ "$SUBSYSTEM" = "virtio-ports" ] || exit 0
  4. syspath="/sys/$DEVPATH"
  5. name="$(cat "$syspath/name" 2>/dev/null)"
  6. [ -n "$name" ] || exit 0
  7. case "$ACTION" in
  8. "add")
  9. mkdir -p /dev/virtio-ports
  10. ln -s "/dev/$DEVNAME" "/dev/virtio-ports/$name"
  11. /etc/init.d/qemu-ga start
  12. ;;
  13. "del")
  14. rm -f "/dev/virtio-ports/$name"
  15. ;;
  16. esac