OpenSDE Framework (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

207 lines
4.7 KiB

#!/bin/bash
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: bin/sde-check-system
# Copyright (C) 2006 - 2020 The OpenSDE Project
# Copyright (C) 2004 - 2006 The T2 SDE Project
# Copyright (C) 1998 - 2003 Clifford Wolf
#
# 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.
# --- SDE-COPYRIGHT-NOTE-END ---
if [ $# -gt 0 ] ; then
echo "Usage: $0" ; exit 1
fi
found_error=0
if [ $UID -ne 0 ] ; then
cat <<-EOT
Paranoia Check: You are building as non-root!
This does not yet work for many configurations such as
whole system builds that require chroot().
EOT
fi
if [ "`date '+%Y'`" -lt 1990 ] ; then
cat <<-EOT
Paranoia Check: Your clock is not set!
Set you clock using the command: date MMDDhhmm[[CC]YY][.ss]
EOT
found_error=1
fi
if [ -z "`grep '^/' < /proc/swaps`" ] ; then
cat <<-EOT
Paranoia Check: No active swap partition found!
That can cause the build scripts to hang your system!. Activate
a swap partition using the 'swapon' command and try again.
EOT
found_error=1
fi
if [ -z "`type -p curl`" ] ; then
cat <<-EOT
Paranoia Check: Program 'curl' not found!
The curl utility is needed for Downloading the package
source tars. Install the latest curl version.
EOT
found_error=1
fi
if [ -z "`type -p flex`" ] ; then
cat <<-EOT
Paranoia Check: Program 'Flex' not found!
The Flex utility is needed for scanning
Install the latest Flex version.
EOT
found_error=1
fi
if [ -z "`type -p m4`" ] ; then
cat <<-EOT
Paranoia Check: Program 'm4' not found!
The m4 utility is needed as a front
end for gcc. Install the latest m4 version.
EOT
found_error=1
fi
if [ -z "`type -p patch`" ] ; then
cat <<-EOT
Paranoia Check: Program 'patch' not found!
The patch program is needed to work
with source files. Install the latest patch version.
EOT
found_error=1
fi
if [ -z "`type -p bzip2`" ] ; then
cat <<-EOT
Paranoia Check: Program 'bzip2' not found!
The bzip2 utility is needed for extracting the package
source tars. Install the latest bzip2 version.
EOT
found_error=1
fi
if [ -z "`type -p makeinfo`" ] ; then
cat <<-EOT
Paranoia Check: Program 'makeinfo' not found!
The makeinfo program is needed for translating Texinfo
documents. Please make sure that a current version of the
texinfo package (including makeinfo) is installed on your system.
EOT
found_error=1
fi
if [ -z "`type -p bison`" ] ; then
cat <<-EOT
Paranoia Check: Program 'bison' not found!
The bison program is needed for compiling targets.
Please make sure that a current version of the
bison package is installed on your system.
EOT
found_error=1
fi
if [ -z "`type -p bc`" ] ; then
cat <<-EOT
Paranoia Check: Program 'bc' not found!
The bc program is needed for compiling linux kernels >= 3.10.
Please make sure that a current version of the bc package is
installed on your system.
EOT
found_error=1
fi
case $BASH_VERSION in
2.05b*) ;;
3.*) ;;
4.*) ;;
5.*) ;;
*) cat <<-EOT
Paranoia Check: Invalid 'bash' version ($BASH_VERSION)
The running bash version is not listed as supported version
You need to update 'bash' to at least version 2.05b.
EOT
found_error=1
esac
if [ -z "$(ls -1d /usr/lib*/libc.a /usr/lib*/*/libc.a 2> /dev/null)" ]; then
cat <<-EOT
Paranoia Check: File '/usr/lib*/libc.a' not found!
Without the static library of your libC you wont be able to
build targets.
EOT
found_error=1
fi
x="`mktemp -p /tmp 2> /dev/null`"
if [ -z "$x" -o ! -f "$x" ] ; then
cat <<-EOT
Paranoia Check: Program 'mktemp' not found or too old!
You need an 'mktemp' installed which does know about the -p
option. Install the latest mktemp version.
EOT
found_error=1
else
rm -f "$x"
fi
x="`mktemp`" ; touch $x
if [ -z "`type -p sed`" ] || ! sed -i s/a/b/ $x; then
cat <<-EOT
Paranoia Check: Program 'sed' not found or too old!
You need a 'sed' installed which does know about the -i option
(GNU/sed since 2001-09-25). Install the latest sed version.
EOT
found_error=1
fi
rm -f $x 2> /dev/null
x=tmp/null
mkdir -p tmp
mknod $x c 1 3
if ! cat $x; then
cat <<-EOT
Device nodes can not be created or are not functional on the
partition used for the build. Most probably the partitions is
mounted with the 'nodev' option.
EOT
found_error=1
fi
rm -f $x
if [ $found_error -ne 0 ] ; then
cat <<-EOT
Paranoia Check found errors -> not doing anything.
You can disable the Paranoia Checks in the Config tool
on your own risk!
EOT
fi
exit $found_error