blackwolf
发表于 2005-8-10 08:28:56
However I'm interested to learn blackwoft's method "let the hostsystem out of your harddisk and run LFS only".How to make it.
After the kernel is builded, you must copy the bzImage & System.map to /boot of LFS system(/mnt/lfs/boot). and run /etc/grub in chroot enviroment.
grub> root (hd0,5) # But very stronger you can not do this?? :?:
grub> setup (hd0)
grub> quit
then edit the file /boot/grub/menu.lst of LFS system(/mnt/lfs/boot/grub/menu.lst) follow the LFS book. when you restart the PC, if you see a green grub menu, the grub of LFS is working and the hostsystem can be remove.
satimis
发表于 2005-8-10 09:46:02
Hi blackwolf,
Tks for your advice.
Assuming your suggestion starting on FC3, the Host.I shall perform following steps after starting FC3;
$ su
password
# export LFS=/mnt/lfs
# mount /dev/hda6 /mnt/lfs
# mkdir -p $LFS
# echo $LFS
/mnt/lfs
After the kernel is builded, you must copy the bzImage & System.map to /boot of LFS system(/mnt/lfs/boot).
# find /mnt/lfs/ -name System.map*
/mnt/lfs/sources/linux-2.6.11.12/System.map
/mnt/lfs/boot/System.map-2.6.11.12
# ls /mnt/lfs/boot/
config-2.6.11.12grublfskernel-2.6.11.12System.map-2.6.11.12System.map is already there
# find /mnt/lfs/ -name bzimage*
No output
Whether I have to run "make bzImage" ONLY on "linux-2.6.11.12" source directory to generate it also in chroot environment???
Where bzimage will be generated, in which directory???
After finish then run
# ln -s /path/to/bzimage /mnt/lfs/boot/bzimage
and run /etc/grub in chroot enviroment.
Then continue
Enter chroot environment:
New chroot in Section After 6.62. Cleaning Up
http://www.linuxfromscratch.org/lfs/view/stable/chapter06/revisedchroot.html
# /usr/sbin/chroot "$LFS" /usr/bin/env -i HOME=/root TERM="$TERM" PS1='\u:\w\$ ' PATH=/bin:/usr/bin:/sbin:/usr/sbin /bin/bash --login
then run
# /etc/grub
and editgrub> root (hd0,5) [ENTER]
grub> setup (hd0) [ENTER]
grub> quit [ENTER]
then edit the file /boot/grub/menu.lst of LFS system(/mnt/lfs/boot/grub/menu.lst) follow the LFS book.
Whether you meant following
8.4. Making the LFS System Bootable
http://www.linuxfromscratch.org/lfs/view/stable/chapter08/grub.html
Create a “menu list” file defining GRUB's boot menu:cat > /boot/grub/menu.lst << "EOF"
# Begin /boot/grub/menu.lst
# By default boot the first menu entry.
default 0
# Allow 30 seconds before booting the default.
timeout 30
# Use prettier colors.
color green/black light-green/black
# The first entry is for LFS.
title LFS 6.1
root (hd0,3)
kernel /boot/lfskernel-2.6.11.12 root=/dev/hda4
EOF(Remark: I already completed this part previously, confirmed on my Notes)
and then run "The FHS stipulates that GRUB's menu.lstfile should be symlinked to /etc/grub/menu.lst. To satisfy this requirement, issue the following command:"
mkdir /etc/grub &&
ln -s /boot/grub/menu.lst /etc/grub
when you restart the PC, if you see a green grub menu, the grub of LFS is workingHow to get back/boot to FC3, the Host afterwards.
and the hostsystem can be remove.You meant removingtitle LFS 6.1 (2.6.11.12)
root (hd0,5)
kernel /boot/lfskernel-2.6.11.12 ro root=/dev/hda6 vga=795
from /etc/grub.conf of FC3, the Host
TIA
B.R.
satimis
P.S. with the grub.img floppy I can now boot straight to LFS 6.1
blackwolf
发表于 2005-8-10 11:03:37
# ls /mnt/lfs/boot/
config-2.6.11.12grublfskernel-2.6.11.12System.map-2.6.11.12
System.map is already there
you had copied the kernel and system.map to here.
# /etc/grub
grub> root (hd0,5) [ENTER]
grub> setup (hd0) [ENTER]
grub> quit [ENTER]
Are you get any error here? if not, you are sucessed.
cat > /boot/grub/menu.lst << "EOF"
# Begin /boot/grub/menu.lst
# By default boot the first menu entry.
default 0
# Allow 30 seconds before booting the default.
timeout 30
# Use prettier colors.
color green/black light-green/black
# The first entry is for LFS.
title LFS 6.1
root (hd0,3) # you must change here to root (hd0, 5)
kernel /boot/lfskernel-2.6.11.12 root=/dev/hda4 # and here to /dev/hda6
EOF
You meant removing ...from /etc/grub.conf of FC3, the Host
you can remove the FC3 from your harddisk(remove the partition of FC3 if you want). Before you do this please make sure you can boot you PC with LFS grub (a green menu with only "LFS 6.1" when the PC startup and can get into LFS system by it).
satimis
发表于 2005-8-10 12:02:24
Hi blackwolf
you had copied the kernel and system.map to here."lfskernel-2.6.11.12System.map-2.6.11.12" are already there.I could not find another kernel.
# find /mnt/lfs/ -name kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/alpha/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/arm/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/arm26/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/cris/arch-v10/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/cris/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/frv/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/h8300/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/i386/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/ia64/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/ia64/sn/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/m32r/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/m68k/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/m68knommu/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/mips/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/parisc/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/ppc/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/ppc64/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/s390/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/sh/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/sh64/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/sparc/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/sparc64/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/um/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/v850/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/x86_64/kernel
/mnt/lfs/sources/linux-2.6.11.12/kernel
/mnt/lfs/lib/modules/2.6.11.12/kernel
# find /mnt/lfs/ -name kernel -type d
/mnt/lfs/sources/linux-2.6.11.12/arch/alpha/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/arm/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/arm26/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/cris/arch-v10/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/cris/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/frv/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/h8300/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/i386/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/ia64/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/ia64/sn/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/m32r/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/m68k/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/m68knommu/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/mips/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/parisc/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/ppc/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/ppc64/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/s390/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/sh/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/sh64/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/sparc/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/sparc64/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/um/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/v850/kernel
/mnt/lfs/sources/linux-2.6.11.12/arch/x86_64/kernel
/mnt/lfs/sources/linux-2.6.11.12/kernel
/mnt/lfs/lib/modules/2.6.11.12/kernel
They are all directories.Do I need symbolic linking bzimage to /mnt/lfs/boot/bzimage ???
# /etc/grub
grub> root (hd0,5) [ENTER]
grub> setup (hd0) [ENTER]
grub> quit [ENTER]
Are you get any error here? if not, you are sucessed.Yes, there was errorgrub> root (hd0,5)
Error 21: Selected disk does not exist
grub> setup (hd0)
Error 12: Invalid device requested
grub> quitI suggested to re-run these commands on "chroot environment" on my previous posting.
others noted with thanks.
My concern is how to get back to boot FC3 after the test???
TIA
B.R.
satimis
linky_fan
发表于 2005-8-10 19:21:40
Could you please explain further what is it.
1, Install the grub
http://www.linuxfromscratch.org/lfs/view/stable/chapter06/grub.html
2, Config the menu.lst
http://www.linuxfromscratch.org/lfs/view/stable/chapter08/grub.html
In my case , i just install the grub of lfs into the partition's mbr(hd0,x) not the mainmbr(hd0), and use the chainloader to switch the lfs's grub that is installed in the (hd0,x).
If you want to use the grub of lfs , just install to the main mbr, and finish the
menu.lst. that's all.8)