Difference between revisions of "ROM Android: Compile Kernel untuk MediaTek"
Onnowpurbo (talk | contribs) (New page: MTK Kernel Builder 2012-09-24 16:44:41| 分类: Android | 标签:kernel android makefile |举报 |字号 订阅 KConfig 流程 关心点1: kernel builder: @makeMtk make ...) |
Onnowpurbo (talk | contribs) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | MTK KERNEL BUIDER - Cách tạo kernel hoàn chỉnh cho MTK chip | ||
− | + | KConfig Process | |
+ | Concerned about point 1 : | ||
+ | kernel builder: | ||
+ | @ makeMtk | ||
+ | make-f mediatek / build / makemtk.mk kernel | ||
+ | |||
+ | |||
+ | @ mediatek / build / makemtk.mk | ||
+ | kernel / build.sh | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | @mediatek/build/ | + | @ kernel / build.sh |
− | + | make mediatek-configs | |
+ | nice make $ {makeflags} $ {makedefs} silentoldconfig | ||
+ | make $ {makeflags} $ {makejobs} $ {makedefs} | ||
+ | |||
+ | mediatek-configs goal is how original ? : | ||
+ | @ kernel / Makefile | ||
+ | include $ (srctree) / arch / $ (SRCARCH) / Makefile | ||
+ | @ kernel / arch / arm / Makefile | ||
+ | include .. / mediatek / build / kernel / Makefile | ||
+ | @ mediatek / build / kernel / Makefile | ||
+ | . config mediatek-configs: $ (MTK_ROOT_GEN_CONFIG) / kconfig $ (MTK_ROOT_GEN_CONFIG) | ||
+ | @ echo "[COPY] $ <-> $ @" | ||
+ | @ cp $ <$ @ | ||
+ | @ echo "[COPY] $ <->. config" | ||
+ | @ cp $ <. config | ||
+ | |||
+ | |||
+ | @ kernel / Kconfig | ||
+ | source "arch / $ SRCARCH / Kconfig" | ||
+ | @ alps / kernel / arch / arm / Kconfig | ||
+ | source ".. / mediatek / source / kernel / Kconfig" | ||
+ | @ alps / mediatek / source / kernel / Kconfig | ||
+ | 31 if ARCH_MT6573 | ||
+ | 32 source "../mediatek/platform/mt6573/kernel/Kconfig/Kernel" | ||
+ | 33 source "../mediatek/platform/mt6573/kernel/Kconfig/Board" | ||
+ | 34 source "../mediatek/platform/mt6573/kernel/Kconfig/Drivers" | ||
+ | 35 endif | ||
+ | |||
+ | |||
+ | @ mediatek/platform/mt6573/kernel/Kconfig/Drivers | ||
+ | 34 # Frame Buffer Related | ||
+ | 35 menuconfig MTK_FB # FB_MT6516 FB_MT6573 | ||
+ | 36 bool "MediaTek Framebuffer Driver" | ||
+ | 37 depends on FB | ||
+ | 38 select FB_CFB_FILLRECT | ||
+ | 39 select FB_CFB_COPYAREA | ||
+ | 40 select FB_CFB_IMAGEBLIT | ||
+ | 41 select FB_SOFT_CURSOR | ||
+ | 42 --- help --- | ||
+ | 43 This selects the MediaTek (R) frame buffer driver. | ||
+ | 44 If you want to use MediaTek (R) frame buffer diver, say Y here. | ||
+ | 45 If unsure, say N. | ||
+ | |||
− | + | Point 2 concerns : | |
− | + | menuconfig come from ? Explained: | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | @ | + | @ alps / kernel / Makefile |
− | + | % config: scripts_basic outputmakefile FORCE | |
− | + | $ (Q) mkdir-p include / linux include / config | |
− | + | $ (Q) $ (MAKE) $ (build) = scripts / kconfig $ @ | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | Regarding the last of a command : I print out is this effect: | |
− | + | make-f scripts / Makefile.build obj = scripts / kconfig menuconfig | |
− | |||
− | |||
− | |||
− | |||
− | + | I do not know $ (build) variable is how calculated , and later found is this: | |
− | + | @ kernel / Makefile | |
+ | 329 include $ (srctree) / scripts / Kbuild.include | ||
− | |||
− | |||
− | |||
− | @kernel/scripts/Kbuild.include | + | @ kernel / scripts / Kbuild.include |
− | 156 ### | + | 156 # # # |
− | 157 # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj= | + | 157 # Shorthand for $ (Q) $ (MAKE)-f scripts / Makefile.build obj = |
158 # Usage: | 158 # Usage: | ||
− | 159 # $(Q)$(MAKE) $(build)=dir | + | 159 # $ (Q) $ (MAKE) $ (build) = dir |
− | 160 build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj | + | 160 build: =-f $ (if $ (KBUILD_SRC), $ (srctree) /) scripts / Makefile.build obj |
+ | |||
+ | |||
+ | Thus, parsing out the above things , | ||
+ | |||
+ | |||
+ | @ kernel / scripts / Makefile.build | ||
+ | 41 # The filename Kbuild has precedence over Makefile | ||
+ | 42 kbuild-dir: = $ (if $ (filter /%, $ (src)), $ (src), $ (srctree) / $ (src)) | ||
+ | 43 kbuild-file: = $ (if $ (wildcard $ (kbuild-dir) / Kbuild), $ (kbuild-dir) / Kbuild, $ (kbuild-dir) / Makefile) | ||
+ | 44 include $ (kbuild-file) | ||
+ | This will kernel / scripts / kconfig / Makefile included into it. | ||
+ | View file kernel / scripts / kconfig / Makefile I also do not have much to say : | ||
+ | @ scripts / kconfig / Makefile | ||
+ | xconfig: $ (obj) / qconf | ||
+ | $ <$ (Kconfig) | ||
+ | |||
+ | |||
+ | gconfig: $ (obj) / gconf | ||
+ | $ <$ (Kconfig) | ||
− | |||
− | + | menuconfig: $ (obj) / mconf | |
− | + | $ <$ (Kconfig) | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | config: $ (obj) / conf | |
− | + | $ <- Oldaskconfig $ (Kconfig) | |
− | |||
− | |||
− | nconfig: $(obj)/nconf | + | nconfig: $ (obj) / nconf |
− | + | $ <$ (Kconfig) | |
− | |||
− | |||
− | + | oldconfig: $ (obj) / conf | |
− | + | $ <- $ @ $ (Kconfig) | |
− | |||
− | |||
− | + | silentoldconfig: $ (obj) / conf | |
− | + | $ (Q) mkdir-p include / generated | |
− | + | $ <- $ @ $ (Kconfig) | |
− | + | cp-f include / generated / autoconf.h include / linux / autoconf.h | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | cp -f include/generated/autoconf.h include/linux/autoconf.h | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | Point 3 concerns : | ||
+ | . config file will eventually be updated once : Check kernel log | ||
− | mediatek/config/out/s816_bef/autoconfig/kconfig: mediatek/config/mt6575/autoconfig/kconfig/platform | + | [COPY] .. / mediatek/config/out/s816_bef/autoconfig/kconfig -> mediatek-configs |
+ | [COPY] .. / mediatek/config/out/s816_bef/autoconfig/kconfig -> config. | ||
+ | HOSTCC scripts / kconfig / conf.o | ||
+ | SHIPPED scripts / kconfig / zconf.tab.c | ||
+ | SHIPPED scripts / kconfig / lex.zconf.c | ||
+ | SHIPPED scripts / kconfig / zconf.hash.c | ||
+ | HOSTCC scripts / kconfig / zconf.tab.o | ||
+ | HOSTLD scripts / kconfig / conf | ||
+ | scripts / kconfig / conf - silentoldconfig Kconfig | ||
+ | # | ||
+ | # Configuration written to. Config | ||
+ | # | ||
+ | cp-f include / generated / autoconf.h include / linux / autoconf.h | ||
+ | |||
+ | |||
+ | Look kernel config program scripts / kconfig / conf inside the code are: | ||
+ | |||
+ | scripts / kconfig / confdata.c: 66: char * name = getenv ("KCONFIG_CONFIG"); | ||
+ | And @ Makefile | ||
+ | 240: KCONFIG_CONFIG = config?. | ||
+ | export KCONFIG_CONFIG | ||
+ | You can learn this information. | ||
+ | |||
+ | |||
+ | mediatek/config/out/s816_bef/autoconfig/kconfig: mediatek/config/mt6575/autoconfig/kconfig/platform | ||
+ | |||
+ | |||
+ | mediatek / config / common / autoconfig / kconfig / AEE mediatek/config/s816_bef/autoconfig/kconfig/project | ||
− | |||
mediatek/config/out/s816_bef/autoconfig | mediatek/config/out/s816_bef/autoconfig | ||
− | @echo "[CONFIG] generate mediatek/config/out/s816_bef/autoconfig/kconfig" | + | @ echo "[CONFIG] generate mediatek/config/out/s816_bef/autoconfig/kconfig" |
− | @cat mediatek/config/mt6575/autoconfig/kconfig/platform mediatek/config/common/autoconfig/kconfig/AEE | + | @ cat mediatek/config/mt6575/autoconfig/kconfig/platform mediatek / config / common / autoconfig / kconfig / AEE |
+ | |||
+ | |||
+ | mediatek/config/s816_bef/autoconfig/kconfig/project | python mediatek / build / tools / config / merge-kconfig.py> | ||
− | |||
mediatek/config/out/s816_bef/autoconfig/kconfig | mediatek/config/out/s816_bef/autoconfig/kconfig | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | Should be checked : | |
− | + | define. mtk.config.generate-auto-merge-rules | |
− | + | . PHONY:. Mediatek-configs $ (1) | |
+ | mediatek-configs:. mediatek-configs $ (1) | ||
+ | mediatek-configs $ (1):. $ (2) | ||
+ | $ (2): PRIVATE_FILE_LIST: = $ (3) | ||
+ | $ ( 2 ) : $ ( 3 ) $ ( 4 ) | ||
+ | @ echo "[CONFIG] generate $ (2)" | ||
+ | @ cat $ (3) | $ (5)> $ (2) | ||
+ | endef | ||
+ | |||
+ | This should be similar to the $ (call. Mtk.config.generate-auto-merge-rules, kconfig, xx.xx.xx) | ||
+ | More likely is this : $ (. Call mtk.config.generate-auto-rules, xx, xx, xx) | ||
+ | This is necessary to validate themselves . | ||
==Referensi== | ==Referensi== | ||
* http://hubeihuyanwei.blog.163.com/blog/static/28205284201282444441662/ | * http://hubeihuyanwei.blog.163.com/blog/static/28205284201282444441662/ | ||
+ | * https://www.facebook.com/androidevn/posts/823618704330578 |
Latest revision as of 05:50, 31 December 2014
MTK KERNEL BUIDER - Cách tạo kernel hoàn chỉnh cho MTK chip
KConfig Process Concerned about point 1 : kernel builder: @ makeMtk make-f mediatek / build / makemtk.mk kernel
@ mediatek / build / makemtk.mk
kernel / build.sh
@ kernel / build.sh
make mediatek-configs
nice make $ {makeflags} $ {makedefs} silentoldconfig
make $ {makeflags} $ {makejobs} $ {makedefs}
mediatek-configs goal is how original ? : @ kernel / Makefile include $ (srctree) / arch / $ (SRCARCH) / Makefile @ kernel / arch / arm / Makefile include .. / mediatek / build / kernel / Makefile @ mediatek / build / kernel / Makefile . config mediatek-configs: $ (MTK_ROOT_GEN_CONFIG) / kconfig $ (MTK_ROOT_GEN_CONFIG) @ echo "[COPY] $ <-> $ @" @ cp $ <$ @ @ echo "[COPY] $ <->. config" @ cp $ <. config
@ kernel / Kconfig
source "arch / $ SRCARCH / Kconfig"
@ alps / kernel / arch / arm / Kconfig
source ".. / mediatek / source / kernel / Kconfig"
@ alps / mediatek / source / kernel / Kconfig
31 if ARCH_MT6573
32 source "../mediatek/platform/mt6573/kernel/Kconfig/Kernel"
33 source "../mediatek/platform/mt6573/kernel/Kconfig/Board"
34 source "../mediatek/platform/mt6573/kernel/Kconfig/Drivers"
35 endif
@ mediatek/platform/mt6573/kernel/Kconfig/Drivers
34 # Frame Buffer Related
35 menuconfig MTK_FB # FB_MT6516 FB_MT6573
36 bool "MediaTek Framebuffer Driver"
37 depends on FB
38 select FB_CFB_FILLRECT
39 select FB_CFB_COPYAREA
40 select FB_CFB_IMAGEBLIT
41 select FB_SOFT_CURSOR
42 --- help ---
43 This selects the MediaTek (R) frame buffer driver.
44 If you want to use MediaTek (R) frame buffer diver, say Y here.
45 If unsure, say N.
Point 2 concerns :
menuconfig come from ? Explained:
@ alps / kernel / Makefile
% config: scripts_basic outputmakefile FORCE
$ (Q) mkdir-p include / linux include / config
$ (Q) $ (MAKE) $ (build) = scripts / kconfig $ @
Regarding the last of a command : I print out is this effect:
make-f scripts / Makefile.build obj = scripts / kconfig menuconfig
I do not know $ (build) variable is how calculated , and later found is this:
@ kernel / Makefile
329 include $ (srctree) / scripts / Kbuild.include
@ kernel / scripts / Kbuild.include
156 # # #
157 # Shorthand for $ (Q) $ (MAKE)-f scripts / Makefile.build obj =
158 # Usage:
159 # $ (Q) $ (MAKE) $ (build) = dir
160 build: =-f $ (if $ (KBUILD_SRC), $ (srctree) /) scripts / Makefile.build obj
Thus, parsing out the above things ,
@ kernel / scripts / Makefile.build
41 # The filename Kbuild has precedence over Makefile
42 kbuild-dir: = $ (if $ (filter /%, $ (src)), $ (src), $ (srctree) / $ (src))
43 kbuild-file: = $ (if $ (wildcard $ (kbuild-dir) / Kbuild), $ (kbuild-dir) / Kbuild, $ (kbuild-dir) / Makefile)
44 include $ (kbuild-file)
This will kernel / scripts / kconfig / Makefile included into it.
View file kernel / scripts / kconfig / Makefile I also do not have much to say :
@ scripts / kconfig / Makefile
xconfig: $ (obj) / qconf
$ <$ (Kconfig)
gconfig: $ (obj) / gconf
$ <$ (Kconfig)
menuconfig: $ (obj) / mconf
$ <$ (Kconfig)
config: $ (obj) / conf
$ <- Oldaskconfig $ (Kconfig)
nconfig: $ (obj) / nconf
$ <$ (Kconfig)
oldconfig: $ (obj) / conf
$ <- $ @ $ (Kconfig)
silentoldconfig: $ (obj) / conf
$ (Q) mkdir-p include / generated $ <- $ @ $ (Kconfig) cp-f include / generated / autoconf.h include / linux / autoconf.h
Point 3 concerns :
. config file will eventually be updated once : Check kernel log
[COPY] .. / mediatek/config/out/s816_bef/autoconfig/kconfig -> mediatek-configs [COPY] .. / mediatek/config/out/s816_bef/autoconfig/kconfig -> config. HOSTCC scripts / kconfig / conf.o SHIPPED scripts / kconfig / zconf.tab.c SHIPPED scripts / kconfig / lex.zconf.c SHIPPED scripts / kconfig / zconf.hash.c HOSTCC scripts / kconfig / zconf.tab.o HOSTLD scripts / kconfig / conf scripts / kconfig / conf - silentoldconfig Kconfig # # Configuration written to. Config # cp-f include / generated / autoconf.h include / linux / autoconf.h
Look kernel config program scripts / kconfig / conf inside the code are:
scripts / kconfig / confdata.c: 66: char * name = getenv ("KCONFIG_CONFIG"); And @ Makefile 240: KCONFIG_CONFIG = config?. export KCONFIG_CONFIG You can learn this information.
mediatek/config/out/s816_bef/autoconfig/kconfig: mediatek/config/mt6575/autoconfig/kconfig/platform
mediatek / config / common / autoconfig / kconfig / AEE mediatek/config/s816_bef/autoconfig/kconfig/project
mediatek/config/out/s816_bef/autoconfig
@ echo "[CONFIG] generate mediatek/config/out/s816_bef/autoconfig/kconfig"
@ cat mediatek/config/mt6575/autoconfig/kconfig/platform mediatek / config / common / autoconfig / kconfig / AEE
mediatek/config/s816_bef/autoconfig/kconfig/project | python mediatek / build / tools / config / merge-kconfig.py>
mediatek/config/out/s816_bef/autoconfig/kconfig
Should be checked :
define. mtk.config.generate-auto-merge-rules . PHONY:. Mediatek-configs $ (1) mediatek-configs:. mediatek-configs $ (1) mediatek-configs $ (1):. $ (2) $ (2): PRIVATE_FILE_LIST: = $ (3) $ ( 2 ) : $ ( 3 ) $ ( 4 ) @ echo "[CONFIG] generate $ (2)" @ cat $ (3) | $ (5)> $ (2) endef
This should be similar to the $ (call. Mtk.config.generate-auto-merge-rules, kconfig, xx.xx.xx)
More likely is this : $ (. Call mtk.config.generate-auto-rules, xx, xx, xx)
This is necessary to validate themselves .