自已动手编译Linux系统-基于ALFS的LFS8.0实践(三)

来源:互联网 发布:js小写转化为大写 编辑:程序博客网 时间:2024/05/21 08:40

1.    安装LFS BOOKALFS以及设置工作路径

1.1.   安装LFS BOOK

事实上,ALFS会从SVN服务器上根据设置书标签下载,但在网络不好的精况下可以手动加载。

在其他机器上,用TortoiseSVN,从服务器上获得书本:

svn://svn.linuxfromscratch.org/LFS/tags/8.0

l 创建目录

# mkdir -v $LFS/LFSbooks

l 将书解压到$LFS/LFSbooks


l 修正packages.ent

该文件中lfs-bootscripts-20150222.tar.bz2md5值有误:


修正为:3cb3d36089f2d6ab19c7c0f3282de1c5

否则在make时会报错,该包md5有误。

1.2.   安装ALFS

l jhalfs-2.4.tar.xz拷到$LFS/sources

l 解压安装

# cd $LFS/sources

# tar -xvf jhalfs-2.4.tar.xz

# cd jhalfs-2.4

1.3.   创建编译目录

# mkdir -v$LFS/LFSBuild

2.    添加用户

2.1.   添加用户

当以root用户登录宿主机系统时,如果操作失误,那么就有可能损坏宿主机系统。因此,需创建一个专用于编译LFS源码包的无特权用户。

l root用户权限,创建一个名为jhalfs的用户和组:

# groupadd jhalfs

# useradd -s /bin/bash -g jhalfs -m -k /dev/null jhalfs

上述命令的各个选项的意义,如下所示:

n -s /bin/bash:指定jhalfs用户默认shellbash

n -g jhalfs:将jhalfs用户添加至jhalfs组。

n -m:为jhalfs用户创建家目录。

n -k /dev/null:将文件的输入位置修改为特殊的null设备,避免从框架目录(默认为/etc/skel)中拷贝文件。

n jhalfs:指定新建用户和组的名称为jhalfs

l jhalfs用户创建登录密码:

# passwd jhalfs

注:密码为jhalfs

l /etc/sudoers

用编辑器打开该文件,在最后添加下列两行,保存。

## Allow jhalfs to run any commands anywhere

jhalfs ALL=(ALL) ALL

3.    配置编译选项

运行如下命令配置选项:

# make

3.1.   LFSBOOK设置

l Book Settings


l Release(SVN)


l Work Copy


l 输入路径:/mnt/lfs/LFSbooks


3.2.   GeneralSettings


3.2.1. BuildDirectory


注意:直接设置为/mnt/lfs不被支持。

3.2.2. PackageArchive Directory


3.2.3. Rebuildfiles

选中该选项,这样在编译前会清除LFSBuild文件夹,以节约空间。


3.3.   BuildSettings


3.3.1. Runtestsuites

根据需要选中是否运行测试。


3.3.2. Createa log of installed files for each package


3.3.3. InstallVim-lang package


3.3.4. Usea custom fstab file

不选,后续手动配置。

3.3.5. Buildthe kernel

不选,后续手动编译。

3.3.6. TimeZone

设置为Asia/Shanghai

3.3.7. Installthe full set of locales

选中。



3.3.8. Language

不变或设置为zh_CN.UTF-8


如上设置为中文,需要安装第三方补丁使内核支持中文,否则会乱码。建议可以设置为:en_US


3.4.   保存退出

获得的输出如下,输入yes回车。

[root@localhost jhalfs-2.4]# make

#

# using defaults found in configuration

#

 

*** End of JHALFS configuration.

Loading config params from <configuration>...OK

Loading common-functions module...

Loading <func_book_parser>...OK

Loading <func_download_pkgs>...OK

Loading <func_wrt_Makefile>...OK

   ...OK

Loading code module <LFS/master.sh>...OK

------------------------------------------------------------------------------

 

Loading function <func_check_version.sh>...OK

Loading function <func_validate_configs.sh>...OK

Loading function <func_custom_pkgs>...OK

------------------------------------------------------------------------------

 

Checking tools required for jhalfs

SUDO.............. <1.8.6p7>            OK (Min version: 1.7.0)

WGET.............. <1.14>               OK (Min version: 1.0.0)

LIBXML2........... <2.09.01>            OK (Min version: 2.06.20)

LIBXSLT........... <1.01.28>            OK (Min version: 1.01.14)

------------------------------------------------------------------------------

 

BOOK.............. </mnt/lfs/LFSbooks>

CUSTOM_TOOLS...... <n>

INITSYS........... <sysv>

BLFS_TOOL......... <n>

LUSER............. <lfs>

LGROUP............ <lfs>

LHOME............. </home>

BUILDDIR.......... </mnt/lfs/LFSBuild>

CLEAN............. <y>

GETPKG............ <y>

SRC_ARCHIVE....... </mnt/lfs/sources>

SERVER............ <http://ftp.osuosl.org>

RETRYSRCDOWNLOAD.. <>

RETRYDOWNLOADCNT.. <20>

DOWNLOADTIMEOUT... <30>

RUNMAKE........... <n>

TEST.............. <0>

STRIP............. <n>

VIMLANG........... <y>

FSTAB............. <>

CONFIG............ <>

TIMEZONE.......... <Asia/Shanghai>

PAGE.............. <letter>

LANG.............. <zh_CN.UTF-8>

INSTALL_LOG....... <y>

PKGMNGT........... <n>

FULL_LOCALE....... <y>

COMPARE........... <n>

OPTIMIZE.......... <0>

REPORT............ <y>

REBUILD_MAKEFILE.. <n>

 

*** lfs config parameters look good ***

 

------------------------------------------------------------------------------

 

Are you happy with these settings? yes/no (no): yes

 

------------------------------------------------------------------------------

 

Cleaning /mnt/lfs/LFSBuild ...done

Cleaning /mnt/lfs/LFSBuild/jhalfs ...done

Cleaning remaining extracted sources in/mnt/lfs/LFSBuild/sources ...done

Using /mnt/lfs/LFSbooks as book's sources ...

Extracting commands for <LFS> build... done

Creating <lfs> list of tarball names for/mnt/lfs/LFSbooks... done

Creating chroot commands scripts from/mnt/lfs/LFSbooks... done

Creating LFS specific URLs file ...OK

acl-2.2.52.src.tar.gz: -- copied from /mnt/lfs/sources

attr-2.4.47.src.tar.gz: -- copied from /mnt/lfs/sources

autoconf-2.69.tar.xz: -- copied from /mnt/lfs/sources

automake-1.15.tar.xz: -- copied from /mnt/lfs/sources

bash-4.4.tar.gz: -- copied from /mnt/lfs/sources

bc-1.06.95.tar.bz2: -- copied from /mnt/lfs/sources

binutils-2.27.tar.bz2: -- copied from /mnt/lfs/sources

bison-3.0.4.tar.xz: -- copied from /mnt/lfs/sources

bzip2-1.0.6.tar.gz: -- copied from /mnt/lfs/sources

check-0.11.0.tar.gz: -- copied from /mnt/lfs/sources

coreutils-8.26.tar.xz: -- copied from /mnt/lfs/sources

dejagnu-1.6.tar.gz: -- copied from /mnt/lfs/sources

diffutils-3.5.tar.xz: -- copied from /mnt/lfs/sources

eudev-3.2.1.tar.gz: -- copied from /mnt/lfs/sources

e2fsprogs-1.43.4.tar.gz: -- copied from/mnt/lfs/sources

expat-2.2.0.tar.bz2: -- copied from /mnt/lfs/sources

expect5.45.tar.gz: -- copied from /mnt/lfs/sources

file-5.30.tar.gz: -- copied from /mnt/lfs/sources

findutils-4.6.0.tar.gz: -- copied from /mnt/lfs/sources

flex-2.6.3.tar.gz: -- copied from /mnt/lfs/sources

gawk-4.1.4.tar.xz: -- copied from /mnt/lfs/sources

gcc-6.3.0.tar.bz2: -- copied from /mnt/lfs/sources

gdbm-1.12.tar.gz: -- copied from /mnt/lfs/sources

gettext-0.19.8.1.tar.xz: -- copied from/mnt/lfs/sources

glibc-2.25.tar.xz: -- copied from /mnt/lfs/sources

gmp-6.1.2.tar.xz: -- copied from /mnt/lfs/sources

gperf-3.0.4.tar.gz: -- copied from /mnt/lfs/sources

grep-3.0.tar.xz: -- copied from /mnt/lfs/sources

groff-1.22.3.tar.gz: -- copied from /mnt/lfs/sources

grub-2.02~beta3.tar.xz: -- copied from /mnt/lfs/sources

gzip-1.8.tar.xz: -- copied from /mnt/lfs/sources

iana-etc-2.30.tar.bz2: -- copied from /mnt/lfs/sources

inetutils-1.9.4.tar.xz: -- copied from /mnt/lfs/sources

intltool-0.51.0.tar.gz: -- copied from /mnt/lfs/sources

iproute2-4.9.0.tar.xz: -- copied from /mnt/lfs/sources

kbd-2.0.4.tar.xz: -- copied from /mnt/lfs/sources

kmod-23.tar.xz: -- copied from /mnt/lfs/sources

less-481.tar.gz: -- copied from /mnt/lfs/sources

lfs-bootscripts-20150222.tar.bz2: -- copied from/mnt/lfs/sources

libcap-2.25.tar.xz: -- copied from /mnt/lfs/sources

libpipeline-1.4.1.tar.gz: -- copied from/mnt/lfs/sources

libtool-2.4.6.tar.xz: -- copied from /mnt/lfs/sources

linux-4.9.9.tar.xz: -- copied from /mnt/lfs/sources

m4-1.4.18.tar.xz: -- copied from /mnt/lfs/sources

make-4.2.1.tar.bz2: -- copied from /mnt/lfs/sources

man-db-2.7.6.1.tar.xz: -- copied from /mnt/lfs/sources

man-pages-4.09.tar.xz: -- copied from /mnt/lfs/sources

mpc-1.0.3.tar.gz: -- copied from /mnt/lfs/sources

mpfr-3.1.5.tar.xz: -- copied from /mnt/lfs/sources

ncurses-6.0.tar.gz: -- copied from /mnt/lfs/sources

patch-2.7.5.tar.xz: -- copied from /mnt/lfs/sources

perl-5.24.1.tar.bz2: -- copied from /mnt/lfs/sources

pkg-config-0.29.1.tar.gz: -- copied from/mnt/lfs/sources

procps-ng-3.3.12.tar.xz: -- copied from /mnt/lfs/sources

psmisc-22.21.tar.gz: -- copied from /mnt/lfs/sources

readline-7.0.tar.gz: -- copied from /mnt/lfs/sources

sed-4.4.tar.xz: -- copied from /mnt/lfs/sources

shadow-4.4.tar.xz: -- copied from /mnt/lfs/sources

sysklogd-1.5.1.tar.gz: -- copied from /mnt/lfs/sources

sysvinit-2.88dsf.tar.bz2: -- copied from/mnt/lfs/sources

tar-1.29.tar.xz: -- copied from /mnt/lfs/sources

tcl-core8.6.6-src.tar.gz: -- copied from/mnt/lfs/sources

texinfo-6.3.tar.xz: -- copied from /mnt/lfs/sources

tzdata2016j.tar.gz: -- copied from /mnt/lfs/sources

udev-lfs-20140408.tar.bz2: -- copied from/mnt/lfs/sources

util-linux-2.29.1.tar.xz: -- copied from/mnt/lfs/sources

vim-8.0.069.tar.bz2: -- copied from /mnt/lfs/sources

XML-Parser-2.44.tar.gz: -- copied from /mnt/lfs/sources

xz-5.2.3.tar.xz: -- copied from /mnt/lfs/sources

zlib-1.2.11.tar.xz: -- copied from /mnt/lfs/sources

bash-4.4-upstream_fixes-1.patch: -- copied from/mnt/lfs/sources

bc-1.06.95-memory_leak-1.patch: -- copied from/mnt/lfs/sources

bzip2-1.0.6-install_docs-1.patch: -- copied from/mnt/lfs/sources

coreutils-8.26-i18n-1.patch: -- copied from/mnt/lfs/sources

glibc-2.25-fhs-1.patch: -- copied from /mnt/lfs/sources

kbd-2.0.4-backspace-1.patch: -- copied from/mnt/lfs/sources

sysvinit-2.88dsf-consolidated-1.patch: -- copied from/mnt/lfs/sources

------------------------------------------------------------------------------

 

Creating Makefile... START

        Processing...<Chapter4     ( SETUP ) >

        Processing...<Chapter5     ( LUSER ) >

        Processing...<Chapter6     ( CHROOT ) >

        Processing...<Chapter7/8   ( BOOT ) >

Creating Makefile... DONE

------------------------------------------------------------------------------

 

 

KERNEL............ <3.10.0-514.el7.x86_64> OK(Min version: 2.6.32)

BASH.............. <4.2.46(1)-release>  OK (Min version: 3.2)

GCC............... <4.8.5>              OK (Min version: 4.7)

G++............... <4.8.5>              OK (Min version: 4.7)

GLIBC............. <2.17>               OK (Min version: 2.11)

BINUTILS.......... <2.25.1-22.base.el7> OK (Min version: 2.17)

TAR............... <1.26>               OK (Min version: 1.22)

BZIP2............. <1.0.6>              OK (Min version: 1.0.4)

BISON............. <2.7>                OK (Min version: 2.3)

COREUTILS......... <8.22>               OK (Min version: 6.9)

DIFF.............. <3.3>                OK (Min version: 2.8.1)

FIND.............. <4.5.11>             OK (Min version: 4.2.31)

GAWK.............. <4.0.2>              OK (Min version: 4.0.1)

GREP.............. <2.20>               OK (Min version: 2.5.1a)

GZIP.............. <1.5>                OK (Min version: 1.3.12)

M4................ <1.4.16>             OK (Min version: 1.4.10)

MAKE.............. <3.82>               OK (Min version: 3.81)

PATCH............. <2.7.1>              OK (Min version: 2.5.4)

PERL.............. <5.16.3>             OK (Min version: 5.8.8)

SED............... <4.2.2>              OK (Min version: 4.1.5)

TEXINFO........... <5.1>                OK (Min version: 4.7)

XZ................ <5.2.2>              OK (Min version: 5.0.0)

------------------------------------------------------------------------------

 

 

<jhalfs> exit

阅读全文
1 0
原创粉丝点击