#!/bin/bash # # --- ROCK-COPYRIGHT-NOTE-BEGIN --- # # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # Please add additional copyright information _after_ the line containing # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by # the ./scripts/Create-CopyPatch script. Do not edit this copyright text! # # ROCK Linux: rock-src/scripts/Check-System # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf # # 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; either version 2 of the License, or # (at your option) any later version. A copy of the GNU General Public # License can be found at Documentation/COPYING. # # Many people helped and are helping developing ROCK Linux. Please # have a look at https://www.rocklinux.org/ and the Documentation/TEAM # file for details. # # --- ROCK-COPYRIGHT-NOTE-END --- if [ -n "$1" -a "$1" != "-paranoia" ] ; then echo "Usage: $0 [ -paranoia ]" echo echo " Check the build system for and warn about various conditions that will likely" echo " cause ROCK to not work properly." echo exit 1 fi found_error=0 paranoia="" if [ "$ROCK_CHECK_SYSTEM_OK" = 1 ]; then exit 0 fi if [ "$1" = "-paranoia" ]; then paranoia=1 fi if [ -n "$paranoia" ] && \ [ ! -w / -o "$(id -u)" != 0 -a "$(id -g)" != 0 ] ; then echo echo "Paranoia Check: You are trying to build as non-root!" echo "Building ROCK Linux requires root privileges." echo echo "You can disable the Paranoia Checks in the Config tool" echo "on your own risk!" found_error=1 fi if [ -n "$paranoia" -a "`date '+%Y'`" -lt 1990 ] ; then echo echo "Paranoia Check: Your clock is not set!" echo "Set you clock using the command: date MMDDhhmm[[CC]YY][.ss]" echo echo "You can disable the Paranoia Checks in the Config tool" echo "on your own risk!" found_error=1 fi if [ -n "$paranoia" -a -z "`grep '^/' < /proc/swaps`" ] ; then echo echo "Paranoia Check: No active swap partition found!" echo "That can cause the build scripts to hang your system!. Activate" echo "a swap partition using the 'swapon' command and try again." echo echo "You can disable the Paranoia Checks in the Config tool" echo "on your own risk!" found_error=1 fi if [ ! -L /dev/fd/0 ] ; then echo echo "System Check: It seems like you don't have a functional" echo "/dev/fd symlink! A symlink from /dev/fd to /proc/self/fd" echo "and a mounted /proc is needed." found_error=1 fi if [ -z "`type -p bzip2`" ] ; then echo echo "System Check: Program 'bzip2' not found!" echo "The bzip2 utility is needed for extracting the package" echo "source tars. Install the latest bzip2 version." found_error=1 fi if [ -z "`type -p gawk`" ] ; then echo echo "System Check: Program 'gawk' not found!" echo "The gawk utility is needed for extracting the package" echo "source tars. Install the latest gawk version." found_error=1 fi if [ -n "$paranoia" -a -z "`type -p makeinfo`" ] ; then echo 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 echo "You can disable the Paranoia Checks in the Config tool" echo "on your own risk!" found_error=1 fi case $BASH_VERSION in 2.05b*|3.*) ;; *) echo "The running bash version is not listed as supported version" echo "You need to update 'bash' to at least version 2.05b." found_error=1 esac x="`mktemp -p /tmp 2> /dev/null`" if [ -z "$x" -o ! -f "$x" ] ; then echo echo "System 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." found_error=1 else rm -f "$x" fi tmpfile=`mktemp` if [ -z "`type -p sed`" ] || ! sed -i s/a/b/ $tmpfile 2> /dev/null then echo echo "System 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." found_error=1 fi rm -f $tmpfile if [ $found_error -ne 0 ] ; then echo echo "System Check found errors -> not doing anything." echo fi exit $found_error