zl程序教程

您现在的位置是:首页 >  工具

当前栏目

LFS学习系列3 — 前言

学习 系列 LFS 前言
2023-09-14 09:09:19 时间

从本章开始一个一个章节依次进行详解。最开始是前言部分。

前言部分内容如下:

1. Foreword(前言)

我的学习和更好地理解Linux的旅程始于1998年。我刚刚安装了我的第一个Linux发行版并且很快被Linux背后的整体概念和哲学迷住了。

完成一项任务总是有很多方法。Linux发行版也是如此。这些年曾出现过很发行版。有些仍然存在,有些已经变成了别的东西,而有些已经只存在于我们的记忆中了。它们都做不懂得事情以满足其目标受众的需求。因为有如此多的方法来完成同样的最终目标,我开始认识到我不再必须局限于任何一种实现。在发现Linux之前,我们只得忍受问题因为没有别的选择。事情就是这样,不论你喜欢它与否。但在Linux中,选择的概念开始浮现。如果你不喜欢某些东西,你是自由的,甚至是被鼓励的去替换它。

我尝试了许多发行版并且不能哪个更好。它们依靠自身的实力都是伟大的系统。这不再是对与错的问题了。已经成为了个人品味的问题。由于有了所有的选择,显然对我来说不会有单一的系统是完美的。所以我着手建立我自己的、完全符合我的个人喜好Linux系统。

To truly make it my own system, I resolved to compile everything from source code instead of using pre-compiled binary packages. This “perfect” Linux system would have the strengths of various systems without their perceived weaknesses. At first, the idea was rather daunting. I remained committed to the idea that such a system could be built.

After sorting through issues such as circular dependencies and compile-time errors, I finally built a custom-built Linux system. It was fully operational and perfectly usable like any of the other Linux systems out there at the time. But it was my own creation. It was very satisfying to have put together such a system myself. The only thing better would have been to create each piece of software myself. This was the next best thing.

As I shared my goals and experiences with other members of the Linux community, it became apparent that there was a sustained interest in these ideas. It quickly became plain that such custom-built Linux systems serve not only to meet user specific requirements, but also serve as an ideal learning opportunity for programmers and system administrators to enhance their (existing) Linux skills. Out of this broadened interest, the Linux From Scratch Project was born.

This Linux From Scratch book is the central core around that project. It provides the background and instructions necessary for you to design and build your own system. While this book provides a template that will result in a correctly working system, you are free to alter the instructions to suit yourself, which is, in part, an important part of this project. You remain in control; we just lend a helping hand to get you started on your own journey.

I sincerely hope you will have a great time working on your own Linux From Scratch system and enjoy the numerous benefits of having a system that is truly your own.

--
Gerard Beekmans
gerard@linuxfromscratch.org

2. 受众

There are many reasons why you would want to read this book. One of the questions many people raise is, “why go through all the hassle of manually building a Linux system from scratch when you can just download and install an existing one?”

One important reason for this project's existence is to help you learn how a Linux system works from the inside out. Building an LFS system helps demonstrate what makes Linux tick, and how things work together and depend on each other. One of the best things that this learning experience can provide is the ability to customize a Linux system to suit your own unique needs.

Another key benefit of LFS is that it allows you to have more control over the system without relying on someone else's Linux implementation. With LFS, you are in the driver's seat and dictate every aspect of the system.

LFS allows you to create very compact Linux systems. When installing regular distributions, you are often forced to install a great many programs which are probably never used or understood. These programs waste resources. You may argue that with today's hard drive and CPUs, such resources are no longer a consideration. Sometimes, however, you are still constrained by size considerations if nothing else. Think about bootable CDs, USB sticks, and embedded systems. Those are areas where LFS can be beneficial.

自定义构建的Linux系统的另一个优点是安全。通过从源码编译完整的系统,你被授权审计每件事物并且应用所需的所有安全补丁。不再必需等待其他人编译修复安全漏洞的二进制包。除非你亲自检查和实现补丁,否则你不能保证新的二进制包被正确编译并且完全修复了问题。

Linux Form Scratch的目标是构建一个完整的可用的地基水平的的系统。如果你不希望从零开始构建你自己的Linux系统,你仍然可以从本书的信息中受益。

有太多的其它更好的原因来构建你自己的LFS系统,以至于不能完全在此将它们列出。在最后,教育是目前为止最强的原因。当继续你的LFS经历时,你将发现信息和知识真正带来的力量。

3. LFS Target Architectures(LFS目标架构)

LFS的主要目标架构是AMD/Intel x86(32位)和x86_64(64位)CPU。另一方面,本书中的说明对于Power PC和ARM CPU做一些修改后,也是能够工作的。要构建使用这些CPU之一的系统,主要的前提,除了下一页提到的,是一个现有的Linux系统,诸如早期的LFS安装、Ubuntu、RedHat/Fedora、SUSE或其它的发行版,以已有的架构为目标。也要注意32位发行版可以被作为宿主系统安装和使用,在64位AMD/Intel的CPU上。