lfs-livecd/教程/03-生成initramfs.txt
liushuncheng 94f7ae30e2
update 教程/03-生成initramfs.txt.
Signed-off-by: liushuncheng <2930054131@qq.com>
2025-01-16 16:20:47 +00:00

22 lines
1.1 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

我们开始生成initramfs,生成出来的initramfs必须能用才行
假如你是lfs sysv,运行该命令:
dracut --omit "systemd dracut-systemd systemd-initrd systemd-networkd systemd-sysusers" \
--add "dm dmsquash-live dmsquash-live-autooverlay kernel-modules bash" \
--zstd --no-hostonly --no-hostonly-cmdline --no-hostonly-i18n --force \
--kver 你的内核版本
假如你是systemd版本的lfs,运行此命令:
dracut --add "dm dmsquash-live dmsquash-live-autooverlay kernel-modules bash" \
--zstd --no-hostonly --no-hostonly-cmdline --no-hostonly-i18n --force \
--kver 你的内核版本
注意你的内核必须支持zstd压缩的initramfs
有问题的话--add "dm dmsquash-live dmsquash-live-autooverlay kernel-modules bash"
改为--add "dm dmsquash-live dmsquash-live-autooverlay kernel-modules bash overlayfs overlay-root"
注意:在lfs最新稳定版中由于systemd-udevd可能存在的一些问题
导致libkmod未能正确包含在initramfs中
加入参数-I "/usr/lib/libkmod.so"来解决问题
sysv版和systemd版都受到影响