我需要访问路径内的 option.c 文件[linux-src]/drivers/usb/serial/option.c
。我更新了内核版本:
admin@sintrones-abox:~$ uname -r
5.18.14-051814-generic
在文件夹 /usr/src 中我仍然有旧的内核目录:
admin@sintrones-abox:/usr/src$ ls
backport-iwlwifi-8324 linux-hwe-5.4-headers-5.4.0-122
linux-headers-5.18.14-051814 Quectel_Linux_USB_Driver
linux-headers-5.4.0-122-generic
我尝试搜索:
admin@sintrones-abox:/usr/src$ locate -b '\serial'
/home/admin/drivers/usb/serial
/lib/modules/4.15.0-189-generic/kernel/drivers/tty/serial
/lib/modules/5.4.0-122-generic/kernel/drivers/tty/serial
/lib/modules/5.4.0-122-generic/kernel/drivers/usb/serial
/snap/core20/1518/usr/lib/python3/dist-packages/serial
/snap/core20/1581/usr/lib/python3/dist-packages/serial
/usr/lib/python3/dist-packages/serial
/usr/src/Quectel_Linux_USB_Driver/drivers/usb/serial
/usr/src/linux-headers-5.4.0-122-generic/include/config/serial
/usr/src/linux-headers-5.4.0-122-generic/include/config/ir/serial
/usr/src/linux-headers-5.4.0-122-generic/include/config/kgdb/serial
/usr/src/linux-headers-5.4.0-122-generic/include/config/snd/serial
/usr/src/linux-headers-5.4.0-122-generic/include/config/tablet/serial
/usr/src/linux-headers-5.4.0-122-generic/include/config/u/serial
/usr/src/linux-headers-5.4.0-122-generic/include/config/usb/serial
/usr/src/linux-hwe-5.4-headers-5.4.0-122/drivers/tty/serial
/usr/src/linux-hwe-5.4-headers-5.4.0-122/drivers/usb/serial
/var/lib/snapd/assertions/asserts-v0/serial
但它们都不包含option.c
文件。它是 Linux 自动生成的文件吗?我在哪里可以找到它?我该如何重新生成它?
答案1
安装 linux-source 后,转到 /usr/src,那里应该有 linux-source-5.18.14-xx.tar.bz2。解压后,所有源文件都应位于其正确位置。