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.

194 lines
4.4 KiB

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