dkms内核升级,但内核头文件linux-headers-generic没有自动安装时,安装驱动的情况
(2022-10-13 16:10:42)
标签:
dkpgdkms驱动 |
分类: linux |
1、内核已自动升级,头文件没有自动安装,此时安装驱动:sudo dpkg -i *.deb
/usr/src/bmsophon-0.4.1
linux-headers-4.15.0-194
linux-headers-4.15.0-194
linux-headers-4.15.0-194-generic
* dkms: running auto installation service
for kernel 4.15.0-194-generic
- Original module
- No original module
exists within this kernel
- Installation
- Installing to
/lib/modules/4.15.0-194-generic/updates/dkms/
...done.
#会补装驱动,没有完成的动作继续完成。
$ sudo dpkg -r sophon-driver sophon-libsophon-dev
sophon-libsophon
(Reading database ... 187078 files and directories currently
installed.)
Removing sophon-driver (0.4.1) ...
modprobe: FATAL: Module bmsophon not found.
------------------------------
Deleting module version: 0.4.1
completely from the DKMS tree.
------------------------------
Done.
Removing sophon-libsophon-dev (0.4.1) ...
Removing sophon-libsophon (0.4.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1.5) ...
bitmain@supermicro:~/1684x/172.28.141.75/sophon-sdk/libsophon/daily_build/Master_20221009_085218$
sudo dpkg -i *.deb
Selecting previously unselected package sophon-driver.
(Reading database ... 186635 files and directories currently
installed.)
Preparing to unpack sophon-driver_0.4.1_amd64.deb ...
Unpacking sophon-driver (0.4.1) ...
Selecting previously unselected package
sophon-libsophon.
Preparing to unpack sophon-libsophon_0.4.1_amd64.deb ...
Unpacking sophon-libsophon (0.4.1) ...
Selecting previously unselected package
sophon-libsophon-dev.
Preparing to unpack sophon-libsophon-dev_0.4.1_amd64.deb
...
Unpacking sophon-libsophon-dev (0.4.1) ...
Setting up sophon-driver (0.4.1) ...
Creating symlink /var/lib/dkms/bmsophon/0.4.1/source
->
DKMS: add completed.
Error! Your kernel headers for kernel 4.15.0-194-generic
cannot be found.
#提示没有头文件
Please install the linux-headers-4.15.0-194-generic
package,
or use the --kernelsourcedir option to tell DKMS where it's
located
modprobe: FATAL: Module bmsophon not found.
modprobe: FATAL: Module bmsophon not found in directory
/lib/modules/4.15.0-194-generic
sophon driver install error happened, please see dmesg for
more infomation
Setting up sophon-libsophon (0.4.1) ...
Setting up sophon-libsophon-dev (0.4.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1.5) ...
bitmain@supermicro:~/1684x/172.28.141.75/sophon-sdk/libsophon/daily_build/Master_20221009_085218$
dkms status
bmsophon, 0.4.1: added
###状态不对。
2、安装头文件:
~$ sudo apt-get install linux-headers-$(uname -r)
[sudo] password for bitmain:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
The following NEW packages will be installed:
0 upgraded, 2 newly installed, 0 to remove and 48 not
upgraded.
Need to get 12.2 MB of archives.
After this operation, 90.2 MB of additional disk space will be
used.
Do you want to continue? [Y/n] y
Get:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu
bionic-updates/main amd64 linux-headers-4.15.0-194 all
4.15.0-194.205 [11.0 MB]
Get:2 https://mirrors.tuna.tsinghua.edu.cn/ubuntu
bionic-updates/main amd64 linux-headers-4.15.0-194-generic amd64
4.15.0-194.205 [1,256 kB]
Fetched 12.2 MB in 4s (2,877 kB/s)
Selecting previously unselected package
linux-headers-4.15.0-194.
(Reading database ... 187079 files and directories currently
installed.)
Preparing to unpack
.../linux-headers-4.15.0-194_4.15.0-194.205_all.deb ...
Unpacking linux-headers-4.15.0-194 (4.15.0-194.205) ...
Selecting previously unselected package
linux-headers-4.15.0-194-generic.
Preparing to unpack
.../linux-headers-4.15.0-194-generic_4.15.0-194.205_amd64.deb
...
Unpacking linux-headers-4.15.0-194-generic (4.15.0-194.205)
...
Setting up linux-headers-4.15.0-194 (4.15.0-194.205) ...
Setting up linux-headers-4.15.0-194-generic (4.15.0-194.205)
...
/etc/kernel/header_postinst.d/dkms:
Kernel preparation unnecessary for this
kernel. Skipping...
Building module:
cleaning build area...
make -j56 KERNELRELEASE=4.15.0-194-generic SOC_MODE=0
PLATFORM=asic SYNC_API_INT_MODE=1 TARGET_PROJECT=sg_x86_pcie_device
FW_SIMPLE=0 PCIE_MODE_ENABLE_CPU=1.............
cleaning build area...
DKMS: build completed.
bmsophon.ko:
Running module version sanity check.
depmod...
DKMS: install completed.
bitmain@supermicro:~$ dkms status
bmsophon, 0.4.1, 4.15.0-194-generic, x86_64:
installed
##状态有改变。
但此时查看板卡,还没有设备。
3、再次重装驱动 sudo dpkg -i *.deb
正常。