-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCheck-System
executable file
·171 lines (151 loc) · 4.66 KB
/
Check-System
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#!/bin/bash
#
# --- T2-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# T2 SDE: scripts/Check-System
# Copyright (C) 2004 - 2009 The T2 SDE Project
# Copyright (C) 1998 - 2003 ROCK Linux Project
#
# More information can be found in the files COPYING and README.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- T2-COPYRIGHT-NOTE-END ---
if [ "$1" ] ; then
echo "Usage: $0" ; exit 1
fi
found_error=0
if [ $UID -ne 0 ] ; then
echo "Paranoia Check: You are building as non-root!"
echo "This does not yet work for many configurations such as"
echo "whole system builds that require chroot()."
echo
fi
if [ "`date '+%Y'`" -lt 1990 ] ; then
echo "Paranoia Check: Your clock is not set!"
echo "Set you clock using the command: date MMDDhhmm[[CC]YY][.ss]"
echo
found_error=1
fi
if [ -z "`type -p uname`" ] ; then
echo "Paranoia Check: You have no uname install!"
echo "Install a uname program printing system information."
echo
found_error=1
fi
if [ -z "`grep '^/' < /proc/swaps`" ] ; then
echo "Paranoia Check: No active swap partition found!"
echo "That can cause the build scripts to stall your system!. Better"
echo "activate swap using the 'swapon' command and try again."
echo
#found_error=1
fi
if [ -z "`type -p curl`" ] ; then
echo "Paranoia Check: Program 'curl' not found!"
echo "The curl utility is needed for Downloading the package"
echo "source tars. Install the latest curl version."
echo
found_error=1
fi
if [ -z "`type -p flex`" ] ; then
echo "Paranoia Check: Program 'Flex' not found!"
echo "The Flex utility is needed for scanning"
echo "Install the latest Flex version."
echo
found_error=1
fi
if [ -z "`type -p m4`" ] ; then
echo "Paranoia Check: Program 'm4' not found!"
echo "The m4 utility is needed as a front"
echo "end for gcc. Install the latest m4 version."
echo
found_error=1
fi
if [ -z "`type -p patch`" ] ; then
echo "Paranoia Check: Program 'patch' not found!"
echo "The patch program is needed to work"
echo "with source files. Install the latest patch version."
echo
found_error=1
fi
if [ -z "`type -p bzip2`" ] ; then
echo "Paranoia Check: Program 'bzip2' not found!"
echo "The bzip2 utility is needed for extracting the package"
echo "source tars. Install the latest bzip2 version."
echo
found_error=1
fi
if [ -z "`type -p makeinfo`" ] ; then
echo "Paranoia Check: Program 'makeinfo' not found!"
echo "The makeinfo program is needed for translating Texinfo"
echo "documents. Please make sure that a current version of the"
echo "texinfo package (including makeinfo) is installed on your system."
echo
found_error=1
fi
if [ -z "`type -p bison`" ] ; then
echo "Paranoia Check: Program 'bison' not found!"
echo "The bison program is needed for compiling T2 targets."
echo "Please make sure that a current version of the"
echo "bison package is installed on your system."
echo
found_error=1
fi
case $BASH_VERSION in
2.05b*) ;;
3.*) ;;
4.*) ;;
*) echo "The running bash version is not listed as supported version"
echo "You need to update 'bash' to at least version 2.05b."
echo
found_error=1
esac
x="`mktemp -p /tmp 2> /dev/null`"
if [ -z "$x" -o ! -f "$x" ] ; then
echo "Paranoia Check: Program 'mktemp' not found or too old!"
echo "You need an 'mktemp' installed which does know about the -p"
echo "option. Install the latest mktemp version."
echo
found_error=1
else
rm -f "$x"
fi
x="`mktemp`" ; touch $x
if [ -z "`type -p sed`" ] || ! sed -i s/a/b/ $x
then
echo "Paranoia Check: Program 'sed' not found or too old!"
echo "You need a 'sed' installed which does know about the -i option"
echo "(GNU/sed since 2001-09-25). Install the latest sed version."
echo
found_error=1
fi
rm -f $x 2> /dev/null
if [ -z "`type -p gawk`" ] ; then
echo "Paranoia Check: Program 'gawk' not found!"
echo "The gawk program is needed for compiling T2 targets."
echo "Please make sure that a current version of the"
echo "gawk package is installed on your system."
echo
found_error=1
fi
x=src/null
mkdir -p src
mknod $x c 1 3
if ! cat src/null; then
echo "Device nodes can not be created or are not functional on the"
echo "partition used for the build. Most probably the partitions is"
echo "mounted with the 'nodev' option."
echo
found_error=1
fi
rm -f $x
if [ $found_error -ne 0 ] ; then
echo "Paranoia Check found errors -> not doing anything."
echo "You can disable the Paranoia Checks in the Config tool"
echo "on your own risk!"
echo
fi
exit $found_error