]> rtime.felk.cvut.cz Git - hercules2020/jailhouse-build.git/blob - build/rootfs-overlay/etc/init.d/S20jailhouse.sh
c415e86f0ad892e46771d9a957c9b4677aa23e75
[hercules2020/jailhouse-build.git] / build / rootfs-overlay / etc / init.d / S20jailhouse.sh
1 if ! grep -q -w jailhouse /proc/cmdline; then
2     echo "Jailhouse not enabled"
3     return
4 fi
5
6 case "$1" in
7     start)
8         printf "Starting Jailhouse: "
9         /sbin/modprobe jailhouse
10         # Switch on Denver cores
11         echo 1 > /sys/devices/system/cpu/cpu1/online
12         echo 1 > /sys/devices/system/cpu/cpu2/online
13         /usr/sbin/jailhouse enable /jailhouse/configs/jetson-tx2.cell
14         [ $? = 0 ] && echo "OK" || echo "FAIL"
15         ;;
16     stop)
17         printf "Stopping Jailhouse: "
18         /usr/sbin/jailhouse disable /jailhouse/configs/jetson-tx2.cell
19         /sbin/rmmod jailhouse
20         [ $? = 0 ] && echo "OK" || echo "FAIL"
21         ;;
22 esac