qemu: new package qemu-ga

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
This commit is contained in:
Yousong Zhou
2015-11-28 11:23:57 +08:00
parent 55cb6a0ca0
commit 3ea82eecb7
3 changed files with 96 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2016 OpenWrt.org
START=99
USE_PROCD=1
BIN=/usr/bin/qemu-ga
start_service() {
procd_open_instance
procd_set_param command $BIN
procd_set_param respawn
procd_set_param stderr 1
procd_close_instance
}
+19
View File
@@ -0,0 +1,19 @@
#!/bin/sh
# Copyright (C) 2016 OpenWrt.org
[ "$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"
/etc/init.d/qemu-ga start
;;
"del")
rm -f "/dev/virtio-ports/$name"
;;
esac