qemu: virtio-console-helper as a separate package

While at it, update copyright header.

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
This commit is contained in:
Yousong Zhou
2016-11-29 12:18:26 +08:00
parent c778ff5714
commit 3aa9ece43c
3 changed files with 35 additions and 4 deletions
+19
View File
@@ -0,0 +1,19 @@
#!/bin/sh
# Copyright (C) 2016 OpenWrt.org
# Copyright (C) 2016 Yousong Zhou <yszhou4tech@gmail.com>
[ "$SUBSYSTEM" = "virtio-ports" ] || exit 0
syspath="/sys/$DEVPATH"
name="$(cat "$syspath/name" 2>/dev/null)"
[ -n "$name" ] || exit 0
case "$ACTION" in
"add")
mkdir -p /dev/virtio-ports
ln -s "/dev/$DEVNAME" "/dev/virtio-ports/$name"
;;
"del")
rm -f "/dev/virtio-ports/$name"
;;
esac