“Ubuntu From Scratch”(通常简称 UFS)并不是 Ubuntu 官方发行版,而是社区项目,目标是从源码自己构建一个 Ubuntu 风格的 Linux 系统。它和 LFS(Linux From Scratch)类似,但更偏向 Ubuntu 生态。
你问“怎么启动”,通常有两种理解,我分别说明:
grub-install /dev/sdX
update-grub
grub.cfg 类似:
menuentry "Ubuntu From Scratch" {
linux /boot/vmlinuz root=/dev/sda1 rw
initrd /boot/initrd.img
}
qemu-system-x86_64 \
-kernel /path/to/vmlinuz \
-initrd /path/to/initrd.img \
-append "root=/dev/sda1 rw" \
-drive file=ufs.img,format=raw
如果你没用磁盘:
qemu-system-x86_64 \
-kernel vmlinuz \
-initrd initramfs.cpio.gz \
-append "rdinit=/sbin/init"
那“启动”指的是开始构建过程,而不是系统启动。
官方参考:
ubuntu-from-scratch/ufs| 现象 | 原因 |
|---|---|
| Kernel panic | 根文件系统不对 / init 不存在 |
| 黑屏 | 显卡驱动或内核参数问题 |
| GRUB 找不到系统 | root= 写错 |
| 无法挂载 root | 没编进内核的 filesystem 驱动 |
你可以直接说:
“我已经构建好了,但启动报错:xxxx” 或 “我想从零开始做一个 UFS”