+
+# This function just copy config files
+copy() {
+ assert [ $# -eq 2 ]
+
+ local src=${1}
+ local dst=${2}
+
+ # Check if we can read from the source
+ if [ ! -r "${src}" ]; then
+ log ERROR "Cannot read ${src}"
+ return ${EXIT_ERROR}
+ fi
+
+ # Check if ${dst} is a directory
+ if [ -d "${dst}" ]; then
+ log ERROR "${dst} is a directory"
+ return ${EXIT_ERROR}
+ fi
+
+ # Create destination directory if it doesn't exist, yet
+ if ! make_parent_directory "${dst}"; then
+ return ${EXIT_ERROR}
+ fi
+
+ if ! fread "${src}" > "${dst}"; then
+ log ERROR "Could not copy data from ${src} to ${dst}"
+ return ${EXIT_ERROR}
+ fi
+}
+
+normalize() {
+ local string="$@"
+
+ tr -sc [:alnum:] "-" < <(printf "%s" "${string,,}")
+}
+
+get_driver_from_path() {
+ local path="${1}"
+
+ if file_exists "${path}"; then
+ # Resolve symlink
+ local driver="$(readlink "${path}")"
+
+ # Print module name
+ basename "${driver}"
+ return ${EXIT_OK}
+ fi
+
+ return ${EXIT_ERROR}
+}