android_device_motorola_sm6.../rootdir/bin/vendor_modprobe.sh
Anand S 7a96a5062f
sm7325-common => sm6375-common
* All configs updated from fogos U1UG34M.23-82-2 build

Change-Id: I6750c454f2eeec53205c56f033c76443e93b44ed
2024-07-03 12:56:42 +05:30

38 lines
1.1 KiB
Bash

#! /vendor/bin/sh
#=============================================================================
# Copyright (c) 2019-2020 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#=============================================================================
#default to /vendor/lib/modules
MODULES_PATH="/vendor/lib/modules/"
GKI_MOD_PATH="/vendor/lib/modules/5.4-gki"
MODPROBE="/vendor/bin/modprobe"
MODULES=`${MODPROBE} -d ${MODULES_PATH} -l`
# Find the first non-blacklisted module and try
# inserting it. If insertion fails the module is not
# compatible with the current kernel. Change the modules
# directory to gki.
for MODULE in ${MODULES}; do
cat ${MODULES_PATH}/modules.blocklist | grep $MODULE
if [ $? -ne 0 ]; then
break
fi
done
${MODPROBE} -a -b -d ${MODULES_PATH} ${MODULE}
if [ $? -ne 0 ];then
MODULES_PATH=$GKI_MOD_PATH
MODULES=`${MODPROBE} -d ${MODULES_PATH} -l`
fi
# Iterate over module list and modprobe them in background.
for MODULE in ${MODULES}; do
${MODPROBE} -a -b -d ${MODULES_PATH} ${MODULE} &
done
# Wait until all the modprobes are finished
wait