One of the solutions to LFS kernel panic problems, lfspanic
/********************************************************************* * Author : Samson * Date : 04/26/2015 * Test platform: * gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2 * GNU bash, 4.3.11(1)-release (x86_64-pc-linux-gnu) * *******************************************************************/
The following error occurs when using the host machine in vmware Virtual Machine to build LFS for Debian:
LFS kernel panic-not syncing: VFS: Unable to mount root fs on Unkn...
During compilation, pay special attention to one problem: If the disk attached to the VM is of the SCSI interface type, in make menuconfig, you should choose according to 8.3.1 in LFS 7.7, you also need to select the following item Device Drivers --> Fusion MPT device support --> Fusion MPT (base + ScsiHost) drivers, which is for the hard disk Device of the SCSI interface.
During kernel compilation, parameter configuration is troublesome. Kernel panic problems are generally caused by incorrect parameter configuration or lack of some major drivers. If it is a virtual machine, you can view it in other virtual machines, use the command lspci, find the corresponding item in the menu in menuconfig for configuration, and then compile it.
First, let's take a look at my hard disk layout:
The disk layout is as follows:
Root @ ufo:/home/ufo # lsblk
Name maj: MIN RM SIZE RO TYPE MOUNTPOINT
Sda 8:0 0 45G 0 disk
─ ── Sda1 80 43.1G 0 part/
├ ── Sda2 8:2 0 1 K 0 part
└ ── Sda5 0 1.9G 0 part [SWAP]
Sdb 8: 16 0 20G 0 disk
─ ── Sdb1 0 15.5G 0 part/mnt/lfs
└ ── Sdb2 0 4.5G 0 part
Sr0 :0 1 222 M 0 rom/media/cdrom0
Note:
The following commands are executed in the chroot environment of LFS 7.7.
// Install grub to the second hard disk. After setting this option, you need to modify the BIOS settings so that the disk can be started from the second hard disk at startup.
Grub-install/dev/sdb
// Use steps in 8.4.4 to generate the/boot/grub. cfg file
Cat>/boot/grub. cfg <"EOF"
# Begin/boot/grub. cfg
Set default = 0
Set timeout = 5
Insmod ext2
Set root = (hd0, 2)
Menuentry "GNU/Linux, Linux 3.19-lfs-7.7 "{
Linux
/Boot/vmlinuz-3.19-lfs-7.7 root =/dev/sda2 ro
}
EOF
Then, use grub-mkconfig-o/boot/grub. cfg to automatically generate the grub environment and overwrite it.
// Here, sdb1 of the second hard disk is used as the primary partition, sdb2 is used as the swap partition, and sda1 and sda2 of fstab are modified.
# Begin/etc/fstab
# File system mount-point type options dump fsck
# Order
/Dev/sda1/ext4 defaults 1 1
/Dev/sda2 swap pri = 1 0 0
Proc/proc nosuid, noexec, nodev 0 0
Sysfs/sys sysfs nosuid, noexec, nodev 0 0
Devpts/dev/pts devpts gid = 5, mode = 620 0 0
Tmpfs/run tmpfs defaults 0 0
Devtmpfs/dev devtmpfs mode = 0755, nosuid 0 0
# End/etc/fstab
Perform other steps in the LFS 7.7 document. 55