Files
OpenNetworkLinux/tools/scripts/kmodcopy.sh
Jeffrey Townsend 45dee0c608 Initial.
2015-11-19 22:45:38 +00:00

25 lines
532 B
Bash
Executable File

#!/bin/bash
############################################################
#
# This script will copy the given kernel module
# into the appropriately versioned subdirectory.
#
# $1 is the source kernel module
# $2 is the destination base directory.
#
# The file will be copied into $2/$(modver)/$1
#
############################################################
set -ex
srcfile=$1
dstroot=$2
modver=`/sbin/modinfo -F vermagic $1 | awk '{ print $1 }'`
dstdir="${dstroot}/${modver}"
mkdir -p "${dstdir}"
cp "${srcfile}" "${dstdir}"