install-driver 691 B

123456789101112131415161718
  1. #!/bin/bash -x
  2. service aesmd stop
  3. /sbin/modprobe -r graphene-sgx
  4. /sbin/modprobe -r isgx
  5. mkdir -p "/lib/modules/"`uname -r`"/kernel/drivers/intel/sgx"
  6. cp linux-sgx-driver/isgx.ko graphene-sgx-driver/graphene-sgx.ko "/lib/modules/"`uname -r`"/kernel/drivers/intel/sgx"
  7. cat /etc/modules | grep -Fxq isgx || echo isgx >> /etc/modules
  8. cat /etc/modules | grep -Fxq graphene-sgx || echo graphene-sgx >> /etc/modules
  9. /sbin/depmod
  10. /sbin/modprobe isgx
  11. /sbin/modprobe graphene-sgx
  12. service aesmd start
  13. if [ "`sysctl -n vm.mmap_min_addr`" != 0 ]; then
  14. cat /etc/sysctl.conf | grep -Fxq 'vm.mmap_min_addr = 0' || \
  15. echo -e "\n# For Graphene-SGX\nvm.mmap_min_addr = 0" >> /etc/sysctl.conf
  16. sysctl -p
  17. fi