Learning from others: using LFS to build Linux from scratch

Source: Internet
Author: User
Tags uncompress

Marco is ill ~ When I thought I could take a day off, a new task came, and this time it was a real task, a project!

He asked us to use LFS to build a complete Linux environment from scratch ~

Of course, it is not created for no reason, but for reference by othersArticle:

Leopard's [original] Second Edition teaches you how to build your own Linux System

This article details how to build an operating system from only one machine to a complete one. The whole process can be said to be self-built, and all the software packages must be installed on their own.

The material of these software packages has a CD ready for us, that is, livecd (click to download)

As a result, when we are about to stop, start our own virtual machine and start our LFS Linux journey.

Ma Ge said: it is actually very simple to do this, but it has a large amount of work, many commands, and complicated. As long as you are careful, you can do it.

Based on my own eye-catching advantages, I began to get started after I roughly browsed the author's full text and understood what he meant ~

All the way to create, compile, make, and delete.

When I wrote half of it, I finally understood why Marco asked us to do this without any technical content. It was a work that I could do as long as I was careful.

There is a saying that good memory is worse than bad writing.

Marco hopes that we can use this method to enhance our understanding of Linux commands over and over again.

Maybe we don't know what it represents when hitting this command, what will it do, and what it means when it comes to parameters. However, when we need to install it numerous times. I naturally wrote down the important commands:

One by one, the most frequently used commands

 
Tar xvf filesname # This is the command to uncompress. You can decompress and uncompress A. tar file that has been directly packaged and compressed by bz2 or gzip. For our use .. /Configure # This is when defining the configuration information of a software, there are also common parameters such as: -- prefix = dir definition installation directory -- bindir = dir specifies the installation location of the binary file. the binary file is defined as one that can be directly executed by the user.Program. -- Sbindir = dir specifies the installation location of the Super binary file. this is a program that can only be executed by Super Users. -- libexecdir = dir specifies the installation location of executable support files. in contrast to binary files, these files are never directly executed by users, but can be executed by the binary files mentioned above. -- libdir = dir specifies the installation location of the library file. -- Program-Prefix = prefix specifies the prefix that will be added to the name of the installed program.

Then I learned a lot of advanced usage by the author, such:

Sed we all know that SED has the s option to find and replace. The S Delimiter is "/XXX1/xxx2/", which is separated by a slash. But the author showed me other

For example, if "@" is used and "|" is used, "%" is used for separation,

Sed-I "s | htmldir = @ htmldir @ | htmldir =/usr/share/doc/bash-3.2 |" makefile. insed-I's @ tests @ & </dev/tty @ 'tests/run-testsed-I's ,\*_\*,??, 'Man/makefile. insed-I-e '\ % \ t/usr/man % d'-e' \ % \ t/usr/local/man % d' src/man_db.conf.in

In addition, when a command is too long to affect the appearance, you can use "\" to escape the following space to reach the branch and enter a command.

For example:

 
. /Configure -- prefix =/usr -- libexecdir =/usr/sbin \ -- sysconfdir =/etc -- localstatedir =/var \ -- disable-ifconfig -- disable-logger -- disable-syslogd \-- disable-Whois -- disable-servers

When you tap on these commands, it is not only a test of your patience and carefulness, but also an improvement in your programming ideas.

Learn from others' advanced command Application Experience and perfect user experience. This also shows a person's quality level through the language of the program.

In the end, following the guidance of leopard brother, after I did it again due to my carelessness, I ushered in a simple but festive Linux welcome interface.


In conclusion, it took 18 hours to create a snapshot volume, nearly 15 snapshot volumes, and nearly a thousand lines of commands. I finally got everything done at a.m. on April 9, August 11. That exciting mood !!!! It cannot be expressed in words!

After this LFS creation tour, I found that as long as I worked hard, worked hard, and persistently toward my own goals, I would eventually win!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.