]> rtime.felk.cvut.cz Git - hercules2020/jailhouse-build.git/blob - build/rootfs-overlay/etc/init.d/S20jailhouse.sh
Switch off Denver cores before starting Jailhouse
[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         modprobe jailhouse
10         # Switch off Denver cores
11         echo 0 > /sys/devices/system/cpu/cpu1/online
12         echo 0 > /sys/devices/system/cpu/cpu2/online
13         jailhouse enable /jailhouse/configs/jetson-tx2.cell
14         [ $? = 0 ] && echo "OK" || echo "FAIL"
15         ;;
16     stop)
17         printf "Stopping Jailhouse: "
18         jailhouse disable /jailhouse/configs/jetson-tx2.cell
19         rmmod jailhouse
20         [ $? = 0 ] && echo "OK" || echo "FAIL"
21         ;;
22 esac