几个月来我一直在运行自定义内核,没有模块、没有 initramfs、没有 initrd。
我买了一个新的网络摄像头(锁定...),当然它不能工作,因为我没有正确的模块。我从 5.7.9 开始构建一个新内核。
(...)copying an oldconfig from the original kernel from the distribution (linux mint) into the source rep(...)
make oldconfig
make
make modules_install
但最后一步失败了
make install
sh ./arch/x86/boot/install.sh 5.9.7 arch/x86/boot/bzImage \
System.map "/boot"
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 5.9.7 /boot/vmlinuz-5.9.7
run-parts: executing /etc/kernel/postinst.d/dkms 5.9.7 /boot/vmlinuz-5.9.7
* dkms: running auto installation service for kernel 5.9.7 [ OK ]
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.9.7 /boot/vmlinuz-5.9.7
update-initramfs: Generating /boot/initrd.img-5.9.7
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8125b-2.fw for module r8169
I: The initramfs will attempt to resume from /dev/sda3
I: (UUID=8630d321-f53f-410f-a44a-8d6e91235129)
I: Set the RESUME variable to override this.
Error 24 : Write error : cannot write compressed block
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.9.7 with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
make[1]: *** [arch/x86/boot/Makefile:160 : install] Erreur 1
make: *** [arch/x86/Makefile:274 : install] Erreur 2
我在启动时发现了很多空间问题但似乎不是我的情况。
详情请见:
more /etc/fstab ✔ 15m 55s 10:09:59
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda4 during installation
UUID=8b16e804-06d3-4291-a33f-227b961e9b8e / ext4 errors=remount
-ro 0 1
# /boot was on /dev/sda2 during installation
UUID=6c6fe91d-c3df-4580-ba40-e19dd31710d4 /boot ext4 defaults
0 2
# /boot/efi was on /dev/sda1 during installation
UUID=43E1-4AD4 /boot/efi vfat umask=0077 0 1
# /home was on /dev/sdb3 during installation
UUID=c189cd20-50ff-4ec8-ae61-cbc870fb8926 /home ext4 defaults
0 2
# swap was on /dev/sda3 during installation
UUID=8630d321-f53f-410f-a44a-8d6e91235129 none swap sw
0 0
和磁盘使用情况...
df -h ✔ 10s 10:21:15
Sys. de fichiers Taille Utilisé Dispo Uti% Monté sur
udev 3,9G 0 3,9G 0% /dev
tmpfs 790M 3,2M 787M 1% /run
/dev/sda4 91G 16G 70G 19% /
tmpfs 3,9G 114M 3,8G 3% /dev/shm
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 3,9G 0 3,9G 0% /sys/fs/cgroup
/dev/sda2 923M 249M 611M 29% /boot
/dev/sda1 197M 7,8M 190M 4% /boot/efi
/dev/sdb3 484G 237G 223G 52% /home
tmpfs 790M 16K 790M 1% /run/user/1000
我也修改了一些 Grub2 参数,不知道这是否会导致问题......
实际上,我可以启动我的任何内核(原始内核、使用 initramfs 启动、我的自定义内核……),但我无法安装这个新内核。有什么想法吗?
答案1
回复中重要的反馈sudo apt upgrade
如下:
Error 24 : Write error : cannot write compressed block
换句话说,可能没有足够的空间来/boot
写出并完成升级。要检查,请键入:
df -h | grep boot
如果您已使用了约 90% 的空间,并且只剩下几十兆的可用空间,那么这显然是您的问题。但是,这取决于您的自定义内核所需的空间。
解决方法是删除不需要的内核映像。输入后sudo apt list --installed | grep linux-image
您将得到如下内容:
linux-image-5.4.0-54-generic/focal-updates,now 5.4.0-54.60 amd64 [installed,auto-removable]
linux-image-5.4.0-56-generic/now 5.4.0-56.62 amd64 [installed,local]
linux-image-5.4.0-58-generic/focal-updates,focal-security,now 5.4.0-58.64 amd64 [installed,automatic]
linux-image-5.4.0-59-generic/focal-updates,now 5.4.0-59.65 amd64 [installed,automatic]
linux-image-generic/focal-updates,now 5.4.0.59.62 amd64 [installed,automatic]
使用以下方法删除不需要的图像:
sudo apt remove linux-headers-5.4.0-54 linux-headers-5.4.0-54-generic linux-image-5.4.0-54-generic linux-modules-5.4.0-54-generic
替换5.4.0-54
您的内核映像。您不需要重新运行sudo apt upgrade -y
。但是,如果您这样做,您将看到类似以下内容:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
linux-headers-5.4.0-56 linux-headers-5.4.0-56-generic linux-image-5.4.0-56-generic linux-modules-5.4.0-56-generic
linux-modules-extra-5.4.0-56-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
因此,执行sudo apt autoremove
并在将来读取输出apt upgrade
并确保做好您的家务!