* Fixed problem when BASEDIR paths were given without a trailing '/'.
[linux_from_scratch.git] / checklfs / bin / checklfs-pre5
blobdc6abb073a8e5b72ffc396fb6c89286bf433f36c
1 #!/bin/bash
3 clear
7 amd_inside=0
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:"
20 echo
21 echo "cd /usr/lib &&"
22 echo "ln -s libncurses.a libcurses.a"
23 echo
24 exit
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."
29 echo
30 exit
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"
36 echo "instructions:"
37 echo
38 echo "gzip"
39 echo
40 echo "For gzip you need to apply the patch that you downloaded in"
41 echo "chapter 3."
42 echo
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."
46 echo
47 exit
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"
53 echo "instructions:"
54 echo
55 echo "diffutils, gawk, grep, sed and sh-utils"
56 echo
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"
60 echo "chapter 3."
61 echo
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."
65 echo
66 exit
69 if [ "$amd_inside" = 1 ] && [ "$glibc_minor" = 2 ] && [ "$glibc_micro" = 3 ]
70 then
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."
73 echo
74 exit
76 echo "No problems found during pre-chapter 5 check."
78 echo
79 echo "For your convenience, all output from this test is stored in the"
80 echo "$LFS/tmp/checklfs-pre5.results file."
81 echo
83 } 2>&1 | tee $LFS/tmp/checklfs-pre5.results