task chain 構(gòu)建
base.class
148 addtask fetch
149 do_fetch[dirs] = "${DL_DIR}"
150 do_fetch[file-checksums] = "${@bb.fetch.get_checksum_file_list(d)}"
151 do_fetch[file-checksums] += " ${@get_lic_checksum_file_list(d)}"
152 do_fetch[vardeps] += "SRCREV"
153 python base_do_fetch() {
154 +-- 11 lines: src_uri = (d.getVar('SRC_URI') or "").split()-----------------------------------------------------------------------------------------------------------------------------------------------------
165
166 addtask unpack after do_fetch
167 do_unpack[dirs] = "${WORKDIR}"
168
>>169 do_unpack[cleandirs] = "${@d.getVar('S') if os.path.normpath(d.getVar('S')) != os.path.normpath(d.getVar('WORKDIR')) else os.path.join('${S}', 'patches')}"
170
171 python base_do_unpack() {
172 +-- 10 lines: src_uri = (d.getVar('SRC_URI') or "").split()-----------------------------------------------------------------------------------------------------------------------------------------------------
182
304 addtask configure after do_patch
305 do_configure[dirs] = "${B}"
306 base_do_configure() {
307 +-- 16 lines: if [ -n "${CONFIGURESTAMPFILE}" -a -e "${CONFIGURESTAMPFILE}" ]; then-----------------------------------------------------------------------------------------------------------------------------
323
324 addtask compile after do_configure
325 do_compile[dirs] = "${B}"
326 base_do_compile() {
327 +-- 6 lines: if [ -e Makefile -o -e makefile -o -e GNUmakefile ]; then-----------------------------------------------------------------------------------------------------------------------------------------
333
334 addtask install after do_compile
335 do_install[dirs] = "${B}"
336 # Remove and re-create ${D} so that is it guaranteed to be empty
337 do_install[cleandirs] = "${D}"
338
>>339 base_do_install() {
--340 :
341 }
347 addtask build after do_populate_sysroot
348 do_build[noexec] = "1"
349 do_build[recrdeptask] += "do_deploy"
>>350 do_build () {
--351 :
352 }
720 addtask cleansstate after do_clean
721 python do_cleansstate() {
722 +-- 2 lines: sstate_clean_cachefiles(d)------------------------------------------------------------------------------------------------------------------------------------------------------------------------
724 addtask cleanall after do_cleansstate
725 do_cleansstate[nostamp] = "1"
726
727 python do_cleanall() {
728 +-- 10 lines: src_uri = (d.getVar('SRC_URI') or "").split()-----------------------------------------------------------------------------------------------------------------------------------------------------
738 do_cleanall[nostamp] = "1"
739
patch.bbclass
96 python patch_do_patch() {
97 +-- 66 lines: import oe.patch-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
163 patch_do_patch[vardepsexclude] = "PATCHRESOLVE"
164
165 addtask patch after do_unpack
166 do_patch[dirs] = "${WORKDIR}"
167 do_patch[depends] = "${PATCHDEPENDENCY}"
staging.bbclass
94 addtask populate_sysroot after do_install
95
96 SYSROOT_PREPROCESS_FUNCS ?= ""
97 SYSROOT_DESTDIR = "${WORKDIR}/sysroot-destdir"
98
99 python do_populate_sysroot () {
100 +-- 16 lines: SYSROOT 'version' 2---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
116
utility-tasks.bbclass
23 addtask clean
24 do_clean[nostamp] = "1"
25 python do_clean() {
26 +-- 12 lines: """clear the build and temp directories"""----------------------------------------------------------------------------------------------------------------------------------------------------------
38
這樣就形成了2條鏈條:
- fetch ----> unpack -----> patch ----> configure ----> compile ----> install ----> populate_sysroot ----> build
- clean ----> cleansstate ----> cleanall
繼承
4 inherit patch
5 inherit staging
7 inherit mirrors
8 inherit utils
9 inherit utility-tasks
10 inherit metadata_scm
11 inherit logging
事件處理器
>>226 addhandler base_eventhandler
>>227 base_eventhandler[eventmask] = "bb.event.ConfigParsed bb.event.MultiConfigParsed bb.event.BuildStarted bb.event.RecipePreFinalise bb.event.RecipeParsed"
228 python base_eventhandler()
匿名邏輯(默認(rèn)處理)
- Handle backfilling
- Handle PACKAGECONFIG
- ....