Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Linux From Scratch This 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.


  Search this Thread
Old 08-13-2009, 03:27 PM   #1
Registered: May 2009
Posts: 255

Rep: Reputation: 23
Make LFS smaller???? O.o

I made just a very basic LFS system that consisted of just the bash shell but the whole thing ended up taking up 500MB of space.

On the website it stated that you could easily get it to be under 100MB of space but I am really confused on how you would do that.

I am going to make another LFS system that just has the VERY basic bash tools I need for a system recovery and remove the compiling tools such as GCC.


I think the reason why It was so big was because I forgot to remove the tools directory and all the sources and their uncompressed directories but I am not really sure....

How do you strip out the debugging symbols from all packages? That would certainly make it smaller!

I still don't quite understand the point of chapter 5.

Last edited by David2010; 08-13-2009 at 06:32 PM.
Old 08-14-2009, 12:58 PM   #2
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You can use binutil's strip command to remove symbols from library files and programs.

If you have the development environment & the source files installed or mounted on the target that might account for the size. Do you build packages while chroot'ed in the blfs system, or do you compile packages from you main system? If you run "mount --bind" or "mount --make-shared" to bind directories for your include files, etc. to under the blfs root directory, maybe you just need to unmount them before creating an image.
Old 09-09-2009, 03:13 PM   #3
Registered: Oct 2006
Location: UK
Distribution: Vista, Gentoo
Posts: 61

Rep: Reputation: 15
Originally Posted by David2010 View Post

I still don't quite understand the point of chapter 5.
The way you kidna create the system is as follows:

Use a forgeign (one from your live cd) compiler to dump a fresh binary on your hdd of the compiler and libraries and basic tools.

Use these basic tools to compile a few more basic tools and a new compiler all set up to use fresh libraries. This is chapter 5. So all you have done is make a nice, clean compiler and a few tools, all of which use nice clean libraries, fairly specific to your hardware set up. Everything here is pretty self contained to $LFS/tools, so all binaries are expecting libriaries to be some sub directory of $LFS/tools.

You then, use that lot, to reinstall everything with the correct paths (ie /bin, /etc, /lib) rather than links hardwired inside the binaries in Chapter 5. What you are left with is a clean copy of everything, your compiler has been made just for you on your own hardware using a compiler that has been made for your hardware.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to make the zipper log smaller automatically? gingis55 SUSE / openSUSE 1 04-30-2009 03:32 AM
How can I make text smaller in console? nflenz Linux - General 5 02-09-2006 08:45 AM
make mpg file size smaller secretlydead Linux - Software 2 02-14-2005 09:42 AM
How do you make C++ programs smaller? Qwirt Programming 5 11-05-2004 12:32 AM
2.6.0-test9 kernel is 4mb, need to make smaller icyfire Linux - General 7 11-30-2003 04:14 PM > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 08:06 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration