查看: 3585|回复: 0

【电鱼派试用】+编译源码

[复制链接]
  • TA的每日心情

    2020-5-31 22:16
  • 签到天数: 290 天

    连续签到: 1 天

    [LV.8]以坛为家I

    发表于 2017-1-4 22:34:41 | 显示全部楼层 |阅读模式
    分享到:
    本帖最后由 gurouhu1 于 2017-1-4 23:38 编辑

    最近几天在编译的过程中遇到了各种各样的问题,现在特此与大家分享一下。

    一、Uboot 编译

         在 Ubuntu 终端中,使用  #sudo su  命令,输入密码登录 root 用户。在终端中进入到/dianyu  目录。将  \ 光盘 \linux\ 源代码 \am335x-sdk6.0-uboot-dianyu.tar.gz  拷贝到 Ubuntu 系统中的/dianyu  目录中,然后在终端中执行解压缩命令:
    1. #tar zxvf am335x-sdk6.0-uboot-dianyu.tar.gz
    复制代码
    解压工作完成后,在/dianyu 目录下自动生成 am335x-sdk6.0-uboot-dianyu 目录。

    输入命令:
    1. #cd am335x-sdk6.0-uboot-dianyu
    复制代码
    进入 am335x-sdk6.0-uboot-dianyu 目录,如图:
    03.JPG



    执行命令:
    1. <span style="line-height: 1.5;">#make clean</span>
    复制代码
    清理编译产生的中间文件,第一次运行时会出现下面的情况:
    04.JPG


    输入命令:
    1. # export PATH=/usr/local/arm/arm-linux-gcc-4.6.1-dianyu/bin/:$PATH
    复制代码
    再次执行命令:
    1. #make clean
    复制代码
    编译 u-boot,执行命令:
    1. #make am335x_evm
    复制代码
    编译需要一点时间请耐心等待,具体如图:
    05.JPG 06.JPG 07.JPG



    最终在  am335x-sdk6.0-uboot-dianyu  目录下生成 MLO 和 u-boot.img 文件。这两个文件便是编译出的二进制可执行文件。


    二、内核源码编译

    先将光盘\linux\源代码\am335x-sdk6.0-kernel-dianyu.tar.gz  拷贝到 Ubuntu 系统中的/dianyu目录中。
    在终端中执行命令:
    1. #cd   /dianyu
    复制代码
    执行解压缩命令:
    1. #tar zxvf am335x-sdk6.0-kernel-dianyu.tar.gz
    复制代码
    解压工作完成后,在  /dianyu目录下自动生成  am335x-sdk6.0-kernel-dianyu  目录。am335x-sdk6.0-kernel-dianyu  目录就
    是 linux 内核源码了。
    执行命令:
    1. #cd am335x-sdk6.0-kernel-dianyu
    复制代码
    进入 am335x-sdk6.0-kernel-dianyu  目录。PS:手册里的命令错了,稍微留意一下应该就能发现,具体如图:
    08.JPG 09.JPG 10.JPG


    执行命令:
    1. #make clean
    复制代码
    编译内核,执行命令:
    1. #make uImage
    复制代码
    执行情况如图:
    11.JPG 12.JPG 13.JPG


    结果提示u-boot-image不能built,按手册里所述,执行命令:
    1. # sudo apt-get install uboot-mkimage
    复制代码
    提示如下:
    14.JPG

    于是无奈中,想尽各种办法,~~~~~
    先是折腾了一晚上终于让Ubuntu可以联网访问谷歌了,具体的有需要再细说吧,暂且不表了。

    连上网后,再执行命令;
    1. # sudo apt-get install uboot-mkimage
    复制代码
    提示如下:
    21.JPG
    1. root@dyp:/dianyu/am335x-sdk6.0-kernel-dianyu# sudo apt-get install uboot-mkimageReading package lists... Done
    2. Building dependency tree      
    3. Reading state information... Done
    4. Package uboot-mkimage is not available, but is referred to by another package.
    5. This may mean that the package is missing, has been obsoleted, or
    6. is only available from another source
    7. However the following packages replace it:
    8.   u-boot-tools

    9. E: Package 'uboot-mkimage' has no installation candidate
    复制代码
    可能自己的Ubuntu是14.04的,继续执行命令,安装u-boot-tools:
    1. # sudo apt-get install u-boot-tools
    复制代码
    结果如图:
    23.JPG
    1. Reading package lists... Done
    2. Building dependency tree      
    3. Reading state information... Done
    4. The following NEW packages will be installed:
    5.   u-boot-tools
    6. 0 upgraded, 1 newly installed, 0 to remove and 170 not upgraded.
    7. Need to get 59.7 kB of archives.
    8. After this operation, 197 kB of additional disk space will be used.
    9. Err http://mirrors.163.com/ubuntu/ trusty/main u-boot-tools i386 2013.10-3
    10.   Could not resolve 'mirrors.163.com'
    11. E: Failed to fetch http://mirrors.163.com/ubuntu/pool/main/u/u-boot/u-boot-tools_2013.10-3_i386.deb  Could not resolve 'mirrors.163.com'

    12. E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
    13. root@dyp:/dianyu/am335x-sdk6.0-kernel-dianyu#



    14. Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?


    15. CC      arch/arm/boot/compressed/decompress.o
    16.   CC      arch/arm/boot/compressed/string.o
    17.   SHIPPED arch/arm/boot/compressed/lib1funcs.S
    18.   AS      arch/arm/boot/compressed/lib1funcs.o
    19.   LD      arch/arm/boot/compressed/vmlinux
    20.   OBJCOPY arch/arm/boot/zImage
    21.   Kernel: arch/arm/boot/zImage is ready
    22.   UIMAGE  arch/arm/boot/uImage
    23. Imag
    复制代码
    出现各种问题,具体解决办法,参考我的帖子:【电鱼派试用】+安装软件失败,求指点(已自己解决)

    安装成功后,执行命令:# export PATH=/usr/local/arm/arm-linux-gcc-4.6.1-dianyu/bin/PATH
    #make clean

    编译内核,执行命令:
    1. #make uImage
    复制代码
    执行情况如图:

    28.JPG 29.JPG


    OK, 编译成功了。

    回复

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /2 下一条

    手机版|小黑屋|与非网

    GMT+8, 2024-4-20 10:23 , Processed in 0.114323 second(s), 16 queries , MemCache On.

    ICP经营许可证 苏B2-20140176  苏ICP备14012660号-2   苏州灵动帧格网络科技有限公司 版权所有.

    苏公网安备 32059002001037号

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.