8 grep -q AMD
/proc
/cpuinfo
9 [ "$?" = 0 ] && amd_inside
=1
11 curseslib
=/usr
/lib
/libcurses.a
12 ncurseslib
=/usr
/lib
/libncurses.a
13 glibc_minor
=$
(ls /lib
/libc-2.
*.so|cut
-f 2 -d ".")
14 glibc_micro
=$
(ls /lib
/libc-2.
*.so|cut
-f 3 -d ".")
16 if [ ! -f "$curseslib" ] && [ -f "$ncurseslib" ]; then
17 echo "You are missing the $curseslib symlink to"
18 echo "$ncurseslib Please run the following commands as root,"
19 echo "then run this check again:"
22 echo "ln -s libncurses.a libcurses.a"
25 elif [ ! -f "$curseslib" ] && [ ! -f "$ncurseslib" ]; then
26 echo "You are missing both the $curseslib and $ncurseslib files"
27 echo "Please install the ncurses-dev package (or something resembling "
28 echo "that name) using your distribution's package installation tool."
33 if [ "$glibc_minor" = 0 ]; then
34 echo "The Glibc version detected on your system is 2.0.x. This means"
35 echo "that the following package(s) need alternative installation"
40 echo "For gzip you need to apply the patch that you downloaded in"
43 echo "Instructions on how to fix these package(s) are provided in the book"
44 echo "when you are going to install those packages. This is just an"
45 echo "informative message."
50 if [ "$glibc_minor" = 1 ]; then
51 echo "The Glibc version detected on your system is 2.1.x. This means"
52 echo "that the following package(s) need alternative installation"
55 echo "diffutils, gawk, grep, sed and sh-utils"
57 echo "for diffutils, gawk, grep and sed it's a simple matter of"
58 echo "setting an environment variable to fix the problem. For sh-utils"
59 echo "however, you need to apply the patch that you downloaded in"
62 echo "Instructions on how to fix these package(s) are provided in the book"
63 echo "when you are going to install those packages. This is just an"
64 echo "informative message."
69 if [ "$amd_inside" = 1 ] && [ "$glibc_minor" = 2 ] && [ "$glibc_micro" = 3 ]
71 echo "Your system has Glibc-2.2.3 and an AMD CPU. When you get to the"
72 echo "fileutils installation, be sure to apply the fileutils fix."
76 echo "No problems found during pre-chapter 5 check."
79 echo "For your convenience, all output from this test is stored in the"
80 echo "$LFS/tmp/checklfs-pre5.results file."
83 } 2>&1 |
tee $LFS/tmp
/checklfs-pre5.results