wrs_build_modules 925 Bytes
Newer Older
1
#!/bin/bash
2 3 4 5 6 7 8 9 10

# check variables, like all scripts herein do
WRS_SCRIPT_NAME=$(basename $0)
if [ -z "$WRS_BASE_DIR" ]; then
    echo "$0: Plesae set WRS_BASE_DIR" >& 2
    exit 1
fi
. ${WRS_BASE_DIR}/scripts/wrs_functions

11
wrs_check_vars WRS_OUTPUT_DIR WRS_DOWNLOAD_DIR CROSS_COMPILE
12 13 14 15 16 17 18

wrs_echo "--- Kernel modules from this package"

mkdir -p $WRS_OUTPUT_DIR/build || wrs_die "mkdir build"
mkdir -p $WRS_OUTPUT_DIR/images || wrs_die "mkdir images"

# check that the kernel has been compiled (or at least configured)
19
export LINUX="$WRS_OUTPUT_DIR/build/linux-$KVER"
20 21 22 23 24
test -f $LINUX/.config || wrs_die "no kernel in $LINUX"
cd $WRS_BASE_DIR/../kernel
make $WRS_MAKE_J  || wrs_die "white rabbit kernel modules"

mkdir -p $WRS_OUTPUT_DIR/images
25 26 27 28 29
mkdir -p $WRS_OUTPUT_DIR/images/wr/
mkdir -p $WRS_OUTPUT_DIR/images/wr/lib
mkdir -p $WRS_OUTPUT_DIR/images/wr/lib/modules/

cp $(find . -name \*.ko) $WRS_OUTPUT_DIR/images/wr/lib/modules