lfs-livecd/教程/03-生成initramfs.txta
liushuncheng e680bb4199
rename 教程/03-生成initramfs.txt to 教程/03-生成initramfs.txta.
Signed-off-by: liushuncheng <2930054131@qq.com>
2025-01-16 16:25:30 +00:00

18 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 12.2中由于systemd-udevd可能存在的一些问题导致libkmod.so未能正确包含在initramfs中 加入参数-I "/usr/lib/libkmod.so"来解决模块无法自动加载的问题sysv版和systemd版都受到影响