Android P新增板型

2021-09-19 07:30:46 字數 2449 閱讀 4080

product_makefiles := \

$(local_dir)/msmnile.mk

他會去呼叫msmnile.mk,因此真正的主編譯檔案是androidboard.mk/

androidproducts.mk/boardconfig.mk,其實這三個是android原生設計的主入口。

我們可以在build目錄中去一**竟。首先我們在編譯android的第一步就是source build/envsetup.sh,其中會有如下操作:

./make/envsetup.sh:1734:49355:for f in `test -d device && find -l device -maxdepth 4 -name 'vendorsetup.sh' 2> /dev/null | sort` \

./make/envsetup.sh:1735:49456: `test -d vendor && find -l vendor -maxdepth 4 -name 'vendorsetup.sh' 2> /dev/null | sort` \

./make/envsetup.sh:1736:49557: `test -d product && find -l product -maxdepth 4 -name 'vendorsetup.sh' 2> /dev/null | sort`

會查詢devcie/vendor和product目錄中是否包含有vendorsetup.sh,並且去執行。一般在乙個板級目錄中會有定義該檔案。

在高通平台上,選擇在乙個通用的common目錄下統一新增板型,比如device/qcom/common/vendorsetup.sh,其中會有關鍵的新增板型的步驟:

add_lunch_combo msmnile-userdebug

add_lunch_combo msmnile_au-userdebug

你可以選擇在該檔案中繼續新增自己的板型,但是這只是乙個選擇而已,也可以在自己對應的板型目錄中新增vendorsetup.s**件,並且把板型資訊寫入來新增板型。

這樣後面我們在lunch的時候就會有對應的板型了。在lunch之後我們其實就已經確定了target_product,那麼target_device是在**定義的呢?

我們從上面的流程知道,lunch最新確定的就是target_product:

envsetup.sh:

function lunch()

根據板型會進行下一步的環境變數的初始化,詳情在build/make/core/product.mk裡面有介紹,我們不再詳述,通過一系列操作,最終會呼叫到androidproducts.mk裡面的一些定義。

build/make/core/product.mk:

define _search-android-products-files-in-dir

$(sort $(shell test -d $(1) && find -l $(1) \

-maxdepth 6 \

-name .git -prune \

-o -name androidproducts.mk -print))

endef

androidproducts.mk比如:

product_name := msmnile

product_device := msmnile

通過product_device就會最終定義了target_device。後面就可以進一步找到boardconfig.mk和androidboard.mk:

./make/core/envsetup.mk:247:

board_config_mk := \

$(strip $(sort $(wildcard \

$(src_target_dir)/board/$(target_device)/boardconfig.mk \

$(shell test -d device && find -l device -maxdepth 4 -path '*/$(target_device)/boardconfig.mk') \

$(shell test -d vendor && find -l vendor -maxdepth 4 -path '*/$(target_device)/boardconfig.mk') \

)))

./make/core/envsetup.mk:264:9562:target_device_dir := $(patsubst %/,%,$(dir $(board_config_mk)))

./make/target/board/android.mk:7:107:-include $(target_device_dir)/androidboard.mk

FCKEditor新增中文字型

fckeditor新增中文字型 預設情況下,fckeditor在進行文字編輯時,無法使用中文字型。開啟 fckconfig.js 檔案 找到第154行 應該是 會發現 程式 fckconfig.fontnames arial comic sans ms courier new tahoma time...

matplotlb新增中文字型

在預設狀態下,matplotlb無法在圖表中使用中文。方法1 用某種中文字型替換掉matplotlib的預設字型 這屬於一種破壞性質的方法,不推薦。這樣的方法,同樣的 無法在不同的環境中使用,每次更換環境你必須得重新 hack 一次。方法2 使用matplotlib的字型管理器指定字型檔案 matp...

linux 新增中文字型

linux 安裝中文字型 1,檢視是否安裝中文字型 fc list lang zh 2,複製windows中文字庫案到linux usr share fonts目錄下 修改字尾為.ttf 使mkfontscale和mkfontdir命令正常執行 3,建立字型索引資訊,更新字型快取 若未安裝 yum ...