利用Openwrt编译嵌入式linux
2010-04-13 18:14
579 查看
这段时间在编译Micrel的ARM芯片(KS8695X),之前一直用从官网上下载的linux内核包进行编译,但最近官网上提供的linux2.6.23版本需要gcc3.4.6以上版本编译,而我只有3.4.0版本,到网上下载了很多gcc版本,都不能完全将开发包编译通过。
今天研究了一下openwrt,发现太好用了,以后多用这种方式编译。
gcc
gcc-c++
ncurses
zlib
flex
ncurses-devel
zlib-devel
bison
autoconf
然后运行下面命令下载其他包
svn co svn://svn.openwrt.org/openwrt/tags/8.09 kamikaze_8.09
svn co svn://svn.openwrt.org/openwrt/branches/packages_8.09 packages_8.09
svn co http://x-wrt.googlecode.com/svn/tags/kamikaze_8.09 x-wrt_8.09
最后应该有下面几个目录: openwrt_8.09 kamikaze_8.09 packages_8.09 x-wrt_8.09
今天研究了一下openwrt,发现太好用了,以后多用这种方式编译。
准备工作
需要安装如下安装包:gcc
gcc-c++
ncurses
zlib
flex
ncurses-devel
zlib-devel
bison
autoconf
下载代码
由于Openwrt没有支持Micrel的芯片,故Micrel提供了Openwrt工程文件,从官网上下载一个即可,我从ftp://www.micrel.com/ethernet/8695P/ 下载了openwrt-8.09.1.1-20090904.bz2,然后解压到本地目录,最好解压到openwrt-8.09.然后运行下面命令下载其他包
svn co svn://svn.openwrt.org/openwrt/tags/8.09 kamikaze_8.09
svn co svn://svn.openwrt.org/openwrt/branches/packages_8.09 packages_8.09
svn co http://x-wrt.googlecode.com/svn/tags/kamikaze_8.09 x-wrt_8.09
最后应该有下面几个目录: openwrt_8.09 kamikaze_8.09 packages_8.09 x-wrt_8.09
编译
./openwrt-8.09/link -d kamikaze_8.09/ -p packages_8.09/ -x x-wrt_8.09/ cd kamikaze_8.09 make menuconfig 按照如下选择: Target System Micrel Centaur [2.6] Subtarget KSZ8695X Target Profile Micrel Centaur KSZ8695X GCC版本: Advanced configuration options-->Toolchain Options-->GCC compiler Version The Base system contains application packages that are essential for running the system. The Linux kernel drivers are selected in Kernel modules. The web GUI packages are provided under Administration. 退出保存 然后运行 make 第一次大概会需要1个多小时。结果
编译结果目录: toolchain: staging_dir/toolchain-arm_gcc3.4.6 kernel: linux-micrel_pegasus_ksz9692p/linux-2.6.23.17 applications: build_dir/arm root filesystem: build_dir/arm/root-micrel_pegasus file images: bin bin文件说明 kernel image: openwrt-micrel_centaur-2.6.uImage rootfilelsystem: openwrt-micrel_centaur-squashfs.img root+kernel: openwrt-micrel_centaur-2.6-squashfs.img uboot: u-boot-micrel_centaur-2.6-squashfs.img The built toolchain is under the staging_dir/arm/toolchain-arm_gcc3.4.6 directory. The Linux kernel is built under the /linux-micrel_pegasus_ksz9692p/linux-2.6.23.17 directory. The applications are built under the build_dir/arm directory. The target root filesystem is in build_dir/arm/root-micrel_pegasus directory. The file images are under the bin directory. The file openwrt-micrel_pegasus-2.6.uImage is the kernel image. The file openwrt-micrel_pegasus-squashfs.img is the root filesystem image. The file openwrt-micrel_pegasus-2.6-squashfs.img contains both kernel and root filesystem. This is likely the one to download. The file u-boot-micrel_pegasus-2.6-squashfs.img includes also the U-Boot bootloader.其他
清除可执行 make clean 或者make dirclean 完全清除: make distclean (此方式也将清除所有下载文件,慎用)相关文章推荐
- 使用Visual Studio 利用WinGDB编译和远程调试嵌入式Linux的程序
- 嵌入式Linux下开源路由器OpenWRT编译与下载
- 使用Visual Studio 利用WinGDB编译和远程调试嵌入式Linux的程序
- 嵌入式Linux-根文件系统2_(利用交叉编译工具链,构建/lib目录)
- Ubuntu 14.04 LTS嵌入式交叉编译环境arm-linux-gcc搭建过程图解
- sqlite嵌入式数据库在linux下的编译 (转)
- 基于openSUSE11.0交叉编译嵌入式linux系统产品
- 学会做嵌入式Linux操作系统——交叉编译SNMP
- 嵌入式开发实作(Linux内核编译及安装)
- 利用make CROSS_COMPILE=arm-linux- 编译busybox 出错
- 嵌入式 Linux开发Kernel移植(二)——kernel内核配置和编译
- 在进行嵌入式开发之前,首先要建立一个交叉编译环境,这是一套编译器、连接器和libc库等组成的开发环境。文章通过一个具体的例子说明了这些嵌入式交叉编译开发工具的制作过程。 随着消费类电子产品的大量开发和应用和Linux操作系统的不断健壮和强大,嵌入式系统越来
- 嵌入式Linux下ALSA音频架构ALSA-lib移植与编译心得
- Ubuntu 16.04[64bit]嵌入式交叉编译环境arm-linux-gcc搭建过程图解
- linux 下c 编译和调试 分类: 嵌入式开发学习 2011-03-10 20:33 2433人阅读 评论(0) 收藏
- 开始linux下的编程之旅,原厂SDK&openWRT编译之MTK方案4
- linux下如何利用QtCreator编译ARM版本的Qt程序
- 嵌入式开发实作(Linux内核编译及安装)
- 嵌入式 Linux下GCC编译时如何指定链接库
- 利用Linux内核编译输出信息构建内核源码树