LFS
通过构建LFS,学习交叉编译相关概念,理解Linux系统内部的组成、依赖和运行。
概要
实验环境:VMware,2核,4G内存,20G系统磁盘,20G构建LFS磁盘,Ubunt20.4.3LTS
实验步骤:https://star.us.org/lfs-stable/11.0
实验遇到的问题:
VMware,长按
shift
进grub
的控制台,查看磁盘信息以及grub参数1
2
3ls -a
ls (hd0,1)/
cat (hd0,1)/boot/grub/grub.cfg若是从LFS所在磁盘启动,
grub.cfg
文件按需调整1
2
3
4
5
6
7
8
9set default=0
set timeout=5
insmod ext2
set root=(hd0,1)
menuentry "GNU/Linux, Linux 5.13.12-lfs-11.0" {
linux /boot/vmlinuz-5.13.12-lfs-11.0 root=/dev/sdb1 ro
}VMware,
F2
进bios
调整启动顺序,完成构建后从lfs所在磁盘启动VMware,虚机启动LFS报错
kernel panic -not syncing:VFS:Unable to mount root fs on unknown block(0,0)
返回chroot
,重新编译内核,make menuconfig
加选1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20→ Device Drivers→ SCSI device support
<*> SCSI disk support
<*> SCSI generic support
→ Device Drivers→ SCSI device support→ SCSI low-level drivers
-*- LSI MPT Fusion SAS 3.0 & SAS 2.0 Device Driver
(128) LSI MPT Fusion SAS 2.0 Max number of SG Entries (16 - 256)
(128) LSI MPT Fusion SAS 3.0 Max number of SG Entries (16 - 256)
<*> Legacy MPT2SAS config option
→ Device Drivers
[*] Fusion MPT device support —>
→ Device Drivers→ Fusion MPT device support
— Fusion MPT device support
<*> Fusion MPT ScsiHost drivers for SPI
<*> Fusion MPT ScsiHost drivers for SAS
(128) Maximum number of scatter gather entries (16 - 128)
<*> Fusion MPT misc device (ioctl) driver
[*] Fusion MPT logging facility未修正网卡配置,报错