実行後にupdate-initramfs -c -k 6.4.0-rt8
生成されたinitrdが470Mと非常に大きいことが確認され、再起動した後、次のように表示されましたerror: out of memory
。この問題をどのように解決できますか?
initrdで抽出したいくつかのファイルを削除して再圧縮したいのですが、どのファイルを削除するのかわかりませんか?
解凍したファイル情報:
debian12@gyz:~/initrd/temp/test$ sudo unmkinitramfs initrd.img-6.4.0-rt8 .
debian12@gyz:~/initrd/temp/test$ ls
early main initrd.img-6.4.0-rt8
debian12@gyz:~/initrd/temp/test$ ls main/
bin conf etc init lib lib32 lib64 libx32 run sbin scripts usr var
debian12@gyz:~/initrd/temp/test$ ls early/
kernel
debian12@gyz:~/initrd/temp/test$
再圧縮方法は正しいですか?
find . | cpio -H newc -o > ../new_initrd
gzip -9 ../new_initrd
mv ../new_initrd.gz ../new_initrd
Cat/etc/initramfs-tools/initramfs.conf
#
# initramfs.conf
# Configuration file for mkinitramfs(8). See initramfs.conf(5).
#
# Note that configuration options from this file can be overridden
# by config files in the /etc/initramfs-tools/conf.d directory.
#
# MODULES: [ most | netboot | dep | list ]
#
# most - Add most filesystem and all harddrive drivers.
#
# dep - Try and guess which modules to load.
#
# netboot - Add the base modules, network modules, but skip block devices.
#
# list - Only include modules from the 'additional modules' list
#
MODULES=most
#
# BUSYBOX: [ y | n | auto ]
#
# Use busybox shell and utilities. If set to n, klibc utilities will be used.
# If set to auto (or unset), busybox will be used if installed and klibc will
# be used otherwise.
#
BUSYBOX=auto
#
# KEYMAP: [ y | n ]
#
# Load a keymap during the initramfs stage.
#
KEYMAP=n
#
# COMPRESS: [ gzip | bzip2 | lz4 | lzma | lzop | xz | zstd ]
#
COMPRESS=zstd
#
# COMPRESSLEVEL: ...
#
# Set a compression level for the compressor.
# Defaults vary by compressor.
#
# Valid values are:
# 1 - 9 for gzip|bzip2|lzma|lzop
# 0 - 9 for lz4|xz
# 0 - 19 for zstd
#
# COMPRESSLEVEL=3
#
# DEVICE: ...
#
# Specify a specific network interface, like eth0
# Overridden by optional ip= or BOOTIF= bootarg
#
DEVICE=
#
# NFSROOT: [ auto | HOST:MOUNT ]
#
NFSROOT=auto
#
# RUNSIZE: ...
#
# The size of the /run tmpfs mount point, like 256M or 10%
# Overridden by optional initramfs.runsize= bootarg
#
RUNSIZE=10%
#
# FSTYPE: ...
#
# The filesystem type(s) to support, or "auto" to use the current root
# filesystem type
#
FSTYPE=auto
次に追加du -sch /etc/initramfs-tools/
:
debian12@gyz:~/initrd/temp$ du -sch /etc/initramfs-tools/
72K /etc/initramfs-tools/
72K 总计
次へ追加du -h
debian12@gyz:~/initrd/temp/test$ find . -type f -size +20M -exec du -h {} +
44M ./main/usr/lib/modules/6.4.0-rt8/kernel/fs/xfs/xfs.ko
35M ./main/usr/lib/modules/6.4.0-rt8/kernel/fs/btrfs/btrfs.ko
30M ./main/usr/lib/modules/6.4.0-rt8/kernel/drivers/net/ethernet/intel/ice/ice.ko
29M ./main/usr/lib/modules/6.4.0-rt8/kernel/drivers/net/ethernet/netronome/nfp/nfp.ko
90M ./main/usr/lib/modules/6.4.0-rt8/kernel/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko
354M ./main/usr/lib/modules/6.4.0-rt8/kernel/drivers/gpu/drm/amd/amdgpu/amdgpu.ko
135M ./main/usr/lib/modules/6.4.0-rt8/kernel/drivers/gpu/drm/i915/i915.ko
51M ./main/usr/lib/modules/6.4.0-rt8/kernel/drivers/gpu/drm/radeon/radeon.ko
192M ./main/usr/lib/modules/6.4.0-rt8/kernel/drivers/gpu/drm/nouveau/nouveau.ko
debian12@gyz:~/initrd/temp/test$ ls initrd.img-6.4.0-rt8 -ltr
-rw-r--r-- 1 root root 483166934 8月29日 19:55 initrd.img-6.4.0-rt8