diff options
author | Thomas Abraham <thomas.abraham@arm.com> | 2019-02-12 17:13:25 +0530 |
---|---|---|
committer | Thomas Abraham <thomas.abraham@arm.com> | 2019-02-18 18:13:25 +0530 |
commit | dfaaf2f0b96ad90ac65c35f9cc564939791b6a95 (patch) | |
tree | c15223fe6f934617cd6a949f9e4d49cbfe023f33 | |
parent | b83ddf867b8cbe660ae871626dbf3e44ff079b9b (diff) |
build-linux: add support to build kernel modules
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-x | build-linux.sh | 14 |
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 |