Files
OpenNetworkLinux/tools/scripts/kmodbuild.sh
Jeffrey Townsend 216e4f0eed Platform Kernel Module Support
Per-platform kernel modules can now be built out of tree against multiple kernel mbuild packages.
2016-12-31 20:59:27 +00:00

22 lines
445 B
Bash
Executable File

#!/bin/bash
set -e
#
# kmodbuild.sh kernel-packages module-directories platform-name
#
function build_module
{
KERNEL=`onlpm --find-dir $1 mbuilds`
BUILD_DIR=`mktemp -d`
cp -R $2/* "$BUILD_DIR"
make -C $KERNEL M=$BUILD_DIR modules
make -C $KERNEL M=$BUILD_DIR INSTALL_MOD_PATH=`pwd` INSTALL_MOD_DIR="$3" modules_install
}
for kernel in $1; do
for module in $2; do
build_module $kernel $module $3
done
done