写在前面
本人修学了一门课,名曰《操作系统课程设计》,其任务为基于LFS以编译源代码的方式制作一个基本的Linux操作系统,并且编写在linux下的GUI软件。
本操作系统构建的全过程将分为若干章节,在我的博客中进行记录。
基本配置信息
物理机操作系统: Windows 10 , 操作系统内部版本19043.1889
物理机配置: I5-1135G7,16G LPDDR4, 512G SSD
虚拟机版本: Vmware WorkStation Pro 16.2.3 build-19376536
虚拟机操作系统: Ubuntu 16.04 LTS
虚拟机配置: 4核 4GB内存 20GB磁盘
环境准备
在LFS-BOOK-11.2中,提到了需要进行一系列的插件的版本准备
需要进行检查的插件如下:
1 • Bash-3.2 (/bin/sh should be a symbolic or hard link to bash) 2 • Binutils-2.13.1 (Versions greater than 2.39 are not recommended as they have not been tested) 3 • Bison-2.7 (/usr/bin/yacc should be a link to bison or small script that executes bison) 4 • Coreutils-6.9 5 • Diffutils-2.8.1 6 • Findutils-4.2.31 7 • Gawk-4.0.1 (/usr/bin/awk should be a link to gawk) 8 • GCC-4.8 including the C++ compiler, g++ (Versions greater than 12.2.0 are not recommended as they have not 9 been tested). C and C++ standard libraries (with headers) must also be present so the C++ compiler can build 10 hosted programs 11 • Grep-2.5.1a 12 • Gzip-1.3.12 13 • Linux Kernel-3.2 14 The reason for the kernel version requirement is that we specify that version when building glibc in Chapter 5 and 15 Chapter 8, at the recommendation of the developers. It is also required by udev. 16 If the host kernel is earlier than 3.2 you will need to replace the kernel with a more up to date version. There 17 are two ways you can go about this. First, see if your Linux vendor provides a 3.2 or later kernel package. If so, 18 you may wish to install it. If your vendor doesn't offer an acceptable kernel package, or you would prefer not to 19 install it, you can compile a kernel yourself. Instructions for compiling the kernel and configuring the boot loader 20 (assuming the host uses GRUB) are located in Chapter 10. 21 • M4-1.4.10 22 • Make-4.0 23 • Patch-2.5.4 24 • Perl-5.8.8 25 • Python-3.4 26 • Sed-4.1.5 27 • Tar-1.22 28 • Texinfo-4.7 29 • Xz-5.0.0
在LFS-BOOK中,它贴心地准备了一个用于版本检查的bash脚本
我们打开终端,直接在终端中粘贴下面的脚本,按下回车即可自动执行
1 cat > version-check.sh << "EOF" 2 #!/bin/bash 3 # Simple script to list version numbers of critical development tools 4 export LC_ALL=C 5 bash --version | head -n1 | cut -d" " -f2-4 6 MYSH=$(readlink -f /bin/sh) 7 echo "/bin/sh -> $MYSH" 8 echo $MYSH | grep -q bash || echo "ERROR: /bin/sh does not point to bash" 9 unset MYSH 10 echo -n "Binutils: "; ld --version | head -n1 | cut -d" " -f3- 11 bison --version | head -n1 12 if [ -h /usr/bin/yacc ]; then 13 echo "/usr/bin/yacc -> `readlink -f /usr/bin/yacc`"; 14 elif [ -x /usr/bin/yacc ]; then 15 echo yacc is `/usr/bin/yacc --version | head -n1` 16 else 17 echo "yacc not found" 18 fi 19 echo -n "Coreutils: "; chown --version | head -n1 | cut -d")" -f2 20 diff --version | head -n1 21 find --version | head -n1 22 gawk --version | head -n1 23 if [ -h /usr/bin/awk ]; then 24 echo "/usr/bin/awk -> `readlink -f /usr/bin/awk`"; 25 elif [ -x /usr/bin/awk ]; then 26 echo awk is `/usr/bin/awk --version | head -n1` 27 else 28 echo "awk not found" 29 fi 30 gcc --version | head -n1 31 g++ --version | head -n1 32 grep --version | head -n1 33 gzip --version | head -n1 34 cat /proc/version 35 m4 --version | head -n1 36 make --version | head -n1 37 patch --version | head -n1 38 echo Perl `perl -V:version` 39 python3 --version 40 sed --version | head -n1 41 tar --version | head -n1 42 makeinfo --version | head -n1 # texinfo version 43 xz --version | head -n1 44 echo 'int main(){}' > dummy.c && g++ -o dummy dummy.c 45 if [ -x dummy ] 46 then echo "g++ compilation OK"; 47 else echo "g++ compilation failed"; fi 48 rm -f dummy.c dummy 49 EOF 50 bash version-check.sh
标签:bin,head,--,Scratch,全记录,echo,version,LFS,n1 From: https://www.cnblogs.com/alphainf/p/16661308.html