環境: Ubuntu14.10ubuntu
我在編譯u-boot代碼的時候遇到了以下問題:app
LD test/dm/built-in.o CC examples/standalone/stubs.o LD examples/standalone/libstubs.o CC examples/standalone/hello_world.o LD examples/standalone/hello_world OBJCOPY examples/standalone/hello_world.srec OBJCOPY examples/standalone/hello_world.bin LDS u-boot.lds LD u-boot OBJCOPY u-boot.srec OBJCOPY u-boot.bin CFG u-boot.cfg ./scripts/dtc-version.sh: line 17: dtc: command not found ./scripts/dtc-version.sh: line 18: dtc: command not found *** Your dtc is too old, please upgrade to dtc 1.4 or newer Makefile:1298: recipe for target 'checkdtc' failed make: *** [checkdtc] Error 1
從提示信息能夠看到是由於u-boot配置了設備樹,可是在編譯的時候找不到編譯設備樹的工具dtc。dom
那麼,若是我想經過apt-get install 來安裝dtc的話,又該安裝那個軟件包呢?若是直接寫dtc,會出現以下錯誤:工具
pengdl@pengdl-HP:~/work/study/qemu_study/u-boot/u-boot$ sudo apt-get install dtc Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package dtc
顯然沒有叫作dtc的軟件包。ui
解決辦法:this
使用apt-cache search命令,搜索包含有dtc的軟件包的名字:spa
pengdl@pengdl-HP:~/work/study/qemu_study/u-boot/u-boot$ sudo apt-cache search dtc [sudo] password for pengdl: device-tree-compiler - Device Tree Compiler for Flat Device Trees ddtc - Deal with ddts mails dtc-xen - SOAP daemon and scripts to allow control panel management for Xen VMs dtc-xen-firewall - small firewall script for your dom0 sbox-dtc - CGI chroot wrapper script for safer hosting environment
能夠看到,第一個 device-tree-compiler 最合適,正是咱們要找的。
下面安裝這個軟件包:code
pengdl@pengdl-HP:~/work/study/qemu_study/u-boot/u-boot$ sudo apt-get install device-tree-compiler Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: device-tree-compiler 0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. Need to get 356 kB of archives. After this operation, 546 kB of additional disk space will be used. Get:1 http://mirrors.namecheap.com/ubuntu/ utopic/main device-tree-compiler amd64 1.4.0+dfsg-1 [356 kB]
Fetched 356 kB in 12s (27.7 kB/s) Selecting previously unselected package device-tree-compiler. (Reading database ... 305587 files and directories currently installed.) Preparing to unpack .../device-tree-compiler_1.4.0+dfsg-1_amd64.deb ... Unpacking device-tree-compiler (1.4.0+dfsg-1) ... Processing triggers for man-db (2.7.0.2-2) ... Processing triggers for doc-base (0.10.6) ... Processing 2 added doc-base files... Registering documents with scrollkeeper...
安裝完後,就能夠找到dtc這個工具了:orm
pengdl@pengdl-HP:~/work/study/qemu_study/u-boot/u-boot$ which dtc /usr/bin/dtc
再次編譯u-boot:blog
LD common/built-in.o CC drivers/usb/gadget/f_thor.o LD drivers/usb/gadget/built-in.o CC lib/display_options.o LD lib/built-in.o LD u-boot OBJCOPY u-boot.srec OBJCOPY u-boot.bin DTC arch/arm/dts/exynos4210-origen.dtb DTC arch/arm/dts/exynos4210-smdkv310.dtb DTC arch/arm/dts/exynos4210-universal_c210.dtb DTC arch/arm/dts/exynos4210-trats.dtb DTC arch/arm/dts/exynos4412-trats2.dtb DTC arch/arm/dts/exynos4412-odroid.dtb DTC arch/arm/dts/exynos4412-tiny4412.dtb SHIPPED dts/dt.dtb COPY u-boot.dtb CAT u-boot-dtb.bin ===================== WARNING ====================== This board uses CONFIG_DM_I2C_COMPAT. Please remove (possibly in a subsequent patch in your series) before sending patches to the mailing list. ====================================================
能夠看到編譯經過。