安装 linux-modules 仅在下次重启前有效

安装 linux-modules 仅在下次重启前有效

我有一台运行 Ubuntu 22.04 的 Raspberry Pi。我认为系统可能在安装过​​程中不合时宜地关闭了linux-modules-5.15.0-1050-raspi

当我插入 FTDI USB 串行转换器时,没有加载驱动程序。原来这是因为没有usbserial安装驱动程序:

# modprobe usbserial
modprobe: FATAL: Module usbserial not found in directory /lib/modules/5.15.0-1050-raspi

我可以修复它,它说正在更新 initramfs:

# apt install linux-modules-$(uname -r)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
linux-modules-5.15.0-1050-raspi is already the newest version (5.15.0-1050.53).
0 upgraded, 0 newly installed, 0 to remove and 20 not upgraded.
# apt install --reinstall linux-modules-$(uname -r)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 20 not upgraded.
Need to get 36.3 MB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 linux-modules-5.15.0-1050-raspi arm64 5.15.0-1050.53 [36.3 MB]
Fetched 36.3 MB in 4s (8963 kB/s)                           
(Reading database ... 104217 files and directories currently installed.)
Preparing to unpack .../linux-modules-5.15.0-1050-raspi_5.15.0-1050.53_arm64.deb ...
Unpacking linux-modules-5.15.0-1050-raspi (5.15.0-1050.53) over (5.15.0-1050.53) ...
Setting up linux-modules-5.15.0-1050-raspi (5.15.0-1050.53) ...
Processing triggers for linux-image-5.15.0-1050-raspi (5.15.0-1050.53) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.15.0-1050-raspi
Using DTB: bcm2711-rpi-4-b.dtb
Installing /lib/firmware/5.15.0-1050-raspi/device-tree/broadcom/bcm2711-rpi-4-b.dtb into /boot/dtbs/5.15.0-1050-raspi/./bcm2711-rpi-4-b.dtb
Taking backup of bcm2711-rpi-4-b.dtb.
Installing new bcm2711-rpi-4-b.dtb.
flash-kernel: deferring update (trigger activated)
/etc/kernel/postinst.d/zz-flash-kernel:
Using DTB: bcm2711-rpi-4-b.dtb
Installing /lib/firmware/5.15.0-1050-raspi/device-tree/broadcom/bcm2711-rpi-4-b.dtb into /boot/dtbs/5.15.0-1050-raspi/./bcm2711-rpi-4-b.dtb
Taking backup of bcm2711-rpi-4-b.dtb.
Installing new bcm2711-rpi-4-b.dtb.
flash-kernel: deferring update (trigger activated)
Processing triggers for flash-kernel (3.104ubuntu19) ...
Using DTB: bcm2711-rpi-4-b.dtb
Installing /lib/firmware/5.15.0-1050-raspi/device-tree/broadcom/bcm2711-rpi-4-b.dtb into /boot/dtbs/5.15.0-1050-raspi/./bcm2711-rpi-4-b.dtb
Taking backup of bcm2711-rpi-4-b.dtb.
Installing new bcm2711-rpi-4-b.dtb.
flash-kernel: installing version 5.15.0-1050-raspi
Taking backup of vmlinuz.
Installing new vmlinuz.
Taking backup of initrd.img.
Installing new initrd.img.
Taking backup of uboot_rpi_arm64.bin.
Installing new uboot_rpi_arm64.bin.
Taking backup of uboot_rpi_4.bin.
Installing new uboot_rpi_4.bin.
Taking backup of uboot_rpi_3.bin.
Installing new uboot_rpi_3.bin.
Generating boot script u-boot image... done.
Taking backup of boot.scr.
Installing new boot.scr.
Taking backup of start4.elf.
Installing new start4.elf.
Taking backup of fixup4db.dat.
Installing new fixup4db.dat.
Taking backup of start.elf.
Installing new start.elf.
Taking backup of start4x.elf.
... snip ...
Taking backup of w5500.dtbo.
Installing new w5500.dtbo.
Taking backup of minipitft13.dtbo.
Installing new minipitft13.dtbo.
Installing new README.
Scanning processes...                                                                                                                                                                                      
Scanning processor microcode...                                                                                                                                                                            
Scanning linux images...                                                                                                                                                                                   

Running kernel seems to be up-to-date.

Failed to check for processor microcode upgrades.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.
# 

现在模块存在:

# sudo modprobe usbserial
# 

但此时,通用 USB 驱动程序似乎已经认领了该设备,而驱动程序usbserial却没有得到它。所以我重新启动(因为我懒得弄清楚如何重置特定的 USB 设备,请记住启动盘在这里也是一个 USB 设备),现在又没有usbserial驱动程序了。看起来 initramfs 重建没有任何效果?

有人能建议一种方法来永久安装此系统上的驱动程序吗?真的不想从头开始重新映像。

相关内容