TA的每日心情 | 衰 2020-5-31 22:16 |
---|
签到天数: 290 天 连续签到: 1 天 [LV.8]以坛为家I
|
本帖最后由 gurouhu1 于 2017-1-4 23:38 编辑
最近几天在编译的过程中遇到了各种各样的问题,现在特此与大家分享一下。
一、Uboot 编译
在 Ubuntu 终端中,使用 #sudo su 命令,输入密码登录 root 用户。在终端中进入到/dianyu 目录。将 \ 光盘 \linux\ 源代码 \am335x-sdk6.0-uboot-dianyu.tar.gz 拷贝到 Ubuntu 系统中的/dianyu 目录中,然后在终端中执行解压缩命令:- #tar zxvf am335x-sdk6.0-uboot-dianyu.tar.gz
复制代码 解压工作完成后,在/dianyu 目录下自动生成 am335x-sdk6.0-uboot-dianyu 目录。
输入命令:- #cd am335x-sdk6.0-uboot-dianyu
复制代码 进入 am335x-sdk6.0-uboot-dianyu 目录,如图:
执行命令:- <span style="line-height: 1.5;">#make clean</span>
复制代码 清理编译产生的中间文件,第一次运行时会出现下面的情况:
输入命令:- # export PATH=/usr/local/arm/arm-linux-gcc-4.6.1-dianyu/bin/:$PATH
复制代码 再次执行命令:编译 u-boot,执行命令:编译需要一点时间请耐心等待,具体如图:
最终在 am335x-sdk6.0-uboot-dianyu 目录下生成 MLO 和 u-boot.img 文件。这两个文件便是编译出的二进制可执行文件。
二、内核源码编译
先将光盘\linux\源代码\am335x-sdk6.0-kernel-dianyu.tar.gz 拷贝到 Ubuntu 系统中的/dianyu目录中。
在终端中执行命令:执行解压缩命令:- #tar zxvf am335x-sdk6.0-kernel-dianyu.tar.gz
复制代码 解压工作完成后,在 /dianyu目录下自动生成 am335x-sdk6.0-kernel-dianyu 目录。am335x-sdk6.0-kernel-dianyu 目录就
是 linux 内核源码了。
执行命令:- #cd am335x-sdk6.0-kernel-dianyu
复制代码 进入 am335x-sdk6.0-kernel-dianyu 目录。PS:手册里的命令错了,稍微留意一下应该就能发现,具体如图:
执行命令:编译内核,执行命令:执行情况如图:
结果提示u-boot-image不能built,按手册里所述,执行命令:- # sudo apt-get install uboot-mkimage
复制代码 提示如下:
于是无奈中,想尽各种办法,~~~~~
先是折腾了一晚上终于让Ubuntu可以联网访问谷歌了,具体的有需要再细说吧,暂且不表了。
连上网后,再执行命令;- # sudo apt-get install uboot-mkimage
复制代码 提示如下:
- root@dyp:/dianyu/am335x-sdk6.0-kernel-dianyu# sudo apt-get install uboot-mkimageReading package lists... Done
- Building dependency tree
- Reading state information... Done
- Package uboot-mkimage is not available, but is referred to by another package.
- This may mean that the package is missing, has been obsoleted, or
- is only available from another source
- However the following packages replace it:
- u-boot-tools
- E: Package 'uboot-mkimage' has no installation candidate
复制代码 可能自己的Ubuntu是14.04的,继续执行命令,安装u-boot-tools:- # sudo apt-get install u-boot-tools
复制代码 结果如图:
- Reading package lists... Done
- Building dependency tree
- Reading state information... Done
- The following NEW packages will be installed:
- u-boot-tools
- 0 upgraded, 1 newly installed, 0 to remove and 170 not upgraded.
- Need to get 59.7 kB of archives.
- After this operation, 197 kB of additional disk space will be used.
- Err http://mirrors.163.com/ubuntu/ trusty/main u-boot-tools i386 2013.10-3
- Could not resolve 'mirrors.163.com'
- 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'
- E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
- root@dyp:/dianyu/am335x-sdk6.0-kernel-dianyu#
- Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
- CC arch/arm/boot/compressed/decompress.o
- CC arch/arm/boot/compressed/string.o
- SHIPPED arch/arm/boot/compressed/lib1funcs.S
- AS arch/arm/boot/compressed/lib1funcs.o
- LD arch/arm/boot/compressed/vmlinux
- OBJCOPY arch/arm/boot/zImage
- Kernel: arch/arm/boot/zImage is ready
- UIMAGE arch/arm/boot/uImage
- Imag
复制代码 出现各种问题,具体解决办法,参考我的帖子:【电鱼派试用】+安装软件失败,求指点(已自己解决)
安装成功后,执行命令:# export PATH=/usr/local/arm/arm-linux-gcc-4.6.1-dianyu/bin/PATH
#make clean
编译内核,执行命令:执行情况如图:
OK, 编译成功了。
|
|