Script: fix the problem when create the modules.order file [1/1]
PD#SWPL-146602
Problem:
when there are some modules which have similar name, the script will
not put the module with the short name in the modules.order
Solution:
fix the problem
Verify:
local
Change-Id: I2623b8b3ab1e44c515f5bca8217a41bb75f64cc4
Signed-off-by: Dezhen Wang <dezhen.wang@amlogic.com>
diff --git a/amlogic_utils.sh b/amlogic_utils.sh
index 8fbc4c5..4e53613 100644
--- a/amlogic_utils.sh
+++ b/amlogic_utils.sh
@@ -365,7 +365,7 @@
local install_sh=$3
local loop
for loop in `grep "^${ko}:" ${dep_file} | sed 's/.*://'`; do
- [[ `grep ${loop} ${install_sh}` ]] && continue
+ [[ `grep "^${loop}" ${install_sh}` ]] && continue
mod_probe ${dep_file} ${loop} ${install_sh}
echo insmod ${loop} >> ${install_sh}
done
@@ -388,7 +388,7 @@
for loop in `cat ${modules_dep_file} | sed 's/:.*//'`; do
echo ${loop} >> ${modules_order_file}.tmp
- [[ `grep ${loop} ${install_file}.tmp` ]] && continue
+ [[ `grep "^${loop}" ${install_file}.tmp` ]] && continue
mod_probe ${modules_dep_file} ${loop} ${install_file}.tmp
echo insmod ${loop} >> ${install_file}.tmp
done
@@ -555,8 +555,8 @@
for module in ${GKI_MODULES_LOAD_BLACK_LIST[@]}; do
echo Delete module: ${module}
- sed -n "/${module}:/p" modules.dep.temp
- sed -i "/${module}:/d" modules.dep.temp
+ sed -n "/^${module}:/p" modules.dep.temp
+ sed -i "/^${module}:/d" modules.dep.temp
done
fi