Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 204800 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2 26 7715 61760512 7 HPFS/NTFS
/dev/sda3 7715 26167 148212736 5 Extended
/dev/sda4 26167 38914 102391808 83 Linux
/dev/sda5 9044 22160 105355264 7 HPFS/NTFS
/dev/sda6 22160 26167 32183296 7 HPFS/NTFS
/dev/sda7 7715 9044 10671104 83 Linux
Partition table entries are not in disk order
cot@boss:~$
I builded my LFS at /dev/sda7, You may note that I has no seperate partition for /boot or anything for /swap etc
FYI my laptop is already dual bootable holds windows 7 and Linux earlier..but now I am trying to add one more os (LFS)...
and from my host /etc/fstab is
cot@boss:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'vol_id --uuid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# / was on /dev/sda7 during installation
UUID=ece89103-0538-45dc-82ab-5014e9ed9798 / ext3 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=7170833c-376c-4620-a234-3f9fd309887b none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/scd1 /media/cdrom1 udf,iso9660 user,noauto 0 0
cot@boss:~$
and inside my LFS /etc/fstab is
root:/# cat /etc/fstab
# Begin /etc/fstab
# file system mount-point type options dump fsck
# order
cot@boss:~$ cat /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
insmod part_msdos
insmod ext2
set root='(hd0,msdos4)'
search --no-floppy --fs-uuid --set 348b3406-e11c-4fa9-ac4b-fdc5cc7ccb20
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos4)'
search --no-floppy --fs-uuid --set 348b3406-e11c-4fa9-ac4b-fdc5cc7ccb20
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
set timeout=5
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_msdos
insmod ext2
set root='(hd0,msdos4)'
search --no-floppy --fs-uuid --set 348b3406-e11c-4fa9-ac4b-fdc5cc7ccb20
insmod png
if background_image /usr/share/images/desktop-base/boss-grub.png ; then
set color_normal=black/black
set color_highlight=white/black
else
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
fi
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'BOSS GNU/Linux, with Linux 3.7.8-pimpi3' --class boss --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos4)'
search --no-floppy --fs-uuid --set 348b3406-e11c-4fa9-ac4b-fdc5cc7ccb20
echo 'Loading Linux 3.7.8-pimpi3 ...'
linux /boot/vmlinuz-3.7.8-pimpi3 root=UUID=348b3406-e11c-4fa9-ac4b-fdc5cc7ccb20 ro splash vga=791 quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.7.8-pimpi3
}
menuentry 'BOSS GNU/Linux, with Linux 3.7.8-pimpi3.old' --class boss --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos4)'
search --no-floppy --fs-uuid --set 348b3406-e11c-4fa9-ac4b-fdc5cc7ccb20
echo 'Loading Linux 3.7.8-pimpi3.old ...'
linux /boot/vmlinuz-3.7.8-pimpi3.old root=UUID=348b3406-e11c-4fa9-ac4b-fdc5cc7ccb20 ro splash vga=791 quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.7.8-pimpi3
}
menuentry 'BOSS GNU/Linux, with Linux 2.6.39-bpo.2-686-pae' --class boss --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos4)'
search --no-floppy --fs-uuid --set 348b3406-e11c-4fa9-ac4b-fdc5cc7ccb20
echo 'Loading Linux 2.6.39-bpo.2-686-pae ...'
linux /boot/vmlinuz-2.6.39-bpo.2-686-pae root=UUID=348b3406-e11c-4fa9-ac4b-fdc5cc7ccb20 ro splash vga=791 quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.39-bpo.2-686-pae
}
menuentry 'BOSS GNU/Linux, with Linux 2.6.32-5-686' --class boss --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos4)'
search --no-floppy --fs-uuid --set 348b3406-e11c-4fa9-ac4b-fdc5cc7ccb20
echo 'Loading Linux 2.6.32-5-686 ...'
linux /boot/vmlinuz-2.6.32-5-686 root=UUID=348b3406-e11c-4fa9-ac4b-fdc5cc7ccb20 ro splash vga=791 quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-5-686
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/30_otheros ###
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
menuentry "Windows Vista (loader)" {
set root=(/dev/sda,msdos1)
search --no-floppy --fs-uuid --set daeecc96eecc6c77
chainloader +1
}
### END /etc/grub.d/30_otheros ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
cot@boss:~$
As directed in LFS book, I created a seperate file /boot/grub/grub.cfg inside LFS partition as follows
root:/# cat /boot/grub/grub.cfg
# Begin /boot/grub/grub.cfg
set default=0
set timeout=5
insmod ext2
set root=(hd0,7)
menuentry "GNU/Linux, Linux 3.7.9-lfs-7.3-rc1" {
linux /boot/vmlinuz-3.7.9-lfs-7.3-rc1 root=/dev/sda7 ro
}
EOF
root:/#
I don't see a menuentry for your LFS system anywhere in that.
Quote:
Originally Posted by smdaudhilbe
As directed in LFS book, I created a seperate file /boot/grub/grub.cfg inside LFS partition as follows
That looks okay, but it really isn't doing anything since your host's GRUB is doing the boot loader chores.
Quote:
Originally Posted by smdaudhilbe
I think I may need to work on host side, so that it may find my LFS
I agree with that idea. For now I would continue to let the host's GRUB boot everything so that no matter what happens you still can boot your host and Windows. It's the safe and wise thing to do at this time, IMO. After all, you don't even know if your LFS system is capable of booting yet. You need somehow to get an entry for LFS in your host's GRUB boot menu. I guess you've tried the obvious thing: the update-grub command in the host. The other common option is to type manually an entry for the LFS system in the host's /etc/grub.d/40_custom file. It's what that file is for. I would try entering the following in your host's /etc/grub.d/40_custom file and then run update-grub in the host. Reboot and see if you have LFS in your host's GRUB boot menu.
Code:
menuentry "GNU/Linux, Linux 3.7.9-lfs-7.3-rc1" {
insmod ext2
set root=(hd0,7)
linux /boot/vmlinuz-3.7.9-lfs-7.3-rc1 root=/dev/sda7 ro
}
No promises, but it's harmless, reversible, and worth a try.
Quote:
Originally Posted by smdaudhilbe
LFS book suggests one more way to create a seperate partiton for boot...If do that I think I may lose everything what I have now..?
IMO, a separate boot partition would solve nothing about any of this.
Did you read the whole thread you linked to? The problem in that thread was a missing # in fstab.
Code:
# Begin /etc/fstab
# filesystem mount-point type options dump fsck
order
'fsck order' was split to 2 lines, therefore it needs a # on the line which says 'order'.
Don't worry about the output of 'ls -l /lib/libncurses.so.5 /lib/libdl.so.2 /lib/libc.so.6' not showing '/bin/bash'. It's not supposed to. With that command you only tell it to list those files you added to the command. If you want to see '/bin/bash' you can run 'ls -l /bin/bash'.
Try checking for a space character at the end of that line for root. In other words, make sure yours is "root:x:0:0:root:/root:/bin/bash" and not "root:x:0:0:root:/root:/bin/bash ".
No promises, but I think that's happened before around here. It would be an easy mistake to make (in chapter 6.6), and difficult to detect unless you actually look for it. Anyway, no harm to find out.
Does /bin/bash work in chroot? You can get this error 'cannot execute /bin/bash : No such file or directory' if some of the shared libraries bash needs are missing.
From your host system run:
Code:
cd /mnt/lfs # or whatever mountpoint you use
ldd bin/bash # note there is no starting / before bin/bash
And for all results you get run 'ls -l' (lowercase L) excluding the starting / to see if it is there on your lfs system. Those libraries that are shown in the output of 'ldd' is from your host.
For exampel:
Code:
ls -l lib/libreadline.so.6
ls -l lib/libhistory.so.6
# ... and so on
You are great as per your suggesstion, I saw fault with my /etc/passwd, it was "root:x:0:0:root:/root:/bin/bash " I changed it to "root:x:0:0:root:/root:/bin/bash"....You know my LFS works fine now...
But only thing, I wrongly configured my /etc/sysconfig/console, since I'm unable to enter any symbols like ;:'"{})(_-+/ etc.. inside my vim editor..
what ever my LFS works...I feel very very happy...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.