diff --git a/ant-spk/app/dsm/images/icon_256.png b/ant-spk/app/dsm/images/icon_256.png new file mode 100644 index 0000000..b70e258 Binary files /dev/null and b/ant-spk/app/dsm/images/icon_256.png differ diff --git a/ant-spk/app/dsm/images/icon_72.png b/ant-spk/app/dsm/images/icon_72.png new file mode 100644 index 0000000..a1a6b71 Binary files /dev/null and b/ant-spk/app/dsm/images/icon_72.png differ diff --git a/ant-spk/build.xml b/ant-spk/build.xml new file mode 100644 index 0000000..812f58c --- /dev/null +++ b/ant-spk/build.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ant-spk/spk/scripts/postinst b/ant-spk/spk/scripts/postinst new file mode 100644 index 0000000..fb29445 --- /dev/null +++ b/ant-spk/spk/scripts/postinst @@ -0,0 +1,37 @@ +#!/bin/sh +# Copyright (C) 2000-2016 Synology Inc. All rights reserved. + +p_dir() +{ + [ -d "$1" ] || mkdir -p $1 +} + +p_dir /usr/local/bin +p_dir /usr/local/sbin +p_dir /usr/local/lib +p_dir /usr/local/libexec +p_dir /usr/local/share +p_dir /usr/local/etc +p_dir /usr/local/var +p_dir /usr/local/etc/logrotate.d +p_dir /usr/local/var/cache/ +p_dir /usr/local/var/lib/ +p_dir /usr/local/var/log +p_dir /usr/local/var/run + + +ln -sf $SYNOPKG_PKGDEST/bin/* /usr/local/bin +ln -sf $SYNOPKG_PKGDEST/sbin/* /usr/local/sbin +ln -sf $SYNOPKG_PKGDEST/lib/* /usr/local/lib/ +ln -sf $SYNOPKG_PKGDEST/libexec/* /usr/local/libexec/ +ln -sf $SYNOPKG_PKGDEST/share/* /usr/local/share/ + +ln -sf $SYNOPKG_PKGDEST/etc/libvirt /usr/local/etc/ +ln -sf $SYNOPKG_PKGDEST/etc/sasl2 /usr/local/etc/ +ln -sf $SYNOPKG_PKGDEST/etc/logrotate.d/libvirtd /usr/local/etc/logrotate.d/ + +ln -sf $SYNOPKG_PKGDEST/var/cache/* /usr/local/var/cache/ +ln -sf $SYNOPKG_PKGDEST/var/lib/* /usr/local/var/lib/ +ln -sf $SYNOPKG_PKGDEST/var/log/* /usr/local/var/log/ +ln -sf $SYNOPKG_PKGDEST/var/run/* /usr/local/var/run/ +exit 0 diff --git a/ant-spk/spk/scripts/postuninst b/ant-spk/spk/scripts/postuninst new file mode 100644 index 0000000..7effaa5 --- /dev/null +++ b/ant-spk/spk/scripts/postuninst @@ -0,0 +1,6 @@ +#!/bin/sh +# Copyright (C) 2000-2016 Synology Inc. All rights reserved. + +find /usr/local/ -type l -ls |grep synokvm |awk -F"->" '{print $1}'|awk '{print $NF}'|xargs rm -f + +exit 0 diff --git a/ant-spk/spk/scripts/postupgrade b/ant-spk/spk/scripts/postupgrade new file mode 100644 index 0000000..9f04343 --- /dev/null +++ b/ant-spk/spk/scripts/postupgrade @@ -0,0 +1,4 @@ +#!/bin/sh +# Copyright (C) 2000-2016 Synology Inc. All rights reserved. + +exit 0 diff --git a/ant-spk/spk/scripts/preinst b/ant-spk/spk/scripts/preinst new file mode 100644 index 0000000..9f04343 --- /dev/null +++ b/ant-spk/spk/scripts/preinst @@ -0,0 +1,4 @@ +#!/bin/sh +# Copyright (C) 2000-2016 Synology Inc. All rights reserved. + +exit 0 diff --git a/ant-spk/spk/scripts/preuninst b/ant-spk/spk/scripts/preuninst new file mode 100644 index 0000000..9f04343 --- /dev/null +++ b/ant-spk/spk/scripts/preuninst @@ -0,0 +1,4 @@ +#!/bin/sh +# Copyright (C) 2000-2016 Synology Inc. All rights reserved. + +exit 0 diff --git a/ant-spk/spk/scripts/preupgrade b/ant-spk/spk/scripts/preupgrade new file mode 100644 index 0000000..9f04343 --- /dev/null +++ b/ant-spk/spk/scripts/preupgrade @@ -0,0 +1,4 @@ +#!/bin/sh +# Copyright (C) 2000-2016 Synology Inc. All rights reserved. + +exit 0 diff --git a/ant-spk/spk/scripts/start-stop-status b/ant-spk/spk/scripts/start-stop-status new file mode 100644 index 0000000..facdd1e --- /dev/null +++ b/ant-spk/spk/scripts/start-stop-status @@ -0,0 +1,68 @@ +#!/bin/sh +# Copyright (C) 2000-2016 Synology Inc. All rights reserved. + +insert_kernel_modules() +{ + insmod /lib/modules/kvm.ko + it=`grep vmx /proc/cpuinfo` + amd=`grep svm /proc/cpuinfo` + if [ ! -z "${it}" ]; then + insmod /lib/modules/kvm-intel.ko + elif [ ! -z "${amd}" ]; then + insmod /lib/modules/kvm-amd.ko + else + echo 0 + fi + insmod /lib/modules/tun.ko + insmod /lib/modules/vhost_net.ko +} +remove_kernel_modules() +{ + rmmod vhost_net + rmmod tun + it=`grep vmx /proc/cpuinfo` + amd=`grep svm /proc/cpuinfo` + if [ ! -z "${it}" ]; then + rmmod kvm_intel + elif [ ! -z "${amd}" ]; then + rmmod kvm_amd + else + echo 0 + fi + rmmod kvm +} + +case $1 in + start) + ret=`insert_kernel_modules` + if [ "$ret" != "0" ]; then + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib + virtlogd -d + libvirtd -l -d -f /usr/local/etc/libvirt/libvirtd.conf + exit 0 + else + exit 1 + fi + ;; + stop) + killall libvirtd + killall virtlogd + remove_kernel_modules + exit 0 + ;; + status) + if [ -f "/usr/local/var/run/virtlogd.pid" -a -f "/usr/local/var/run/libvirtd.pid" ]; then + exit 0 + else + exit 1 + fi + ;; + killall) + killall libvirtd + killall virtlogd + remove_kernel_modules + ;; + log) + exit 0 + ;; +esac