使用Buildroot为Nxp i.mx6ul制作文件系统
随着神U s3c2440,6410的停产,NXP 针对中国市场推出低成本方案i.mx6ul,可用于商业级和工业级应用,10年超长供货周期,市场很有潜力。
官方只支持Yocto,但个人感觉Yocto太多庞大且太复杂,而工业市场业务并不是特别负责,需要用到的软件包有限,且在特定的一个范围。工业市场
对稳定性要求较高,并不需很大的灵活度。
本文将介绍使用Buildroot为i.mx6制作文件系统,相对来说Buildroot较为简单,容易理解,且有接近2千种包支持,稳定性也不是问题。
移植Buildroot前,需要先了解i.mx6体系结构,本文移植基于米尔科技的i.mx6ulx开发板,256MB Nand,256MB RAM,支持SD卡;
i.mx6ul 为Cortex-A7架构,支持Neon;
前序:
在制作文件系统之前,先了解一下几个基本概念。
Uboot:引导操作系统之用;
Linux Kernel:内核,主要关注其稳定性,其中接口驱动最为重要,一般使用官方的Release包,因为官方在标准的Kernel之上针对自家芯片做了一系列的优化工作,且有很多厂商的应用案例,其稳定性得到了一定的验证;不建议使用标准的kernel,尤其是接口驱动稳定性得不到保证。
文件系统:可以看成一系列基本命令的集合,如:ps,insmod,netstat,iptables,ifconfig等等;我们所开发的应用程序也会包含在文件系统之中,并且将使用到文件系统所提供的基本命令和各种标准库以及第三方库等;
制作文件系统:有很多方法,Buildroot和Yocto只是一个辅助框架,其本身已经设定好编译环境,且支持多种平台,可以很方便的帮助用户为特定的平台制作文件系统。当然也可以自行手动建立,文件系统无非就是一堆文件的集合,自行手动编译,打包即可;只是比较耗费精力,稳定性和移植性也得不到保证;所以一般情况下,我们会选用Buildroot等框架辅助我们建立文件系统;
第一步:
- 下载Buildroot包:
从Buildroot官网下载 https://buildroot.org/download.html
第二步:
- make menuconfig 配置相关选项
- CPU架构配置,i.mx6ul为小端格式,Cortex-a7架构,浮点运算EABIHf,VFPv4
Target Architecture (ARM (little endian)) ---> x x Target Binary Format (ELF) ---> x x Target Architecture Variant (cortex-A7) ---> x x Target ABI (EABIhf) ---> x x Floating point strategy (VFPv4-D16) ---> x x ARM instruction set (ARM) --->
- Build Options: 编译选项主要是package下载位置,默认dl目录,主要是配置共享库,shared only
gcc optimization level (optimize for size) ---> x x build code with Stack Smashing Protection (None) --->x x libraries (shared only) --->
- Toolchain: 交叉编译工具链,使用NXP 官方提供的即可。根据实际情况设定gcc version和kernel header version;
- gcc version可以在主机上使用arm-linux-gnueabihf -v查看
rget/arm-linux-gnueabihf/_build/builds/destdir/x86_64-unknown-linux-gnu Thread model: posix gcc version 4.9.3 20141031 (prerelease) (Linaro GCC 2014.11)
- kernel header version在工具链目录的xxx/libc/include/linux/version.h;
cat /opt/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/libc/usr/include/linux/version.h #define LINUX_VERSION_CODE 200960 #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
200960 转换为Hex格式0x31100;即3.11.0 版本;但编译过程中Buildroot貌似会自动判断Linux Version,我的主机自动判断是3.17,因此我选择3.17版本;此处还有待考察;
Toolchain type (External toolchain) ---> x xx x *** Toolchain External Options *** x xx x Toolchain (Custom toolchain) ---> x xx x Toolchain origin (Pre-installed toolchain) ---> x xx x (/opt/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/) Toolchain path x xx x ($(ARCH)-linux-gnueabihf) Toolchain prefix x xx x External toolchain gcc version (4.9.x) ---> x xx x External toolchain kernel headers series (3.17.x) ---> x xx x External toolchain C library (glibc/eglibc) --->
注意使能MMU
[*] Enable MMU support
- System configuration:主要是些hostname,banner,busybox,password,console等一些配置
(buildrootbywind) System hostname x xx x (Welcome to Buildroot by wind) System banner x xx x Passwords encoding (md5) ---> x xx x Init system (BusyBox) ---> x xx x /dev management (Dynamic using devtmpfs + eudev) ---> x xx x (system/device_table.txt) Path to the permission tables x xx x [ ] support extended attributes in device tables x xx x [ ] Use symlinks to /usr for /bin, /sbin and /lib x xx x [*] Enable root login with password x xx x (123456) Root password x xx x /bin/sh (bash) ---> x xx x [*] Run a getty (login prompt) after boot --->
需要注意的地方有2点:bash 和 tty的选择; nxp的tty默认是/dev/ttymxc0;
选择Bash前需打开Show packages that are alse provideed by busybox; 位于Target Package 下-*- BusyBox x xx x (package/busybox/busybox.config) BusyBox configuration file to use? x xx x () Additional BusyBox configuration fragment files x xx x [*] Show packages that are also provided by busybox
tty配置为:
--- Run a getty (login prompt) after boot x xx x (/dev/ttymxc0) TTY port x xx x Baudrate (keep kernel default) ---> x xx x (vt100) TERM environment variable x xx x () other options to pass to getty
- 剩下就是Filesystem image配置:主要选择文件系统类型,以及相关参数
Ext2/3/4支持:[*] ext2/3/4 root filesystem x xx x ext2/3/4 variant (ext4) ---> x xx x () filesystem label x xx x (60M) exact size x xx x (0) exact number of inodes (leave at 0 for auto calculation) x xx x (5) reserved blocks percentage x xx x (-O ^64bit) additional mke2fs options x xx x Compression method (no compression) --
- tar 和Ubifs支持,我的板子为256M Nand,使用ubifs,因此必须选择
[*] tar the root filesystem x xx x Compression method (no compression) ---> x xx x () other random options to pass to tar x xx x [*] ubifs root filesystem x xx x (0x1f800) logical eraseblock size x xx x (0x800) minimum I/O unit size x xx x (2048) maximum logical eraseblock count x xx x ubifs runtime compression (lzo) ---> x xx x Compression method (no compression) --->
UBI文件系统主要参数根据实际NAND参数来配置即可;
- Target packages中是一些开源软件,自行根据需要来配置;
至此,配置完毕;
第三步:
make all编译;
输出结果位于output/images 下
烧写文件系统:具体烧写方式请见我另一篇博文 对于ARM的启动,系统升级,烧写过程和文件系统等方面的总结分析
使用Buildroot为Nxp i.mx6ul制作文件系统相关推荐
- linux 使用buildroot制作文件系统
可以用busybox 或者buildroot等工具 制作文件系统 以下参考陈富林博客使用buildroot制作文件系统 写的比较详细 记录一下 https://www.cnblogs.com/ ...
- [2]-使用busybox-1.17.2制作文件系统
为什么80%的码农都做不了架构师?>>> 使用busybox-1.17.2来制作文件系统 交叉编译工具:arm-linux-gcc-3.4.1 (已经导入到PATH环境变量中) ...
- 使用make_ext4fs制作文件系统时写入文件安全上下文的方法
make_ext4fs是谷歌为了在Android平台上制作ext4文件系统的镜像而开发的工具,也可以用于Linux平台上的镜像打包.安卓平台上,用make_ext4fs制作镜像的过程被封装在源码的脚本 ...
- Busybox 制作文件系统并用 Qemu 启动编译的内核镜像
编译内核操作: https://blog.csdn.net/assiduous_me/article/details/120938556 安装Busybox操作: https://blog.csdn. ...
- 【Linux 系统】文件系统--- Buildroot 从零开始制作文件系统 史上最详细
文章目录 一.基本信息 二.需要的软件 三.使用 buildroot 制作根文件系统 1.拷贝 buildroot-2020.02.4.tar.bz2 四.选择配置并生成 .config文件 1.选择 ...
- emmc linux 识别分区_linux下给U盘分区并制作文件系统
初探 不同于Ubuntu/Win等桌面发行版本,服务器型(非图形化系统)的linux系统通常不主动挂载U盘,因此当U盘插入后是不会有任何提示的,那我们如何知道U盘是否被系统所识别呢? 那就只能查看系统 ...
- 用busybox制作文件系统
busybox1.25.1 arm-linux-gcc -v 3.4.5 先执行 #make menuconfig Location: -> Busybox Settings - ...
- linux下u盘分区合并,linux下给U盘分区并制作文件系统-u盘文件系统
初探 不同于Ubuntu/Win等桌面发行版本,服务器型(非图形化系统)的linux系统通常不主动挂载U盘,因此当U盘插入后是不会有任何提示的,那我们如何知道U盘是否被系统所识别呢? 那就只能查看系统 ...
- u盘第一扇区 分区表_linux下给U盘分区制作文件系统
这几天读到TLCL-Storage Media一节,不由的想要折腾一下U盘,一直以来U盘只是被拿来暂存数据,其内部有没有文件系统,数据怎么管理,那是从来也不清楚,本文就依葫芦画瓢,折腾下手中的King ...
最新文章
- 变分贝叶斯variable bayes 和EM算法关系
- java循环队列_java实现循环队列(顺序队列)
- [UVa1213]Sum of Different Primes(递推,01背包)
- Android系统服务
- JVM-Java程序性能监控-初级篇
- SAP Spartacus cxOutlet里的元数据存储,outlet名称和待渲染Component的映射关系
- 【站点部署】解析二级域名并部署站点
- 生活中常见物联网实例_物联网网关常见问题解答(一)
- leetcode226. 翻转二叉树
- 对I2C总线协议的一些理解
- 联想服务器imm默认地址_命令下配置ip地址
- 第三方依赖关系的风险:利用数十个易受攻击的 NuGet包瞄准 .NET 平台
- amd服务器开启虚拟化,记一次 AMD 虚拟化 IOMMU 开启过程
- 过椭圆外一点引两条切线方程_S16-2 二次曲线和圆方程
- 【华为云技术分享】LwM2M协议的学习与分享
- shell 脚本获取时间戳
- .net下如何压缩图片大小,超简单
- 阿里云Centos8 yum报错Failed to synchronize cache for repo ‘BaseOS‘解决方案,通过换文件的方式来解决。
- 使用爬虫爬取某电影分享网站最新电影链接 -- 基于Python Requests库
- 8.2计算各商品销售金额