build.sh

Creates the installable file.

Functions

contains_element(string, array)

checks if first parameter is contained in the array passed as the second parameter use: contains_element “search_for” “${some_array[@]}” || do_if_not_found

Parameters
  • string -

    The parameter to check

  • array -

    The array

Return Value
  • 0 -

    if it is contained, else 1

check_dependencies(array)

expects an array with kernel modules as a parameter, checks each module for dependencies and if a dependency isn’t already in the $modules array, adds it to it (through a temporary local array). in addition sets the global $new_count variable to the number of dependencies added, so that the newly added dependencies can be checked as well use: check_dependencies “${modules[@]:${index}}”

Parameters
  • array -

    the parameters

touch_tempfile(string)

creates the file passed as an argument and sets permissions

Parameters
  • string -

    The temporal file name

create_tempfile(string)

creates a temporary file and returns (echos) its filename the function checks for different commands and uses the appropriate one it will fallback to creating a file in /tmp

Parameters
  • string -

    The name of the file

create_cpio(string)

Creates the .cpio file that is copied to the SD.

Parameters
  • string -

    The version of the Raspberry Pi to which the file is created (“rpi1” or “rpi2”)