fix entrypoint
This commit is contained in:
+12
-8
@@ -3,12 +3,6 @@ set -euo pipefail
|
|||||||
|
|
||||||
API_SOCKET="/hy.socks"
|
API_SOCKET="/hy.socks"
|
||||||
|
|
||||||
_stop() {
|
|
||||||
ch-remote --api-socket "$API_SOCKET" power-button
|
|
||||||
}
|
|
||||||
|
|
||||||
trap _stop EXIT TERM
|
|
||||||
|
|
||||||
/usr/bin/cloud-hypervisor \
|
/usr/bin/cloud-hypervisor \
|
||||||
--kernel /boot/vmlinuz-virt --initramfs /boot/initramfs-virt \
|
--kernel /boot/vmlinuz-virt --initramfs /boot/initramfs-virt \
|
||||||
--disk path=/image/vm.raw,image_type=raw \
|
--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" \
|
--cmdline "root=/dev/vda rootfstype=ext4 modules=ext4a rw console=hvc0" \
|
||||||
--cpus boot=${CPU_COUNT:-4} \
|
--cpus boot=${CPU_COUNT:-4} \
|
||||||
--memory size=${MEMORY:-4G},shared=on \
|
--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
|
||||||
Reference in New Issue
Block a user