- 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
建议使用第一种
然后遇到问题
- 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"