remove test.sh

This commit is contained in:
iceBear67
2026-07-13 17:16:48 +08:00
parent c041cb97cd
commit 564888b297
3 changed files with 9 additions and 15 deletions
+5 -2
View File
@@ -3,13 +3,16 @@ services:
cloud:
image: bearcloud:latest
network_mode: host
environment:
CPU_COUNT: 4
MEMORY: "4G"
NET_INTERFACE: ""
NET_MAC: ""
volumes:
- "./data:/image"
- "./test.sh:/test.sh"
devices:
- "/dev/kvm:/dev/kvm"
- "/dev/net/tun:/dev/net/tun"
entrypoint: ["/sbin/tini", "/test.sh"]
cap_add:
- CAP_SYS_ADMIN
- CAP_NET_ADMIN
+4 -1
View File
@@ -1,9 +1,10 @@
#!/bin/sh
set -euo pipefail
API_SOCKET="/hy.socks"
_stop() {
ch-remote shutdown-vmm
ch-remote --api-socket "$API_SOCKET" power-button
}
trap _stop EXIT TERM
@@ -12,7 +13,9 @@ trap _stop EXIT TERM
--kernel /boot/vmlinuz-virt --initramfs /boot/initramfs-virt \
--disk path=/image/vm.raw,image_type=raw \
--disk path=/image/data.raw,direct=on,image_type=raw \
--api-socket "$API_SOCKET" \
--cmdline "root=/dev/vda rootfstype=ext4 modules=ext4a rw console=hvc0" \
--cpus boot=${CPU_COUNT:-4} \
--memory size=${MEMORY:-4G},shared=on \
--net "tap=$NET_INTERFACE,mac=$NET_MAC"
$@
-12
View File
@@ -1,12 +0,0 @@
#!/bin/sh
set -euo pipefail
exec /usr/bin/cloud-hypervisor \
--kernel /boot/vmlinuz-virt --initramfs /boot/initramfs-virt \
--disk path=/image/vm.raw,image_type=raw \
--disk path=/image/data.raw,direct=on,image_type=raw \
--cmdline "modules=ext4 root=/dev/vda rootfstype=ext4 rw console=hvc0" \
--cpus boot=${CPU_COUNT:-4} \
--memory size=${MEMORY:-4G},shared=on \
--net "tap="
$@