aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Abraham <thomas.abraham@arm.com>2019-02-12 17:13:25 +0530
committerThomas Abraham <thomas.abraham@arm.com>2019-02-13 16:06:33 +0530
commitcc788ea300988880920213f9ac396bca214c9c95 (patch)
treec9bd96fb2a49ff915cdceb2b6dc46d12f84ec08c
parent46a36751d0a3b72ca9dfd51b835c9aecca3d38dd (diff)
build-linux: add support to build kernel modulesarmlt-20190222-002
Add the kernel module build support into the linux kernel component build script. The kernel module build can be enabled in the platform's config file by adding a build config as LINUX_foo[modules]="true" where 'foo' is the linux build configuration name. For instance, if 'defconfig' is the linux build configuration name, the platform config file can enable module build for defconfig using LINUX_defconfig[modules]="true" If kernel module compilation is not required for the build, either mark the config option as 'false' (LINUX_foo[modules]="false") or do not add this entry in the platform configuration file. If kernel module compilation is enabled, the package stage copies the compiled kernel modules to "output/<platform>/components/linux/modules/" Change-Id: I3a114d61dc61805efab9ed43536cb6d07e98609d Signed-off-by: Thomas Abraham <thomas.abraham@arm.com>
-rwxr-xr-xbuild-linux.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/build-linux.sh b/build-linux.sh
index fcc3474..db0c2d3 100755
--- a/build-linux.sh
+++ b/build-linux.sh
@@ -61,6 +61,7 @@ do_build ()
for name in $LINUX_CONFIG_LIST; do
local lpath=LINUX_$name[path];
local lconfig=LINUX_$name[config];
+ local lmodules=LINUX_$name[modules];
echo "config: $name"
pushd $TOP_DIR/${!lpath};
@@ -75,11 +76,20 @@ do_build ()
done
scripts/kconfig/merge_config.sh -O $LINUX_OUT_DIR/$name $CONFIG
make O=$LINUX_OUT_DIR/$name -j$PARALLELISM $LINUX_IMAGE_TYPE dtbs
+ if [ ${!lmodules} == "true" ]; then
+ mkdir -p $LINUX_OUT_DIR/$name/modules
+ scripts/kconfig/merge_config.sh -O $LINUX_OUT_DIR/$name/modules $CONFIG
+ make O=$LINUX_OUT_DIR/$name/modules -j$PARALLELISM modules
+ fi
else
echo "Building using defconfig..."
lconfig=LINUX_$name[defconfig];
make O=$LINUX_OUT_DIR/$name ${!lconfig}
make O=$LINUX_OUT_DIR/$name -j$PARALLELISM $LINUX_IMAGE_TYPE dtbs
+ if [ ${!lmodules} == "true" ]; then
+ make O=$LINUX_OUT_DIR/$name/modules ${!lconfig}
+ make O=$LINUX_OUT_DIR/$name/modules -j$PARALLELISM modules
+ fi
fi
popd
done
@@ -112,9 +122,13 @@ do_package ()
for name in $LINUX_CONFIG_LIST; do
local lpath=LINUX_$name[path];
local outpath=LINUX_$name[outpath];
+ local lmodules=LINUX_$name[modules];
mkdir -p ${OUTDIR}/${!outpath}
cp $TOP_DIR/${!lpath}/$LINUX_OUT_DIR/$name/arch/$LINUX_ARCH/boot/$LINUX_IMAGE_TYPE ${OUTDIR}/${!outpath}/$LINUX_IMAGE_TYPE.$name
+ if [ ${!lmodules} == "true" ]; then
+ cp -R $TOP_DIR/${!lpath}/$LINUX_OUT_DIR/$name/modules ${OUTDIR}/${!outpath}/modules
+ fi
if [ "$LINUX_CONFIG_DEFAULT" = "$name" ]; then
for plat in $TARGET_BINS_PLATS; do