mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-03 22:43:56 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
97c049ed0a
commit
0acff03804
14253 files changed
+3893239
No files matched your search
@@ -0,0 +1,2 @@
|
||||
config machine
|
||||
|
||||
Executable
+89
@@ -0,0 +1,89 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
STOP=1
|
||||
|
||||
EXTRA_COMMANDS="forceStop"
|
||||
EXTRA_HELP="force to kill snology pid"
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG="synology"
|
||||
|
||||
config_t_get() {
|
||||
local index=0
|
||||
[ -n "$4" ] && index=$4
|
||||
local ret=$(uci get $CONFIG.@$1[$index].$2 2>/dev/null)
|
||||
echo ${ret:=$3}
|
||||
}
|
||||
|
||||
|
||||
|
||||
start() {
|
||||
cpu=$(config_t_get machine cpu)
|
||||
smp=$(config_t_get machine smp)
|
||||
m=$(config_t_get machine m)
|
||||
vnc=$(config_t_get machine vnc)
|
||||
qmp=$(config_t_get machine qmp)
|
||||
hda=$(config_t_get machine hda)
|
||||
hdb=$(config_t_get machine hdb)
|
||||
hdc=$(config_t_get machine hdc)
|
||||
hdd=$(config_t_get machine hdd)
|
||||
other=$(config_t_get machine other)
|
||||
if [ -n "$hda" ]; then
|
||||
shda="-hda $hda "
|
||||
fi
|
||||
if [ -n "$hdb" ]; then
|
||||
shdb="-hdb $hdb "
|
||||
fi
|
||||
if [ -n "$hdc" ]; then
|
||||
shda="-hdc $hdc "
|
||||
fi
|
||||
if [ -n "$hdd" ]; then
|
||||
shda="-hdd $hdd "
|
||||
fi
|
||||
if [ -n "$other" ]; then
|
||||
sother="$other "
|
||||
fi
|
||||
|
||||
hardisk=$shda$shdb$shdc$shdd$sother
|
||||
cmd="qemu-system-x86_64 -name synology -enable-kvm -cpu $cpu -m ${m}G -smp $smp -vnc :$vnc \
|
||||
$hardisk -device e1000,netdev=br0 -netdev bridge,br=br-lan,id=br0 -qmp tcp:127.0.0.1:$qmp,server,nowait -nographic"
|
||||
exec $cmd
|
||||
sleep 1
|
||||
qemu_pid=$(/usr/bin/pgrep -f 'qemu-system-x86_64 -name synology')
|
||||
/usr/bin/pgrep qemu-system-x86_64 > $qemu_pidfile
|
||||
echo "QEMU: Started VM with PID $qemu_pid."
|
||||
}
|
||||
|
||||
stop() {
|
||||
qmp=$(config_t_get machine qmp)
|
||||
nc localhost $qmp <<QMP
|
||||
{ "execute": "qmp_capabilities" }
|
||||
{ "execute": "system_powerdown" }
|
||||
QMP
|
||||
# qemu_pid=$(/usr/bin/pgrep qemu-system-x86_64)
|
||||
# if [ -n "$qemu_pid" ]; then
|
||||
# shda="-hdc $hdc "
|
||||
# fi
|
||||
}
|
||||
|
||||
|
||||
forceStop() {
|
||||
qemu_pid=$(/usr/bin/pgrep -f 'qemu-system-x86_64 -name synology')
|
||||
if [ -n "$qemu_pid" ]; then
|
||||
kill $qemu_pid
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
# if [ "$PKG_UPGRADE" != 1 ]; then
|
||||
# uci batch <<-EOF
|
||||
# set luci.themes.vzant=/luci-static/vzant
|
||||
# set luci.main.mediaurlbase=/luci-static/vzant
|
||||
# uci commit
|
||||
# EOF
|
||||
# fi
|
||||
|
||||
exit 0
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"luci-app-synology": {
|
||||
"description": "Grant UCI access for luci-app-synology",
|
||||
"read": {
|
||||
"uci": [ "synology" ]
|
||||
},
|
||||
"write": {
|
||||
"uci": [ "synology" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"config": "synology",
|
||||
"init": "synology"
|
||||
}
|
||||
Reference in new issue
Block a user