Table of Contents
序章 .................................................................................................................................................... vii
i. 前言 ........................................................................................................................................... vii
ii. 致读者 ...................................................................................................................................... vii
iii. LFS 的目标架构 ........................................................................................................................ viii
iv. LFS 和标准 .............................................................................................................................. viii
v. 本书中的软件包逻辑 ................................................................................................................... ix
vi. 前提条件 .................................................................................................................................. xiii
vii. 排版约定 ................................................................................................................................. xiii
viii. 本书结构 ................................................................................................................................ xiv
ix. 勘误表 ..................................................................................................................................... xiv
I. 介绍 .................................................................................................................................................. 1
1. 介绍 .......................................................................................................................................... 2
1.1. 如何构建 LFS 系统 ............................................................................................................ 2
1.2. 自上一版手册发布后的变更 ................................................................................................ 2
1.3. 更新日志 ........................................................................................................................... 3
1.4. 资源 ................................................................................................................................. 6
1.5. 帮助 ................................................................................................................................. 6
II. 准备构建 .......................................................................................................................................... 8
2. 准备宿主系统 ............................................................................................................................. 9
2.1. 简介 ................................................................................................................................. 9
2.2. 宿主系统要求 .................................................................................................................... 9
2.3. 分阶段构建 LFS ............................................................................................................... 12
2.4. 创建新分区 ..................................................................................................................... 12
2.5. 在分区上创建文件系统 ..................................................................................................... 13
2.6. 设置 $LFS 变量 ............................................................................................................... 14
2.7. 挂载新分区 ..................................................................................................................... 14
3. 软件包和补丁 ........................................................................................................................... 16
3.1. 简介 ............................................................................................................................... 16
3.2. 所有软件包 ..................................................................................................................... 16
3.3. 需要的补丁 ..................................................................................................................... 22
4. 最后的准备工作 ........................................................................................................................ 24
4.1. 简介 ............................................................................................................................... 24
4.2. 创建目录 $LFS/tools ....................................................................................................... 24
4.3. 添加 LFS 用户 ................................................................................................................. 24
4.4. 设置环境 ......................................................................................................................... 25
4.5. 关于 SBUs ...................................................................................................................... 25
4.6. 关于测试套件 .................................................................................................................. 26
5. 构建临时系统 ........................................................................................................................... 27
5.1. 简介 ............................................................................................................................... 27
5.2. 工具链技术说明 ............................................................................................................... 27
5.3. 通用编译指南 .................................................................................................................. 28
5.4. Binutils-2.32 - 第 1 遍 .................................................................................................... 30
5.5. GCC-9.2.0 - 第 1 遍 ........................................................................................................ 32
5.6. Linux-5.2.8 API 头文件 .................................................................................................... 34
5.7. Glibc-2.30 ....................................................................................................................... 35
5.8. GCC-9.2.0 中的 Libstdc++ ............................................................................................... 37
5.9. Binutils-2.32 - 第 2 遍 .................................................................................................... 38
5.10. GCC-9.2.0 - 第 2 遍 ...................................................................................................... 39
5.11. Tcl-8.6.9 ....................................................................................................................... 41
5.12. Expect-5.45.4 ................................................................................................................ 42
5.13. DejaGNU-1.6.2 .............................................................................................................. 43
5.14. M4-1.4.18 .................................................................................................................... 44
5.15. Ncurses-6.1 .................................................................................................................. 45
5.16. Bash-5.0 ....................................................................................................................... 46
5.17. Bison-3.4.1 ................................................................................................................... 47
5.18. Bzip2-1.0.8 ................................................................................................................... 48
5.19. Coreutils-8.31 ............................................................................................................... 49
5.20. Diffutils-3.7 ................................................................................................................... 5Linux From Scratch (简体中文版) - 版本 9.0-systemd
5.21. File-5.37 ....................................................................................................................... 51
5.22. Findutils-4.6.0 ............................................................................................................... 52
5.23. Gawk-5.0.1 ................................................................................................................... 53
5.24. Gettext-0.20.1 ............................................................................................................... 54
5.25. Grep-3.3 ....................................................................................................................... 55
5.26. Gzip-1.10 ...................................................................................................................... 56
5.27. Make-4.2.1 ................................................................................................................... 57
5.28. Patch-2.7.6 ................................................................................................................... 58
5.29. Perl-5.30.0 .................................................................................................................... 59
5.30. Python-3.7.4 ................................................................................................................. 60
5.31. Sed-4.7 ........................................................................................................................ 61
5.32. Tar-1.32 ........................................................................................................................ 62
5.33. Texinfo-6.6 .................................................................................................................... 63
5.34. Util-linux-2.34 ................................................................................................................ 64
5.35. Xz-5.2.4 ........................................................................................................................ 65
5.36. 清理无用内容 ................................................................................................................ 66
5.37. 改变属主 ....................................................................................................................... 66
III. 构建 LFS 系统 ............................................................................................................................... 67
6. 安装基本的系统软件 ................................................................................................................. 68
6.1. 简介 ............................................................................................................................... 68
6.2. 准备虚拟内核文件系统 ..................................................................................................... 68
6.3. 软件包管理 ..................................................................................................................... 69
6.4. 进入 Chroot 环境 ............................................................................................................. 71
6.5. 创建目录 ......................................................................................................................... 72
6.6. 创建必要的文件和符号链接 .............................................................................................. 72
6.7. Linux-5.2.8 API 头文件 .................................................................................................... 75
6.8. Man-pages-5.02 .............................................................................................................. 76
6.9. Glibc-2.30 ....................................................................................................................... 77
6.10. 调整工具链 ................................................................................................................... 83
6.11. Zlib-1.2.11 .................................................................................................................... 85
6.12. File-5.37 ....................................................................................................................... 86
6.13. Readline-8.0 .................................................................................................................. 87
6.14. M4-1.4.18 .................................................................................................................... 88
6.15. Bc-2.1.3 ....................................................................................................................... 89
6.16. Binutils-2.32 ................................................................................................................. 90
6.17. GMP-6.1.2 .................................................................................................................... 92
6.18. MPFR-4.0.2 ................................................................................................................... 94
6.19. MPC-1.1.0 ..................................................................................................................... 95
6.20. Shadow-4.7 ................................................................................................................... 96
6.21. GCC-9.2.0 ..................................................................................................................... 99
6.22. Bzip2-1.0.8 ................................................................................................................. 103
6.23. Pkg-config-0.29.2 ........................................................................................................ 105
6.24. Ncurses-6.1 ................................................................................................................ 106
6.25. Attr-2.4.48 .................................................................................................................. 108
6.26. Acl-2.2.53 ................................................................................................................... 109
6.27. Libcap-2.27 ................................................................................................................. 110
6.28. Sed-4.7 ....................................................................................................................... 111
6.29. Psmisc-23.2 ................................................................................................................ 112
6.30. Iana-Etc-2.30 .............................................................................................................. 113
6.31. Bison-3.4.1 ................................................................................................................. 114
6.32. Flex-2.6.4 .................................................................................................................... 115
6.33. Grep-3.3 ..................................................................................................................... 116
6.34. Bash-5.0 ..................................................................................................................... 117
6.35. Libtool-2.4.6 ............................................................................................................... 118
6.36. GDBM-1.18.1 .............................................................................................................. 119
6.37. Gperf-3.1 .................................................................................................................... 120
6.38. Expat-2.2.7 ................................................................................................................. 121
6.39. Inetutils-1.9.4 ............................................................................................................. 122
6.40. Perl-5.30.0 .................................................................................................................. 124
6.41. XML::Parser-2.44 ......................................................................................................... 126
6.42. Intltool-0.51.0 ............................................................................................................. 127
iv
Linux From Scratch (简体中文版) - 版本 9.0-systemd
6.43. Autoconf-2.69 .............................................................................................................
128
6.44. Automake-1.16.1 .........................................................................................................
129
6.45. Xz-5.2.4 ......................................................................................................................
130
6.46. Kmod-26 .....................................................................................................................
132
6.47. Gettext-0.20.1 .............................................................................................................
133
6.48. Libelf 源自 Elfutils-0.177 .............................................................................................
135
6.49. Libffi-3.2.1 ..................................................................................................................
136
6.50. OpenSSL-1.1.1c ..........................................................................................................
137
6.51. Python-3.7.4 ...............................................................................................................
138
6.52. Ninja-1.9.0 ..................................................................................................................
140
6.53. Meson-0.51.1 .............................................................................................................
141
6.54. Coreutils-8.31 .............................................................................................................
142
6.55. Check-0.12.0 ..............................................................................................................
146
6.56. Diffutils-3.7 .................................................................................................................
147
6.57. Gawk-5.0.1 .................................................................................................................
148
6.58. Findutils-4.6.0 .............................................................................................................
149
6.59. Groff-1.22.4 ................................................................................................................
150
6.60. GRUB-2.04 ..................................................................................................................
152
6.61. Less-551 ....................................................................................................................
154
6.62. Gzip-1.10 ....................................................................................................................
155
6.63. IPRoute2-5.2.0 ............................................................................................................
156
6.64. Kbd-2.2.0 ....................................................................................................................
158
6.65. Libpipeline-1.5.1 ..........................................................................................................
160
6.66. Make-4.2.1 .................................................................................................................
161
6.67. Patch-2.7.6 .................................................................................................................
162
6.68. Man-DB-2.8.6.1 ...........................................................................................................
163
6.69. Tar-1.32 ......................................................................................................................
165
6.70. Texinfo-6.6 ..................................................................................................................
166
6.71. Vim-8.1.1846 ..............................................................................................................
168
6.72. systemd-241 ...............................................................................................................
171
6.73. D-Bus-1.12.16 ............................................................................................................
175
6.74. Procps-ng-3.3.15 .........................................................................................................
177
6.75. Util-linux-2.34 ..............................................................................................................
179
6.76. E2fsprogs-1.45.3 .........................................................................................................
183
6.77. 关于调试符号 ..............................................................................................................
185
6.78. 再次清理无用内容 ........................................................................................................
185
6.79. 清理 ...........................................................................................................................
186
7. 基本系统配置 .........................................................................................................................
187
7.1. 简介 .............................................................................................................................
187
7.2. 通用网络配置 ................................................................................................................
187
7.3. 设备与模块管理概述 ......................................................................................................
190
7.4. 设备管理 .......................................................................................................................
192
7.5. 配置系统时间 ................................................................................................................
193
7.6. 配置 Linux 控制台 .........................................................................................................
193
7.7. 配置系统语言环境 ..........................................................................................................
194
7.8. 创建 /etc/inputrc 文件 ...................................................................................................
196
7.9. 创建 /etc/shells 文件 ....................................................................................................
196
7.10. systemd 的用法与配置 .................................................................................................
197
8. 让 LFS 系统可引导 .................................................................................................................
199
8.1. 简介 .............................................................................................................................
199
8.2. 创建 /etc/fstab 文件 .....................................................................................................
199
8.3. Linux-5.2.8 ....................................................................................................................
200
8.4. 使用 GRUB 设置启动过程 ..............................................................................................
204
9. 尾声 ......................................................................................................................................
206
9.1. 最后的最后 ...................................................................................................................
206
9.2. 为 LFS 用户数添砖加瓦 ..................................................................................................
206
9.3. 重启系统 .......................................................................................................................
206
9.4. 接下来做什么呢? ..........................................................................................................
207
IV. 附录 ............................................................................................................................................
209
A. 缩写和术语 .............................................................................................................................
210
B. 致谢 ......................................................................................................................................
212
v
Linux From Scratch (简体中文版) - 版本 9.0-systemd
C. 依赖关系 ................................................................................................................................
214
D. LFS Licenses .........................................................................................................................
224
D.1. Creative Commons License ............................................................................................
224
D.2. The MIT License ............................................................................................................
227
Index ................................................................................................................................................
228
LFS-SYSD-BOOK(Linux From Scratch (简体中文版)版本 9_0-systemd).pdf
离线