From 3a6545dd346807f5902130404a07cf70c85578bf Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Tue, 26 Mar 2024 15:06:03 +0900 Subject: [PATCH] script: build: Add to build linux-tizen-modules Add to build and install linux-tizen-modules in local build script. To build linux-tizne-modules, it is required to clone tizen git platform/kernel/linux-tizen-modules-source and platform/kernel/linux-tizen-modules in parent path. Change-Id: If54d188765c4c46ca21c8db15fce77038fca6755 Signed-off-by: Seung-Woo Kim --- build-rpi4.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/build-rpi4.sh b/build-rpi4.sh index 8c2d3ce..d6711b0 100755 --- a/build-rpi4.sh +++ b/build-rpi4.sh @@ -10,6 +10,9 @@ MOD_SIZE=20 NCPUS=`cat /proc/cpuinfo | grep processor | wc -l` NCPUS=$(($NCPUS * 2)) +BUILD_ROOT=$PWD +KERNEL_PATH=`basename ${BUILD_ROOT}` + if [ $# == 0 ]; then echo "Usage : $0 [rt]" echo " architecture : arm or arm64" @@ -27,6 +30,45 @@ check_ccache() fi } +function mk_tizen_modules() +{ + if [ -e ${BUILD_ROOT}/../linux-tizen-modules-source ]; then + pushd ${BUILD_ROOT}/../linux-tizen-modules-source + + ln -s ${PWD}/include kernel + + export BUILD_logger=m + export LOGGER_MAIN_BUFFER_SIZE=256 + export LOGGER_EVENTS_BUFFER_SIZE=256 + export LOGGER_RADIO_BUFFER_SIZE=256 + export LOGGER_SYSTEM_BUFFER_SIZE=256 + + export BUILD_proc_tsm=m + export BUILD_kdbus=m + export BUILD_zlogger=m + + ARCH="${ARM_ARCH}" CROSS_COMPILE="${CROSS_COMPILER}" make -C kernel KERNELDIR=${BUILD_ROOT} + + rm -f kernel/include + + ARCH="${ARM_ARCH}" CROSS_COMPILE="${CROSS_COMPILER}" make -C kernel modules_install KERNELDIR=${BUILD_ROOT} INSTALL_MOD_PATH=../${KERNEL_PATH}/${MOD_DIR} INSTALL_MOD_STRIP=1 INSTALL_MOD_DIR=extra + + popd + + if [ -e ${BUILD_ROOT}/../linux-tizen-modules ]; then + mkdir -p ${MOD_DIR}/lib/modules/modprobe.d + mkdir -p ${MOD_DIR}/lib/modules/modules-load.d + cp ${BUILD_ROOT}/../linux-tizen-modules/conf/tizen-modprobe-rpi4.conf ${MOD_DIR}/lib/modules/modprobe.d + cp ${BUILD_ROOT}/../linux-tizen-modules/conf/tizen-modules-rpi4.conf ${MOD_DIR}/lib/modules/modules-load.d + fi + else + echo "linux-tizen-modules-source/linux-tizen-modules are not cloned in parent path, so skip building linux-tizen-modules." + echo "To build linux-tizen-modules, please use below command:" + echo " git clone git://git.tizen.org/platform/kernel/linux-tizen-modules-source -b tizen ../linux-tizen-modules-source" + echo " git clone git://git.tizen.org/platform/kernel/linux-tizen-modules -b tizen ../linux-tizen-modules" + fi +} + function mk_modules() { [ -e /usr/bin/make_ext4fs ] && USE_MAKE_EXT4FS=1 if [ "$USE_MAKE_EXT4FS" != "1" ]; then @@ -45,6 +87,9 @@ function mk_modules() { make ARCH=${ARM_ARCH} CROSS_COMPILE="$CROSS_COMPILER" modules_install INSTALL_MOD_PATH=${MOD_DIR} INSTALL_MOD_STRIP=1 + # build and install linux-tizen-modules if cloned in parent path + mk_tizen_modules + if [ "$USE_MAKE_EXT4FS" == "1" ]; then /usr/bin/make_ext4fs -b 4096 -L modules -l ${MOD_SIZE}M $MOD_IMG ${MOD_DIR}/lib/modules/ else -- 2.7.4