文章目录
- 0. 前言
- 10. 环境
- 20. Buildroot 环境搭建
- 80. 问题点
-
- 1. 编译、清除时提示权限不足
- 2. You must install 'python' on your build machine
- 3. configure: error: you should not run configure as root (set FORCE_UNSAFE_CONFIGURE=1 in environment to bypass this check)
- 4. error: ‘numeric_limits’ is not a member of ‘std’
- 5. c-stack.c:55:26: error: missing binary operator before token "("
- 6. Incorrect selection of kernel headers: expected 4.1.x, got 4.0.x
0. 前言
对嵌入式linux开发和linux开发环境不熟悉的同志们就不要往下看了
对嵌入式linux开发和linux开发环境不熟悉的同志们就不要往下看了
对嵌入式linux开发和linux开发环境不熟悉的同志们就不要往下看了
10. 环境
软件
ubuntu1804 / ubuntu2204
buildroot-2023.02.3
toolchain:gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf
硬件
alientek - alpha
arm , A7
20. Buildroot 环境搭建
简述
除了内核还需要文件系统,而这个工具就是帮你构建这个系统的,避免了手动添加一些文件夹、三方软件的烦恼。可以直接构建出包含boot、kernel、rootfs和三方软件的镜像。
下载
下载地址:https://buildroot.org/
下载后文件名为“buildroot-2023.02.3.tar.gz”,解压后即可得到工程
环境搭建
toolchain下载、安装
下载地址:(以个人实际编译器为准,这里仅仅是拿这个alpha的开发板来说明)
https://releases.linaro.org/components/toolchain/binaries/4.9-2017.01/arm-linux-gnueabihf/
安装:直接解压 /usr/local/arm (这些乱七八糟的地址都可以自己指定,下面就不赘述了)
- GCC完整路径参考:/usr/local/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin
- 环境配置:在系统profile中、个人bashrc中添加toolchain路径,
2.1 文件:/etc/profile 或者 ~/.bashrc (或者其他shell)
2.2 修改路径:export PATH=$PATH:/usr/local/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin
构建镜像(仅供参考)
- 配置环境
- make menuconfig // 配置各项信息
Target options // 目标信息,如平台、指令集等
Toolchain // 交叉编译器,一般使用本地构建好的交叉编译器
Build options // 指定Download路径等配置,默认也可以
System configuration // 配置启动流程等一些,如init0 mdev 密码等
Kernel // 构建kernel,不用它构建
Target packages // 按需添加,事后添加也可以
Filesystem images // 指定文件系统等,如ubifs ,extX ,jffs2等
Bootloaders // 构建uboot等bootloader,不用它构建
Host utilities // 工具包,如dos2linux之类
Legacy config options // 顾名思义
- 主要配置项
Target options
Toolchain
System configuration
Kernel
Target packages
Bootloaders
Target options // 配置开发板信息
Target Architecture (ARM (little endian)) --->
Target Architecture Variant (cortex-A7<

本文详细介绍了如何在Ubuntu和Buildroot环境下搭建嵌入式Linux开发环境,包括下载、安装工具链、配置和编译过程。同时列举了在搭建过程中遇到的常见问题及其解决方案,如权限不足、Python依赖和头文件版本冲突等。
最低0.47元/天 解锁文章
2800

被折叠的 条评论
为什么被折叠?



