fix entrypoint

This commit is contained in:
iceBear67
2026-07-13 17:28:48 +08:00
parent b3ee94f8c0
commit ae5aba2109
+12 -8
View File
@@ -3,12 +3,6 @@ set -euo pipefail
API_SOCKET="/hy.socks"
_stop() {
ch-remote --api-socket "$API_SOCKET" power-button
}
trap _stop EXIT TERM
/usr/bin/cloud-hypervisor \
--kernel /boot/vmlinuz-virt --initramfs /boot/initramfs-virt \
--disk path=/image/vm.raw,image_type=raw \
@@ -17,5 +11,15 @@ trap _stop EXIT TERM
--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"
$@
--net "tap=$NET_INTERFACE,mac=$NET_MAC" \
$@ &
CH_PID=$!
_stop() {
ch-remote --api-socket "$API_SOCKET" power-button
}
trap _stop TERM
wait $CH_PID