LFS 7.6
System Configuration and Bootscripts
宿主ubuntu /dev/sda2 /
/dev/sda1 /boot
目标机 LFS /dev/sda7 /
1. 新建宿主ubuntu系统时单独分区200M /dev/sda1作为 /boot分区,考虑到执行grub-install /dev/sda命令可能会将宿主ubuntu的boot loader覆盖掉,这样会导致无法进入ubuntu系统。所以不执行此条命令。
2.修改宿主ubuntu的/boot/grub/grub.cfg文件为
# Begin /boot/grub/grub.cfg
set default=0
set timeout=10
insmod ext2
set root=(hd0,7)
menuentry "GNU/Linux, Linux 3.16.2-lfs-7.6" {
linux /boot/vmlinuz-3.16.2-lfs-7.6 root=/dev/sda7 ro
}
menuentry 'Ubuntu' {
set root=(hd0,1)
linux /vmlinuz-3.13.0-43-generic root=/dev/sda2 ro
initrd /initrd.img-3.13.0-43-generic
}
3. 在宿主环境下,复制 LFS 的 /boot/* 到 宿主 unbunt