2013年6月27日 星期四

add a new device in the lunch

執行 build/envsetup.sh 時會 include 一些檔案
including device/amlogic/g02_d7ref/vendorsetup.sh
including device/amlogic/g05_n97ax190ref/vendorsetup.sh
including device/amlogic/vendorsetup.sh
including sdk/bash_completion/adb.bash
其中裡的面的 vendorsetup.sh 是透過ls所列出
# Execute the contents of any vendorsetup.sh files we can find.
for f in `/bin/ls vendor/*/vendorsetup.sh vendor/*/*/vendorsetup.sh device/*/vendorsetup.sh device/*/*/vendorsetup.sh 2> /dev/null`
do
    echo "including $f"
    . $f
done
unset f
因此,在上述指定路徑就可以新增device了

可以看等跟lunch相關的function
add_lunch_combo()
lunch()

以amlogic為例,
$ cp   -r   ./device/amlgoic/g2222ref    ./device/amlogic/newlunch31
再把下列的地方改成『 newlunch31 』即可
./AndroidProducts.mk:30: $(LOCAL_DIR)/newlunch31.mk \
./BoardConfig.mk:94:TARGET_BOOTLOADER_BOARD_NAME := newlunch31
./BoardConfig.mk:114:TARGET_AMLOGIC_RES_PACKAGE := device/amlogic/newlunch31/res_pack
./quilk_build_kernel.sh:14: echo "device/amlogic/newlunch31/quilk_build_kernel.sh bootimage [kernel config] --> build boot.img"
./quilk_build_kernel.sh:15: echo "device/amlogic/newlunch31/quilk_build_kernel.sh recoveryimage [kernel config] --> recovery.img"
./quilk_build_kernel.sh:16: echo "device/amlogic/newlunch31/quilk_build_kernel.sh menuconfig --> open kernel menuconfig"
./quilk_build_kernel.sh:17: echo "device/amlogic/newlunch31/quilk_build_kernel.sh saveconfig --> make defconfig & make savedefconfig"
./quilk_build_kernel.sh:31:PROJECT_NAME=newlunch31
./g2222ref.mk:34:PRODUCT_NAME := newlunch31
./g2222ref.mk:36:PRODUCT_DEVICE := newlunch31
./g2222ref.mk:280:#PRODUCT_COPY_FILES += device/amlogic/newlunch31/dhd.ko:system/lib/dhd.ko
./g2222ref.mk:287:PRODUCT_COPY_FILES += device/amlogic/newlunch31/mali.ko:root/boot/mali.ko
./g2222ref.mk:288:PRODUCT_COPY_FILES += device/amlogic/newlunch31/ump.ko:root/boot/ump.ko
./g2222ref.mk:295:PRODUCT_COPY_FILES += device/amlogic/newlunch31/hci_stp.ko:system/lib/hci_stp.ko
./g2222ref.mk:297:#PRODUCT_COPY_FILES+= device/amlogic/newlunch31/mt6620_fm_drv.ko:system/lib/mt6620_fm_drv.ko
./g2222ref.mk:298:#PRODUCT_COPY_FILES+= device/amlogic/newlunch31/mtk_fm_priv.ko:system/lib/mtk_fm_priv.ko
./g2222ref.mk:300:PRODUCT_COPY_FILES+= device/amlogic/newlunch31/mtk_hif_sdio.ko:system/lib/mtk_hif_sdio.ko
./g2222ref.mk:301:PRODUCT_COPY_FILES+= device/amlogic/newlunch31/mtk_stp_gps.ko:system/lib/mtk_stp_gps.ko
./g2222ref.mk:302:PRODUCT_COPY_FILES+= device/amlogic/newlunch31/mtk_stp_uart.ko:system/lib/mtk_stp_uart.ko
./g2222ref.mk:303:PRODUCT_COPY_FILES+= device/amlogic/newlunch31/mtk_stp_wmt.ko:system/lib/mtk_stp_wmt.ko
./g2222ref.mk:304:PRODUCT_COPY_FILES+= device/amlogic/newlunch31/mtk_wmt_wifi.ko:system/lib/mtk_wmt_wifi.ko
./g2222ref.mk:305:PRODUCT_COPY_FILES+= device/amlogic/newlunch31/wlan_mt6620.ko:system/lib/wlan_mt6620.ko
./g2222ref.mk:367:PRODUCT_COPY_FILES += device/amlogic/newlunch31/libpn544_fw.so:system/lib/libpn544_fw.so
./g2222ref.mk:371:$(call inherit-product-if-exists, vendor/amlogic/newlunch31/device-vendor.mk)
./vendorsetup.sh:1:add_lunch_combo newlunch31-eng
./vendorsetup.sh:2:add_lunch_combo newlunch31-user

如此,在 build/envsetup.sh 時,應該就會有
including device/amlogic/g02_d7ref/vendorsetup.sh
including device/amlogic/g05_n97ax190ref/vendorsetup.sh
including device/amlogic/newlunch31/vendorsetup.sh
including device/amlogic/vendorsetup.sh
including sdk/bash_completion/adb.bash

如此就產生一個新的lunch device了
(  lunch newlunch31 )

make 前最好把  out/host/linux-x86/framework/signapk.jar 和 out/ 下所有的 *.prop 都delete

沒有留言:

張貼留言