commit 1678f27084400f39b41adccc3089d38a26b1597f
Author: Simon Welzel <simonwelzel@live.de>
Date:   Thu Jan 24 17:22:04 2019 +0100

    Re-Added files to a newer version of AMiRo-OS

diff --git a/kernel/kernelsetup.sh b/kernel/kernelsetup.sh
index 5bf200c..f8aced8 100755
--- a/kernel/kernelsetup.sh
+++ b/kernel/kernelsetup.sh
@@ -1,7 +1,7 @@
 ################################################################################
 # AMiRo-OS is an operating system designed for the Autonomous Mini Robot       #
 # (AMiRo) platform.                                                            #
-# Copyright (C) 2016..2018  Thomas Schöpping et al.                            #
+# Copyright (C) 2016..2019  Thomas Schöpping et al.                            #
 #                                                                              #
 # 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         #
@@ -263,6 +263,40 @@ function setLogFile {
   return 0
 }
 
+### check whether commands are available #######################################
+# Checks whether the specified commands are available and can be executed.
+#
+# usage:      checkCommand [<command> <command> ...]
+# arguments:  <command>
+#                 Name of the command to check.
+# return:     0
+#                 All requested commands are available.
+#             >0
+#                 Number of requested commands that were not found.
+#             -1
+#                 No argument given.
+#
+function checkCommands {
+  local status=0
+
+  # return if no argument was specified
+  if [ $# -eq 0 ]; then
+    return -1
+  fi
+
+  # check all specified commands
+  while [ $# -gt 0 ]; do
+    command -v $1 &>/dev/null
+    if [ $? -ne 0 ]; then
+      printWarning "Command '$1' not available.\n"
+      status=$((status + 1))
+    fi
+    shift 1
+  done
+
+  return $status
+}
+
 ################################################################################
 # SPECIFIC FUNCTIONS                                                           #
 ################################################################################
@@ -281,7 +315,7 @@ function printWelcomeText {
   printf "#                                                                    #\n"
   printf "######################################################################\n"
   printf "#                                                                    #\n"
-  printf "# Copyright (c) 2016..2018  Thomas Schöpping                         #\n"
+  printf "# Copyright (c) 2016..2019  Thomas Schöpping                         #\n"
   printf "#                                                                    #\n"
   printf "# This is free software; see the source for copying conditions.      #\n"
   printf "# There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR  #\n"
@@ -333,6 +367,8 @@ function printHelp {
 #                 Warning: Aborted by user.
 #             -1
 #                 Error: Unexpected user input.
+#             -1
+#                 Error: Missing dependency.
 #
 function initChibiOS {
   printInfo "initializing ChibiOS submodule...\n"
@@ -358,6 +394,13 @@ function initChibiOS {
     esac
   fi
 
+  # check dependencies
+  checkCommands git
+  if [ $? -ne 0 ]; then
+    printError "Missing dependencies detected.\n"
+    return -2
+  fi
+
   # initialize submodule to default branch
   cd $kerneldir
   git submodule update --init $chibiosdir 2>&1 | tee -a $LOG_FILE
@@ -403,6 +446,13 @@ function patchChibiOS {
   local chibiosdir=${kerneldir}/ChibiOS
   local git_branch_patched="AMiRo-OS"
 
+  # check dependencies
+  checkCommands git
+  if [ $? -ne 0 ]; then
+    printError "Missing dependencies detected.\n"
+    return -2
+  fi
+
   # if the ChibiOS folder is empty
   if [ -z "$(ls -A $chibiosdir)" ]; then
     printWarning "$chibiosdir is empty. Please initialize first.\n"
@@ -615,6 +665,13 @@ function wipeChibiOS {
   local chibiosdir=${kerneldir}/ChibiOS
   local git_branch_patched="AMiRo-OS"
 
+  # check dependencies
+  checkCommands git
+  if [ $? -ne 0 ]; then
+    printError "Missing dependencies detected.\n"
+    return -2
+  fi
+
   # if the ChibiOS folder is empty
   if [ -z "$(ls -A $chibiosdir)" ]; then
     printInfo "$chibiosdir is alread empty\n"
