CentOS7.2下编译LFS7.10前期准备

CentOS7.2下编译LFS7.10前期准备

本文以windows 64位下用虚拟机安装CentOS7.2 mininal 1511版本为起点

1- 系统准备

在windows 64位系统安装vmware workstation Pro 12,然后在虚拟机里面安装CentOS 7.2 1511 minimal版本。

因为LFS编译需要输入很多命令,最好使用putty/xshell等终端工具连接CentOS7。

保持Centos7和终端工具一直开启和连接状态,免得在继续的时候需重新配置LFS的特定环境。

建议机器的主机内存在8G以上,CPU核心在8核心以上,CPU配置越高越好。

虚拟机CentOS7内存在4G以上,CPU核心在8核以上,可大幅加快编译的时间。

2- 依赖准备

CentOS7.2 minimal安装后,再做如下配置:

    yum update -y  #升级到最新版本
    reboot #重启
    yum groupinstall "Development Tools" -y
    yum install texinfo -y

安装后,即可满足lfs7.10的要求。

3- 源码下载

wgetlist里面包含的80个文件下载不是那么容易,sourceforge.net网站上的需要用wget或者浏览器下载。

其他的可以用迅雷下载,但是要注意后缀名字,部分文件后缀可能会变化,需要手动更改回去。

下载完成后一定要和md5sum文件进行对比,确保下载的文件没有问题。

在windows的文件下载完成后,可以用xshell连接Centos7,在Centos7里面安装lrzsz

    yum -y install lrzsz

即可使用zmodem协议直接把这些windows里面的文件拖动到xshell,即可传输到centos7里面。

4- 重要说明

LFS7.10暂时没有中文文档,如需编译只能看官方的英文文档,不会英文的可以多查查字典,坚持下去可很大的提高阅读英文IT文档的能力。

官方的文档有个重要的说明:

To re-emphasize the build process:

1.Place all the sources and patches in a directory that will be accessible from the chroot environment  such as /mnt/lfs/sources/. Do not put sources in /mnt/lfs/tools/.

 (把源文件放到/mnt/lfs/sources/)

2.Change to the sources directory. 

(cd  /mnt/lfs/sources)

3.For each package:  

(这一个说明很重要,因为官方教程的每一个小节前后省略了这些步骤对应命令)

a. Using the tar program,extract the package to be built. In Chapter 5,ensure you are the lfs user  when extracting the package.  

(每一个小节,编译之前,都需要使用tar xvf  源文件名命令解压到文件夹。在第五章,解压的时候确保使用lfs用户。)
(例如:tar xvf acl-2.2.52.src.tar.gz)

b.Change to the directory created when the package was extracted.

(进入到源代码文件夹,例如cd acl-2.2.52)

c. Follow the book's instructions for building the package.

(根据这本书的指令进行操作)

d.Change back to the sources directory.

(指令运行完后,回到源代码文件夹)

e. Delete the extracted source directory unless instructed otherwise.

(如果没有其他说明,那么就删除解压出来的源代码文件夹)
(例如:rm -rf acl-2.2.52)

参考资料
[1].http://www.linuxfromscratch.org/lfs/downloads/7.10/LFS-BOOK-7.10-NOCHUNKS.html

相关文章

linux下开机自启: 在/etc/init.d目录下新建文件elasticsear...
1、因为在centos7中/etc/rc.d/rc.local的权限被降低了,所以...
最简单的查看方法可以使用ls -ll、ls-lh命令进行查看,当使用...
ASP.NET Core应用程序发布linux在shell中运行是正常的。可一...
设置时区(CentOS 7) 先执行命令timedatectl status|grep &...
vim /etc/sysconfig/network-scripts/ifcfg-eth0 B...