intel驱动程序如何安装 英特尔驱动的安装教学

因为 Intel SGX 的驱动从 5.x 内核主线才开始支持,因此 5.x 以下的内核版本要使用SGX的功能,需要额外编译安装驱动 。
以 Ubuntu 18.04为例,安装驱动也非常简单,从 Intel 的官网下载驱动 bin 包,直接执行即可:
$ sudo ./sgx_linux_x64_driver_1.41.binUnpacking Intel SGX Driver ... done.Verifying the integrity of the install package ... done.Installing Intel SGX Driver .../tmp/sgx-driver-F6eUsR ~/workspace/sgxinstall -d /opt/intel/sgxdriver/packageinstall -d /opt/intel/sgxdriver/scriptscp -r package/* /opt/intel/sgxdriver/packageinstall scripts/* /opt/intel/sgxdriver/scripts~/workspace/sgxCreating symlink /var/lib/dkms/sgx/1.41/source ->/usr/src/sgx-1.41DKMS: add completed.Kernel preparation unnecessary for this kernel.Skipping...Building module:cleaning build area...\'make\' KDIR=/lib/modules/4.15.0-153-generic/build....Signing module:Generating a new Secure Boot signing key:Can\'t load /var/lib/shim-signed/mok/.rnd into RNG140349876240832:error:2406F079:random number generator:RAND_load_file:Cannot open file:../crypto/rand/randfile.c:88:Filename=/var/lib/shim-signed/mok/.rndGenerating a RSA private key...........................................................................................+++++......................+++++writing new private key to \'/var/lib/shim-signed/mok/MOK.priv\'----- - /var/lib/dkms/sgx/1.41/4.15.0-153-generic/x86_64/module/intel_sgx.koEFI variables are not supported on this system/sys/firmware/efi/efivars not found, aborting.cleaning build area...DKMS: build completed.intel_sgx:Running module version sanity check. - Original module- No original module exists within this kernel - Installation- Installing to /lib/modules/4.15.0-153-generic/updates/dkms/depmod.....DKMS: install completed.You may need to run \"/sbin/modprobe intel_sgx (--allow-unsupported)\" or reboot system manually!uninstall.sh script generated in \"/opt/intel/sgxdriver\".$安装完成后,加载内核模块,应该能在 /dev 下看到 sgx 样的设备 。如果没有,说明这款 CPU 硬件不支持 SGX 。
【intel驱动程序如何安装 英特尔驱动的安装教学】从安装过程中可以看出 SGX 驱动安装采用了 DKMS 的方式,这是什么呢?DKMS 的全称是 Dynamic Kernel Module Support , 它使一些设备商可以以源码的方式提供驱动版本,当内核升级时,会自动编译出与新内核兼容的驱动版本 。