一. MTK6592的modem在ubuntu14.04 64位下的编译
1.要改动的文件
MTK6592的modem推荐的编译环境是ubuntu10.04 64位
要想在ubuntu 14.04 64位下编译需要改的文件是
-
cong@msi:/work/mtk/bak/MT92_WE_JB9_MD1_GPRS_MD1_HSPA$ git status
-
modified: make.sh
-
modified: make/build.mak
-
modified: make/cmd_cfg.mak
-
modified: tools/NVRAMStatistic/nvram_auto_gen.mak
-
modified: tools/NVRAMStatistic/src/nvram_auto_gen.c
-
modified: tools/NVRAMStatistic/src/nvram_gen_util.c
a.原先shell中if字符串的判断的写法是 ==,ub14.04上是=,所以会导致编译不通过
b.gcc的路径不对,nvram_auto_gen.mak中ub10.40是/usr/bin/gcc-4.4而现在是/usr/bin/gcc-4.8
c.代码文件中#include不需要了
d.主要更改如下所示:
-
diff --git a/make.sh b/make.sh
-
index 83c9f70..eafcfd3 100755
-
--- a/make.sh
-
+++ b/make.sh
-
@@ -35,7 +35,7 @@
-
#
-
export NUMBER_OF_PROCESSORS=`cat /proc/cpuinfo | grep 'processor' | wc -l`
-
export USERNAME=$LOGNAME
-
-if [ "$MTK_INTERNAL" == "TRUE" ] && [ "$MTK_CF" != "TRUE" ]; then
-
+if [ "$MTK_INTERNAL" = "TRUE" ] && [ "$MTK_CF" != "TRUE" ] ; then
-
molyq perl make.pl $*
-
else
-
perl make.pl $*
-
diff --git a/make/build.mak b/make/build.mak
-
index c888c11..011cb6f 100755
-
--- a/make/build.mak
-
+++ b/make/build.mak
-
@@ -737,7 +737,7 @@ remake : backup bootloader done
-
else
-
remake : backup genlog cleanbin genverno libs $(BIN_FILE) cmmgen cfggen done
-
endif
-
-else # MODIS_CONFIG == TRUE
-
+else # MODIS_CONFIG = TRUE
-
remake : genlog cleanbin genverno
-
endif #ifneq ($(strip $(MODIS_CONFIG)),TRUE)
-
-
@@ -3045,7 +3045,6 @@ ifneq ($(strip $(MODIS_CONFIG)),TRUE)
-
$(DONE)
-
endif
-
-
-
-
ifeq ($(strip $(REDUCE_HEADER_DEPTH)),TRUE)
-
@$(STRCMPEX) abc abc e $(strip $(TMPDIR))/~compbld_2.tmp INCDIRS = $(strip $(HEADER_TEMP)) $(strip $(COMMINCDIRS))
-
else
-
@@ -3063,9 +3062,9 @@ endif
-
@$(ECHO) -n "ARM9_PLATFORM = $(strip $(ARM9_PLATFORM))" >> $(strip $(TMPDIR))/~compbld.tmp
-
@$(ECHO) -n "ARM11_PLATFORM = $(strip $(ARM11_PLATFORM))" >> $(strip $(TMPDIR))/~compbld.tmp
-
@$(ECHO) -n "CR4_PLATFORM = $(strip $(CR4_PLATFORM))" >> $(strip $(TMPDIR))/~compbld.tmp
-
- @$(IF_NOT) $(P_VAR)0$(COMPILER) == $(P_VAR)0 $(THEN) \
-
+ @$(IF_NOT) $(P_VAR)0$(COMPILER) = $(P_VAR)0 $(THEN) \
-
$(ECHO) -n "COMPILER = $(COMPILER)" >> $(strip $(TMPDIR))/~compbld.tmp $(CMD_END)
-
- @$(IF_NOT) $(P_VAR)0$(HEADER_TEMP) == $(P_VAR)0 $(THEN) \
-
+ @$(IF_NOT) $(P_VAR)0$(HEADER_TEMP) = $(P_VAR)0 $(THEN) \
-
$(ECHO) -n "HEADER_TEMP = $(strip $(HEADER_TEMP))" >> $(strip $(TMPDIR))/~compbld.tmp $(CMD_END)
-
@$(ECHO) -n "AUTO_MERGE_PTH = $(AUTO_MERGE_PTH)">> $(strip $(TMPDIR))/~compbld.tmp
-
-
diff --git a/make/cmd_cfg.mak b/make/cmd_cfg.mak
-
index 470c716..76a709a 100644
-
--- a/make/cmd_cfg.mak
-
+++ b/make/cmd_cfg.mak
-
@@ -80,7 +80,7 @@ IF_EXIST = if [ -e
-
IF_NOT = if [ !
-
IF_NOT_EXIST = if [ ! -e
-
IF_ERR_TRUE = if [ $$? != 0
-
-IF_ERR_FALSE = if [ $$? == 0
-
+IF_ERR_FALSE = if [ $$? = 0
-
THEN = ]; then
-
ELSE = ;else
-
CMD_END = ;fi
-
diff --git a/tools/NVRAMStatistic/nvram_auto_gen.mak b/tools/NVRAMStatistic/nvram_auto_gen.mak
-
index 9bd6330..926f8d9 100644
-
--- a/tools/NVRAMStatistic/nvram_auto_gen.mak
-
+++ b/tools/NVRAMStatistic/nvram_auto_gen.mak
-
@@ -29,7 +29,7 @@ ifeq ($(strip $(OS_VERSION)),MSWin32)
-
override PATH := tools/MinGW/bin:${PATH}
-
export $(PATH)
-
else
-
- GCC := "/usr/bin/gcc-4.4"
-
+ GCC := "/usr/bin/gcc-4.8"
-
LINKER_SCRIPT := tools/NVRAMStatistic/src/nvram_auto_gen_linux.txt
-
MV := mv
-
endif
-
diff --git a/tools/NVRAMStatistic/src/nvram_auto_gen.c b/tools/NVRAMStatistic/src/nvram_auto_gen.c
-
index 5d9bf53..0828dd1 100644
-
--- a/tools/NVRAMStatistic/src/nvram_auto_gen.c
-
+++ b/tools/NVRAMStatistic/src/nvram_auto_gen.c
-
@@ -568,7 +568,7 @@
-
#include <stdio.h>
-
#include <stdarg.h>
-
#include <stdlib.h>
-
-#include <io.h>
-
+//#include <io.h>
-
#include <errno.h>
-
-
#include "nvram_auto_gen.h"
-
diff --git a/tools/NVRAMStatistic/src/nvram_gen_util.c b/tools/NVRAMStatistic/src/nvram_gen_util.c
-
index ee97c84..9d49275 100644
-
--- a/tools/NVRAMStatistic/src/nvram_gen_util.c
-
+++ b/tools/NVRAMStatistic/src/nvram_gen_util.c
-
@@ -313,7 +313,7 @@
-
#include <stdio.h>
-
#include <stdarg.h>
-
#include <stdlib.h>
-
-#include <io.h>
-
+//#include <io.h>
-
-
#include "nvram_auto_gen.h"
-
#if defined(__MMI_FMI__)
2.调试方法主要是打印
perl中打印出行号与文件名
print "tmd:",__FILE__,"[",__LINE__,"]","\n";
print ("tmd:",__FILE__,"[",__LINE__,"]","\n");
Makefile的脚本中的打印
在规则内部用的是echo
@echo "tmd: Codegen.mak[613]: nvram_auto_gen"
在规则外部打印变量用的是warning
$(warning "tmd:build.mak L2505")
3. 编译流程
a. 简单分析
-
./make.sh MT92_WE_JB9_HSPA.mak new
-
--> perl make.pl $*
-
a. ckmake执行如下:
-
make -fmake/build.mak -r -R PROJECT_NAME=MT92_WE_JB9_HSPA PROJECT_MAKEFILE=build/MT92_WE_JB9_HSPA/DEFAULT/bin/~MT92_WE_JB9_HSPA.mak FLAVOR=DEFAULT ckmake
-
b. new
-
make.pl[1095]0 = make -fmake/build.mak -r -R PROJECT_NAME=MT92_WE_JB9_HSPA PROJECT_MAKEFILE=build/MT92_WE_JB9_HSPA/DEFAULT/bin/~MT92_WE_JB9_HSPA.mak FLAVOR=DEFAULT new
只有这么一点了
二. 编译与烧写
1. 命令
a. 编译 . readme build
b. 烧写 . readme flash
c. 导入dump的log: . readme pull
d. 清除dump的log: . readme del
-
#!/bin/sh
-
build()
-
{
-
./make.sh MT92_WE_JB9_HSPA.mak new
-
}
-
flash()
-
{
-
adb remount
-
adb push ./build/MT92_WE_JB9_HSPA/DEFAULT/bin/MT92_WE_JB9_HSPA_PCB01_MT6592_S00.MOLY_WR8_W1315_MD_WG_MP_V21_P11.bin /system/etc/firmware/modem_1_wg_n.img
-
adb shell sync
-
adb shell sync
-
rm -rf /tmp/MDLog*
-
adb shell rm -r /sdcard/mtklog/mdlog/*
-
adb shell ls -l /sdcard/mtklog/mdlog/
-
adb reboot
-
}
-
pull()
-
{
-
rm -rf /tmp/MDLog*
-
adb pull /sdcard/mtklog/mdlog/ /tmp/
-
}
-
-
del()
-
{
-
adb shell rm -r /sdcard/mtklog/mdlog/*
-
adb shell ls -l /sdcard/mtklog/mdlog/
-
}
-
-
case "$1" in
-
flash)
-
flash
-
;;
-
build)
-
build
-
;;
-
del)
-
del
-
;;
-
pull)
-
pull
-
;;
-
esac
1.2 加强版
-
cong@msi:/work/mtk/modem$ cat readme
-
#!/bin/sh
-
build()
-
{
-
./make.sh HQUNITED72_WE_72_KK_HSPA.mak new
-
cp ./build/HQUNITED72_WE_72_KK_HSPA/DEFAULT/bin/HQUNITED72_WE_72_KK_HSPA_PCB01_MT6572_S00.MOLY_WR8_W1315_MD_WG_MP_V36.bin /tmp/modem_1_wg_n.img
-
}
-
flash()
-
{
-
adb remount
-
#adb push ./build/MT92_WE_JB9_HSPA/DEFAULT/bin/MT92_WE_JB9_HSPA_PCB01_MT6592_S00.MOLY_WR8_W1315_MD_WG_MP_V21_P11.bin /system/etc/firmware/modem_1_wg_n.img
-
adb push ./build/HQUNITED72_WE_72_KK_HSPA/DEFAULT/bin/HQUNITED72_WE_72_KK_HSPA_PCB01_MT6572_S00.MOLY_WR8_W1315_MD_WG_MP_V36.bin /system/etc/firmware/modem_1_wg_n.img
-
adb shell sync
-
adb shell sync
-
rm -rf /tmp/MDLog*
-
adb shell rm -r /sdcard/mtklog/mdlog/*
-
adb shell ls -l /sdcard/mtklog/mdlog/
-
adb reboot
-
}
-
pull()
-
{
-
rm -rf /tmp/MDLog*
-
adb pull /sdcard/mtklog/mdlog/ /tmp/
-
}
-
-
del()
-
{
-
adb shell rm -r /sdcard/mtklog/mdlog/*
-
adb shell ls -l /sdcard/mtklog/mdlog/
-
}
-
-
flashbak()
-
{
-
adb remount
-
adb push /work/mtk/bak/MT92_WE_JB9_HSPA_PCB01_MT6592_S00.MOLY_WR8_W1315_MD_WG_MP_V21_P11.bin /system/etc/firmware/modem_1_wg_n.img
-
adb shell sync
-
adb shell sync
-
rm -rf /tmp/MDLog*
-
adb shell rm -r /sdcard/mtklog/mdlog/*
-
adb shell ls -l /sdcard/mtklog/mdlog/
-
adb reboot
-
}
-
-
case "$1" in
-
flash)
-
flash
-
;;
-
fb)
-
flashbak
-
;;
-
build)
-
build
-
;;
-
del)
-
del
-
;;
-
pull)
-
pull
-
;;
-
esac
2. modem的log查看
a. modem的log查看用的工用是Catcher.exe,windows下用的
b. controls --> Open Dump File...
SetPath:
D:\mtk\tst\database\BPLGUInfoCustomAppSrcP_MT6592_S00_MOLY_WR8_W1315_MD_WG_MP_V21_P11
D:\mtk\tst\database
c. 进入工程模式
*#*#3646633#*#*
阅读(3572) | 评论(0) | 转发(0) |