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.
I want to create a minimal LFS project, that is composed of Grub, Bash and Kernel. I have already dual-booted my laptop with Windows 7 and Linux Ubuntu. So I have 4 primary partitions, from which first two are for Windows 7 and the other one is for Ubuntu. I also have another primary extended partition, in which I have 3 other partitions, one swap for Linux, and two other with 1GB (sda6) and 4GB (sda7) free spaces, which are both ext3.
I downloaded bash-4.2 and linux-3.5.2. I put them in /usr/src, I did "./configure", "make", "make install" to bash, and then finally "ln -vs bash /mnt/lfs/bin" (please note that all my files and directories for LFS are located in my /mnt/lfs directory). Then I checked the libraries for bash using "ldd ./bash", and also copied them to /mnt/lfs/lib directory. Then I configured my kernel, and created a bzImage. Then I moved and renamed my .config file and bzImage to /mnt/lfs/boot and named them .config-3.5.2 and vmlinuz-3.5.2-lfs-7.2 respectively. Because I already have my grub under /boot/grub in my original Linux Ubuntu, I just edited that grub.cfg file and included those lines:
menuentry 'GNU/Linux, Linux 3.5.2-lfs-7.2' {
set default=0
set timeout=5
insmod part_msdos
insmod ntfs
insmod ext2
set root='(hd0,msdos6)'
echo 'Loading LFS...'
linux /boot/vmlinuz-3.5.2-lfs-7.2 root=/dev/sda6 rootdelay=7
}
Please note that I want to mount my LFS project to my 1GB ext3 partition, which is my /dev/sda6 partition. Finally I mounted my partition using those commands:
And when I restarted my laptop, I had my new menuentry under my Grub. But the point is that when I try to boot from it, I get the following things:
Loading LFS...
error: file not found
If someone can tell me what can be the problem, and how can I fix it with step by step guide I would be glad, while I'm not very much experienced in Linux.
To create minimal lfs you need to use the tools from host to build the tools necessary to build lfs. http://www.linuxfromscratch.org/lfs/view/6.5/index.html
Are sda6 & 7 empty?
If so you can join them to have more room to work.
Thanks for the link. I think I have all the dependencies in my host machine. If you could tell me what can be the problem in my instance I would be glad.
To me, that "file not found" message means just what it says. IMO, the grub.cfg file is misconfigured for the partition or has some other typo. But when you fix that, it will be interesting to see if this thing you created is capable of booting and running.
I also noticed that it is some kind of grub configuration error. But I cannot solve it. When I mount my /dev/sda6 to /mnt/lfs, and type "mount" command, it shows that it is mounted, but if I restart my laptop, and log in again in my host Linux system and if I type "mount" command again in terminal it doesn't show that it is mounted. On the other hand, I just want to have bash, grub and kernel, the only thing that it should do is load the kernel without any kernel panic and that's all, no commands should work nothing else, just a bootable simples possible kernel.
I managed to solve it, I just needed to do some changes in /etc/fstab file. Now it boots up, I don't get any kernel panic, the only thing that I get is:
sh: canno set terminal process group(-1): Inappropriate ioctl for device
sh: no job control in this shell
And then I'm on bash, and ready to write things, but of course I don't have any working commands now.
Did you do all of the steps in building system or did you just put kernel in partition?
If you didn't do all of the steps in the book you won't have a running system.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.