LFS

通过构建LFS,学习交叉编译相关概念,理解Linux系统内部的组成、依赖和运行。

概要

实验环境:VMware,2核,4G内存,20G系统磁盘,20G构建LFS磁盘,Ubunt20.4.3LTS
实验步骤:https://star.us.org/lfs-stable/11.0
实验遇到的问题:

  1. VMware,长按shiftgrub的控制台,查看磁盘信息以及grub参数

    1
    2
    3
    ls -a
    ls (hd0,1)/
    cat (hd0,1)/boot/grub/grub.cfg

    若是从LFS所在磁盘启动,grub.cfg文件按需调整

    1
    2
    3
    4
    5
    6
    7
    8
    9
    set 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
    }
  2. VMware,F2bios调整启动顺序,完成构建后从lfs所在磁盘启动

  3. 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
  4. 未修正网卡配置,报错

截图

ref

Comments

You forgot to set the shortname for Disqus. Please set it in _config.yml.