CLFS就是交叉编译的LFS——LFS又是什么?一个指导 你一步一步,完全从源代码级编译出整个按照你定制要求的Linux系统的项目。
令人不解的,有许多现成的Linux distro让我们下载了,为什么还要从零构建一个Linux?这常常引起人们的争论。事实上,构建CLFS还是有它的益处的 :
1、CLFS可以教会人们如何构造一个交叉编译器,比如你可以在x86的机器上构建出一套sparc工具链,然后利用这套工具链有可以从源代码级 生成一个Linux系统;
2、CLFS可以教会人们如何使用多库共存的系统,充分挖掘目标系统的潜力;
3、CLFS可以告诉人们Linux系统内部是如何工作的,它 的每一次滴答运行,它们是如何相互依赖的,从而就知道如何定制适合你的口味的系统!
4、CLFS可以生成 一个紧凑的系统,而在一般distro发行版本中有很多程序你可能从来不会用到,白白浪费磁盘空间;
5、CLFS可以从大多数Unix类系统开始构建,甚至是非Unix系统!
6、CLFS是高度可定制的,这正如装修房子,CLFS只是给出一个轮廓框架,而水管、电线布局、厨房、浴室设施等等完全由你决定;
7、CLFS可以提供额外的安全性,有人可能会在编译阶段便把某个安全代码补丁加入到系统中,而不用等到别人给出二进制补丁包
What is Cross linux From Scratch? ¶
Cross linux From Scratch (CLFS) is a project that provides you with step-by-step instructions for building your own customized linux system entirely from source.
Why would I want a CLFS system? ¶
Many wonder why they should go through the hassle of building a linux system from scratch when they could just download an existing linux distribution. However, there are several benefits of building CLFS. Consider the following:
CLFS teaches people how to build a cross compiler
Building CLFS teaches you how to make a cross-compiler and the necessary tools, to build a basic system on a different architecture. For example you would be able to build a Sparc toolchain on an x86 machine, and utilize that toolchain to build a linux system from source code.
CLFS teaches people how to utilize a multilib system
CLFS takes advantage of the target system's capability, by utilizing a multilib capable build system.
CLFS teaches people how a linux system works internally
Building CLFS teaches you about all that makes linux tick, how things work together and depend on each other. And most importantly, how to customize it to your own tastes and needs.
Building CLFS produces a very compact linux system
When you install a regular distribution, you often end up installing a lot of programs that you would probably never use. They're just sitting there taking up (precious) disk space.
CLFS can be built from most Unix Style Operating Systems
You can build CLFS even if you don't have linux running. Our build instructions have been tested to build from Solaris and the BSDs.
CLFS is extremely flexible
Building CLFS could be compared to a finished house. CLFS will give you the skeleton of a house, but it's up to you to install plumbing, electrical outlets, kitchen, bath, wallpaper, etc. You have the ability to turn it into whatever type of system you need it to be, customized completely for you.
CLFS offers you added security
You will compile the entire system from source, thus allowing you to audit everything, if you wish to do so, and apply all the security patches you want or need to apply. You don't have to wait for someone else to provide a new binary package that (hopefully) fixes a security hole. Often, you never truly know whether a security hole is fixed or not unless you do it yourself.
What can I do with my CLFS system? ¶
A by-the-book CLFS system is fairly minimal, but is designed to provide a strong base on which you can add any packages you want. See the BLFS project for a selection of commonly used packages.