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 have decided to try to build my own Linux from scratch. I have two hard drives, the main (40G) has MDK 9.1 on it. The slave (8G) has three partitions. I followed the instructions to set up the partitions and the mount points and directories as it said in the 4.1 book on LFS' s website. . I can see /mnt/lfs/static on hdb1, as well as two more files "lost+found" and "usr" on hdb6
Now, I downloaded all the packages into the /home/ray/Downloads directory of my main HD. I tar xvfz the Bash 2.0.5a file, cd into it, and did ./configure, with all the tags that the book said. But, when I look into the /mnt/lfs/static directory, there is nothing there. Do I need to copy all the downloaded files over to the second hd, in order to install the LFS on that drive?
The configure worked okay, but I'm a bit nervous about what I really did. My present bash on the main drive is still 2.0.5b.
Thanks for all your help. I am really excited about doing this, and I know it there are going to be headaches and hairpulling, but that's how you learn. I searched their mailing list and this one, and couldn't find any help on this.
make sure that your $LFS environment variable is set up:
echo $LFS
/mnt/lfs
if '/mnt/lfs' is the output, then using '--prefix=$LFS/static' will cause all of the packages to be installed in /mnt/lfs/static when you do 'make install'
You are going to need the packages to be within the $LFS branch of your filesystem when you get to chapter 6... you can move them now or later.
Thank you so much for replying. I discovered that everytime I open a bash shell, I must type "LFS=/mnt/lfs" in order for the output of "echo $LFS" to be that. Not knowing this, I worked on installing bash and binutils last night, and lo and behold, they were in /static on my main HD. So, I moved it to /mnt/lfs, and moved all the downloaded files to /mnt/lfs. now, things are kosher, I think.
Thanks again.
Well, I got stuck trying to do grep. I don't remember the error. I went back, and redid everything according to the pure LFS hints. Got to configuring gcc, and got this error:
"Configuring for a i686-pc-linux-gnu host.
Created "Makefile" in /mnt/lfs/Donwloads/gcc-build using "mt-frag"
../gcc-3.2.1/configure: line 7: gcc-s command not found
*** The command 'gcc-s -o conftest -O (that's letter "O" ?)2 -pipi -s conftest.c' failed
*** you must set the environment variable CC to a working compiler"
I have had no problems before this latest run, except while doing the binutils, I kept getting this statement, "-02 unrecognizable command"
That looks to me like something might have went screwey when you installed the gcc compiler. try this:
ldd $LFS/static/bin/gcc
That will list the shared libraries that your gcc binary is using. There shouldnt 't be anything there
(you go through all of ch.5 just so you can build all those utilities statically... that is... they don't use anything else)
then you gotta go back and do ch.5 again... sorry
(make sure that you do all of the appropriate '--enable-static' type stuff )
If that isn't the problem, the only other thing I can think of is that maybe you didn't delete your old source directory and start over with fesh sources (unpack a fresh <package>.tar.bz2 every time you compile)
.... All I could think of
good luck!
EDIT:
ps- put this line in your ~/.bash_profile so that the $LFS environment variable is always on:
It didn't show anything. I may have not deleted all the directories. So, I guess it's back to the beginning. I was thinking of downloading the latest and greatest of all the files, instead of the ones suggested. I guess that might bring other problems. I'm not sure I'm ready for this, having been using Linux for 5 months. There is a lot I still don't understand. Me thinks me in over me head. All this enable and disable and nls and other stuff I have no idea of, and that means I am not ready for this.I read through BLFS, and it looks at the least daunting installing a GUI.
I'll keep learning, and come back to it. I want to thank you very much for your help.
Maybe I will take on recompiling a kernel.
With my experience in all this stuff, that's pretty much what it takes to figure it all out....
1) try to install
2) if install fails, learn from mistakes and go to #1
3) MONEY
you'll learn something new every time the GOD DAMM THING WON'T WORK... ooh sorry .. I mean...... you'll see
Last suggestion:
Download the tar file that has all of the packages in it (I think its lfs-packages<version>.tar). Get the same version that your book is. unpack the tar somewhere in $LFS (I use $LFS/usr/src/sources). unpack each package one-by-one as you build it, and delete (rm -r) the directory when you finish that package (keep the tar.bz2 file).
LFS is like boot camp... dirty, unforgiving hard work. when you graduate to BLFS, you'll be ready for whatever gets thrown at you (that's when the fun starts
I have pretty much finished chapter 5, following it and trying to do the pure lfs alongside, that is, doing 4.1 as instructed, except where pure LFS has other instructions.
Now, pure LFS has instructions about installing kernel headers, glibc, tld and others. Which file is teh kernel headers?
Thanks
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.