概述

现在用的操作系统是Win8.1,用VMware创建一个虚拟机,3G内存(物理内存是6G,分一半),23G硬盘,其中3G用于swap分区,10G用于host system,10G用于建立LFS系统。

创建虚拟机

使用VMware7.1.2创建一个虚拟机,硬盘23G,内存3G。

硬盘分区

分3个区,sda1,3G,用于swap;sda2,10G,用于ubuntu;sda3,10G,用于LFS。之所以要安装ubuntu,是因为需要有一个系统执行分区、建立文件系统、下载源代码、编译源代码等工作。分区在安装ubuntu时进行。

安装utuntu

安装的ubuntu版本为ubuntukylin-13.10-desktop-amd64。之所以安装这个版本,是因为硬盘里正好有这个镜像,懒得再下载其他镜像了。这里要注意的就是host system版本不能太低,否则不能满足编译需求。

在安装ubuntu的同时,按照上边的方案进行硬盘分区。

检测必须的软件包

LFS里列出了编译系统所必须的软件包列表,同时给出了一个脚本用于检测各软件包的版本。

  • Bash-3.2 (/bin/sh should be a symbolic or hard link to bash)

  • Binutils-2.17 (Versions greater than 2.24 are not recommended as they have not been tested)

  • Bison-2.3 (/usr/bin/yacc should be a link to bison or small script that executes bison)

  • Bzip2-1.0.4

  • Coreutils-6.9

  • Diffutils-2.8.1

  • Findutils-4.2.31

  • Gawk-4.0.1 (/usr/bin/awk should be a link to gawk)

  • GCC-4.1.2 including the C++ compiler, g++ (Versions greater than 4.8.2 are not recommended as they have not been tested)

  • Glibc-2.5.1 (Versions greater than 2.19 are not recommended as they have not been tested)

  • Grep-2.5.1a

  • Gzip-1.3.12

  • Linux Kernel-2.6.32

  • M4-1.4.10

  • Make-3.81

  • Patch-2.5.4

  • Perl-5.8.8

  • Sed-4.1.5

  • Tar-1.18

  • Xz-5.0.0

cat > version-check.sh << "EOF"
#!/bin/bash
# Simple script to list version numbers of critical development tools export LC_ALL=C
bash --version | head -n1 | cut -d" " -f2-4
echo "/bin/sh -> `readlink -f /bin/sh`"
echo -n "Binutils: "; ld --version | head -n1 | cut -d" " -f3-
bison --version | head -n1
if [ -e /usr/bin/yacc ];
then echo "/usr/bin/yacc -> `readlink -f /usr/bin/yacc`";
else echo "yacc not found"; fi bzip2 --version 2>&1 < /dev/null | head -n1 | cut -d" " -f1,6-
echo -n "Coreutils: "; chown --version | head -n1 | cut -d")" -f2
diff --version | head -n1
find --version | head -n1
gawk --version | head -n1
if [ -e /usr/bin/awk ];
then echo "/usr/bin/awk -> `readlink -f /usr/bin/awk`";
else echo "awk not found"; fi gcc --version | head -n1
g++ --version | head -n1
ldd --version | head -n1 | cut -d" " -f2- # glibc version
grep --version | head -n1
gzip --version | head -n1
cat /proc/version
m4 --version | head -n1
make --version | head -n1
patch --version | head -n1
echo Perl `perl -V:version`
sed --version | head -n1
tar --version | head -n1
xz --version | head -n1 echo 'main(){}' > dummy.c && g++ -o dummy dummy.c
if [ -x dummy ]
then echo "g++ compilation OK";
else echo "g++ compilation failed"; fi
rm -f dummy.c dummy for lib in lib{gmp,mpfr,mpc}.la; do
echo $lib: $(if find /usr/lib* -name $lib|
grep -q $lib;then :;else echo not;fi) found
done
unset lib

EOF bash version-check.sh

安装缺失的软件包

sudo apt-get install bison
sudo apt-get install gawk
sudo apt-get install build-essential

Changelog

2014-05-25 首次发布

最新文章

  1. js中的json对象和字符串之间的转化
  2. Java Web学习笔记---用GET实现搜索引擎
  3. (2016弱校联盟十一专场10.3) B.Help the Princess!
  4. 通过apt-get安装nvidia驱动
  5. Python 异常结构
  6. [XML] C#ResourceManagerWrapper帮助类 (转载)
  7. nginx log日志分割
  8. Web框架-Django基础
  9. org.quartz.impl.jdbcjobstore.LockException
  10. [置顶] Android系统移植与调试之-------&gt;如何修改Android设备状态条上音量加减键在横竖屏的时候的切换与显示
  11. 模仿qq空间或朋友圈发布动态、评论动态、回复评论、删除动态或评论的功能(上)
  12. Log4Net(一):快速入门
  13. jpa 多对多关系的实现注解形式
  14. BZOJ-USACO被虐记
  15. SqlServer如何获取存储过程的返回值
  16. 在Arcmap中加载互联网地图资源的4种方法
  17. Manacher (最长回文序列)
  18. go异常处理原则
  19. 【BZOJ4031】小Z的房间
  20. HDU-2767-tarjan/Kosaraju求scc

热门文章

  1. Number Sequence--hdu1005
  2. akoj-1048-求某一整数序列的全排列问题
  3. rsyslog VS syslog-ng,日志记录哪家强?
  4. BZOJ 1017 魔兽地图DotR(树形DP)
  5. 使用 C# 编写简易 ASP.NET Web 服务器
  6. Linux批量重命名
  7. tyvj1297 小气的小B
  8. RFC3261--sip
  9. 修改和获取web.config或app.config文件appSettings配置节中的Add里的value属性 函数
  10. Integer to English Words 解答