首先,按照官方的wiki进行编译,我的机器已经编译约10个小时,最终需要多少时间真的根据机器性能不同而不同,最终测试累计编译用时约60小时,好夸张。(实际再次编译用时约2小时即可)
我的机器是如下配置
以编译100ask_imx6ull_defconfig系统镜像为例,使用如下编译步骤
cd Buildroot_2019.02
sudo make clean
sudo make 100ask_imx6ull_defconfig
sudo make all
如果编译失败,加上sudo 即可,很有可能会有意想不到的效果。
我的还算顺利,中间只有一个报错,需要安装一些ELF文件,我的系统能够当时只差一个g++、zbr。
编译过程中:
最终编译成功后的截图:
最后生成的镜像文件:
至此,整个buildroot构建系统编译完成!
分享一下我的编译脚本,首先在ubuntu中运行100ask_update.sh脚本,更新一下软件。
#!/bin/bash
update_software()
{
sudo apt install p7zip-full -y
sudo apt install make -y
sudo apt install gcc -y
sudo apt install g++ -y
sudo apt install lzop -y
sudo apt install python -y
sudo apt install unzip -y
sudo apt install bzr -y
sudo apt-get install -y repo
sudo apt-get install -y git-core
sudo apt-get install -y gitk
sudo apt-get install -y git-gui
sudo apt-get install -y g-boot-tools
sudo apt-get install -y device-tree-compiler
sudo apt-get install -y gcc-aarch64-linux-gnu
sudo apt-get install -y mtools
sudo apt-get install -y parted
sudo apt-get install -y libudev-dev
sudo apt-get install -y libusb-1.0-0-dev
sudo apt-get install -y python-linaro-image-tools
sudo apt-get install -y linaro-image-tools
sudo apt-get install -y autotools-dev
sudo apt-get install -y libsigsegv2
sduo apt-get install -y m4
sudo apt-get install -y curl
sudo apt install -y openssh-client
sudo apt install -y graphviz
sudo apt install -y python-matplotlib
sudo apt install -y libc6:i386
sudo apt install -y libssl-dev
sudo apt install -y liblz4-tool
sudo apt install -y genext2fs
sudo apt install -y lib32stdc++6
sudo apt install -y libncurses5-dev
sudo apt install -y tree
exit 0
}
update_source_software()
{
sudo apt update && sudo apt upgrade -y
update_software
exit 0
}
if [ $# -eq 0 ];then
echo -e "\033[40;32mstart to update software!\033[0m"
sleep 1
update_software
elif
[ $# -eq 1 ];then
echo -e "\033[40;35mStart to update source then update software!\033[0m"
echo -e "\033[40;35mThis will take a few times!\033[0m"
sleep 1
update_source_software
fi
然后,运行buildroot.sh脚本,编译即可。这是我在ubuntu18.04亲测的,完全没有问题。
#!/bin/bash
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-
BUILDROOT_DIR=~/imx6/100ask_imx6ull-sdk/Buildroot_2019.02
echo -e "\033[40;32menter buildroot dir\033[0m"
buildroot_func()
{
cd $BUILDROOT_DIR
sudo make clean
sudo make 100ask_imx6ull_defconfig
sudo make all
cd -
return 0
}
buildroot_func
if [ $? -eq 0 ]
then
echo -e "\033[40;32mfinished buildroot!\033[0m"
echo -e "\033[40;32mfinished buildroot!\033[0m"
echo -e "\033[40;32mfinished buildroot!\033[0m"
else
echo -e "\033[40;32munfinished buildroot!\033[0m"
echo -e "\033[40;32munfinished buildroot!\033[0m"
echo -e "\033[40;32munfinished buildroot!\033[0m"
fi