3 # --- T2-COPYRIGHT-NOTE-BEGIN ---
4 # This copyright note is auto-generated by scripts/Create-CopyPatch.
6 # T2 SDE: scripts/Check-System
7 # Copyright (C) 2004 - 2021 The T2 SDE Project
8 # Copyright (C) 1998 - 2003 ROCK Linux Project
10 # More information can be found in the files COPYING and README.
12 # This program is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; version 2 of the License. A copy of the
15 # GNU General Public License can be found in the file COPYING.
16 # --- T2-COPYRIGHT-NOTE-END ---
19 echo "Usage: $0"; exit 1
24 if [ $UID -ne 0 ]; then
25 echo "Paranoia Check: You are building as non-root!"
26 echo "This does not yet work for many configurations such as"
27 echo "whole system builds that require chroot()."
31 if [ "`date '+%Y'`" -lt 1990 ]; then
32 echo "Paranoia Check: Your clock is not set!"
33 echo "Set you clock using the command: date MMDDhhmm[[CC]YY][.ss]"
38 if [ -z "`type -p uname`" ]; then
39 echo "Paranoia Check: You have no uname install!"
40 echo "Install a uname program printing system information."
45 if [ -z "`grep '^/' < /proc/swaps`" ]; then
46 echo "Paranoia Check: No active swap partition found!"
47 echo "That can cause the build scripts to stall your system!. Better"
48 echo "activate swap using the 'swapon' command and try again."
53 if [ -z "`type -p curl`" ]; then
54 echo "Paranoia Check: Program 'curl' not found!"
55 echo "The curl utility is needed for Downloading the package"
56 echo "source tars. Install the latest curl version."
61 if [ -z "`type -p flex`" ]; then
62 echo "Paranoia Check: Program 'Flex' not found!"
63 echo "The Flex utility is needed for scanning"
64 echo "Install the latest Flex version."
69 if [ -z "`type -p m4`" ]; then
70 echo "Paranoia Check: Program 'm4' not found!"
71 echo "The m4 utility is needed as a front"
72 echo "end for gcc. Install the latest m4 version."
77 if [ -z "`type -p patch`" ]; then
78 echo "Paranoia Check: Program 'patch' not found!"
79 echo "The patch program is needed to work"
80 echo "with source files. Install the latest patch version."
85 if [ -z "`type -p zstd`" ]; then
86 echo "Paranoia Check: Program 'zstd' not found!"
87 echo "The zstd utility is needed for extracting the package"
88 echo "source tars. Install the latest zstd version."
93 if [ -z "`type -p makeinfo`" ]; then
94 echo "Paranoia Check: Program 'makeinfo' not found!"
95 echo "The makeinfo program is needed for translating Texinfo"
96 echo "documents. Please make sure that a current version of the"
97 echo "texinfo package (including makeinfo) is installed on your system."
102 if [ -z "`type -p bison`" ]; then
103 echo "Paranoia Check: Program 'bison' not found!"
104 echo "The bison program is needed for compiling T2 targets."
105 echo "Please make sure that a current version of the"
106 echo "bison package is installed on your system."
111 case $BASH_VERSION in
116 *) echo "The running bash version is not listed as supported version"
117 echo "You need to update 'bash' to at least version 2.05b."
122 x
="`mktemp -p /tmp 2> /dev/null`"
123 if [ -z "$x" -o ! -f "$x" ]; then
124 echo "Paranoia Check: Program 'mktemp' not found or too old!"
125 echo "You need an 'mktemp' installed which does know about the -p"
126 echo "option. Install the latest mktemp version."
133 x
="`mktemp`"; touch $x
134 if [ -z "`type -p sed`" ] ||
! sed -i s
/a
/b
/ $x
136 echo "Paranoia Check: Program 'sed' not found or too old!"
137 echo "You need a 'sed' installed which does know about the -i option"
138 echo "(GNU/sed since 2001-09-25). Install the latest sed version."
142 rm -f $x 2> /dev
/null
144 if [ -z "`type -p gawk`" ]; then
145 echo "Paranoia Check: Program 'gawk' not found!"
146 echo "The gawk program is needed for compiling T2 targets."
147 echo "Please make sure that a current version of the"
148 echo "gawk package is installed on your system."
156 if ! cat src
/null
; then
157 echo "Device nodes can not be created or are not functional on the"
158 echo "partition used for the build. Most probably the partitions is"
159 echo "mounted with the 'nodev' option."
165 if [[ `zstd - < /dev/null | file -` != *Zstandard
* ]]; then
166 echo "The 'file' command does not recognize Zstd compression."
167 echo "Install the latest version of file."
172 if [ $found_error -ne 0 ]; then
173 echo "Paranoia Check found errors -> not doing anything."
174 echo "You can disable the Paranoia Checks in the Config tool"
175 echo "on your own risk!"