summaryrefslogtreecommitdiff
path: root/buildkernel.sh
diff options
context:
space:
mode:
authorPrakruthi Deepak Heragu <pheragu@codeaurora.org>2020-04-15 12:53:36 -0700
committerPrakruthi Deepak Heragu <pheragu@codeaurora.org>2020-04-15 13:19:18 -0700
commit4609a47abb953f9ba8df41e1d1a09b821ba1f91f (patch)
treedb4a5589ccd1ce7b71d6db21ad47e64ee9999b08 /buildkernel.sh
parentebec614ce0e7aea5b76eaeab7fe6e843f6484709 (diff)
buildkernel: Add support to rename modules which has hyphen in the name
Modprobe converts every hyphen in the name of a module to underscore. Debugging such modules with names having hyphen in t32 simulator, gave an error of module not found. So, rename all modules in unstripped folder by replacing all hyphens in the name to underscores. Change-Id: I4dd84ae203d6e2d8b1047da85fd491f63620b019 Signed-off-by: Prakruthi Deepak Heragu <pheragu@codeaurora.org>
Diffstat (limited to 'buildkernel.sh')
-rwxr-xr-xbuildkernel.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/buildkernel.sh b/buildkernel.sh
index 33a19e5..26a6a42 100755
--- a/buildkernel.sh
+++ b/buildkernel.sh
@@ -344,7 +344,17 @@ save_unstripped_modules()
MODULES=$(find ${UNSTRIPPED_DIR} -type f -name "*.ko")
for MODULE in ${MODULES}; do
+ # Replace all hyphens in module name with underscores
+ MODULE_NAME=$(basename ${MODULE})
+ CORRECTED_NAME=$(echo "${MODULE_NAME//-/$'_'}")
cp -p ${MODULE} ${UNSTRIPPED_DIR}
+ # Rename all modules with hyphens to names wth underscores
+ # As t32 expects module names with underscores to match
+ # symbols of the modules actually loaded, rename and save
+ # modules in unstripped folder for debugging
+ if [ ${MODULE_NAME} != ${CORRECTED_NAME} ]; then
+ mv ${UNSTRIPPED_DIR}/${MODULE_NAME} ${UNSTRIPPED_DIR}/${CORRECTED_NAME}
+ fi
done
# Remove the /lib/modules/$(uname -r) hierarchy