실행 후 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
고양이/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