记录buildroot构建根文件系统中遇到的一些问题

  1. configure: error: you should not run configure as root (set FORCE_UNSAFE_CONFIGURE=1 in environment to bypass this check) make: ***[package/pkggeneric.mk: 231:/home/rbing/linux/ IMX6ULL/tool/buildroot-2019.02.6/output/build/host-tar-1.29/.stamp_configured] 错误 1

解决方法有两种:
1、直接编辑/etc/profile,在最后加入环境变量:
export set FORCE_UNSAFE_CONFIGURE=1
2、sudo make FORCE_UNSAFE_CONFIGURE=1

建议使用第一种

然后遇到问题

  1. Incorrect selection of kernel headers: expected 4.1.x, got 4.0.x
    make[1]: *** [package/pkg-generic.mk:283 /home/rbing/linux/tool/buildroot-2022.02.9/output/build/toolchain-external-custom/.stamp_configured] 错误 1

原因:由于配置buildroot工具链的linux内核版本与工具链本身自带的内核版本标识不一致导致的
解决方法:
首先找到交叉编译链接在哪
whereis arm-linux-gnueabihf-gcc

arm-linux-gnueabihf-gcc: /usr/local/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc

进入交叉工具链安装路径,查找version.h文件

find -name "version.h"
./lib/gcc/arm-linux-gnueabihf/4.9.4/plugin/include/version.h
./arm-linux-gnueabihf/libc/usr/include/linux/dvb/version.h
./arm-linux-gnueabihf/libc/usr/include/linux/version.h

编辑对应的version.h文件

sudo vim ./arm-linux-gnueabihf/libc/usr/include/linux/version.h
#define LINUX_VERSION_CODE 262144

262144的十六进制为40000,因此报错显示4.0.0,而我需要的版本为4.1.x
所以这个地方将十进制改262400,即十六进制的4.1.0
保存退出,重新编译即可

补充:编译下载时缓慢,可以修改国内源的依赖包
在 buildroot 目录下的 .config 文件中替换这些内容

BR2_BACKUP_SITE="http://sources.buildroot.net"
BR2_KERNEL_MIRROR="https://mirrors.aliyun.com/linux-kernel"
BR2_GNU_MIRROR="https://mirrors.aliyun.com/gnu"
BR2_LUAROCKS_MIRROR="https://luarocks.cn"
BR2_CPAN_MIRROR="https://mirrors.aliyun.com/CPAN" 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

冉冰

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值