///构建文件系统//
make tiny4412_linux_k4_4_defconfig
root@book-virtual-machine:/work/huo_ov5640_camera/buildroot/buildroot# make tiny4412_linux_k4_4_defconfig
mkdir -p /work/huo_ov5640_camera/buildroot/buildroot/output/build/buildroot-config/lxdialog
PKG_CONFIG_PATH="" make CC="/usr/bin/gcc" HOSTCC="/usr/bin/gcc" \
obj=/work/huo_ov5640_camera/buildroot/buildroot/output/build/buildroot-config -C support/kconfig -f Makefile.br conf
make[1]: Entering directory `/work/huo_ov5640_camera/buildroot/buildroot/support/kconfig'
/usr/bin/gcc -DCURSES_LOC="<ncurses.h>" -DLOCALE -I/work/huo_ov5640_camera/buildroot/buildroot/output/build/buildroot-config -DCONFIG_=\"\" -MM *.c > /work/huo_ov5640_camera/buildroot/buildroot/output/build/buildroot-config/.depend 2>/dev/null || :
make[1]: Leaving directory `/work/huo_ov5640_camera/buildroot/buildroot/support/kconfig'
make[1]: Entering directory `/work/huo_ov5640_camera/buildroot/buildroot/support/kconfig'
/usr/bin/gcc -DCURSES_LOC="<ncurses.h>" -DLOCALE -I/work/huo_ov5640_camera/buildroot/buildroot/output/build/buildroot-config -DCONFIG_=\"\" -c conf.c -o /work/huo_ov5640_camera/buildroot/buildroot/output/build/buildroot-config/conf.o
/usr/bin/gcc -DCURSES_LOC="<ncurses.h>" -DLOCALE -I/work/huo_ov5640_camera/buildroot/buildroot/output/build/buildroot-config -DCONFIG_=\"\" -I. -c /work/huo_ov5640_camera/buildroot/buildroot/output/build/buildroot-config/zconf.tab.c -o /work/huo_ov5640_camera/buildroot/buildroot/output/build/buildroot-config/zconf.tab.o
/usr/bin/gcc -DCURSES_LOC="<ncurses.h>" -DLOCALE -I/work/huo_ov5640_camera/buildroot/buildroot/output/build/buildroot-config -DCONFIG_=\"\" /work/huo_ov5640_camera/buildroot/buildroot/output/build/buildroot-config/conf.o /work/huo_ov5640_camera/buildroot/buildroot/output/build/buildroot-config/zconf.tab.o -o /work/huo_ov5640_camera/buildroot/buildroot/output/build/buildroot-config/conf
rm /work/huo_ov5640_camera/buildroot/buildroot/output/build/buildroot-config/zconf.tab.c
make[1]: Leaving directory `/work/huo_ov5640_camera/buildroot/buildroot/support/kconfig'
#
# configuration written to /work/huo_ov5640_camera/buildroot/buildroot/.config
#
root@book-virtual-machine:/work/huo_ov5640_camera/buildroot/buildroot#
make rootfs-ext4_tiny4412 FORCE_UNSAFE_CONFIGURE=1
make distclean
make clean
make linux
make toolchain
make list-defconfigs //查看当前支持的开发板
git://git.buildroot.net/buildroot
步骤:
1. 查看是否有直接可用的单板配置,若有,则make tiny4412_linux_k4_4_defconfig。若没有,则自己构建
2.
buildroot构建文件系统的原理:
1. 将system目录下的skelenton拷贝到./output/target目录下
2. 将output/staging目录下动态工具链拷贝到./output/target目录下对应的文件
3. 分别编译package目录下每个文件,得到的bin拷贝到./output/target目录下对应的文件 (部分工作由用户去完成)
4. 将packet/initscripts目录下的文件拷贝到./output/target目录下对应的文件
5. 构建fakeroot,并使用比如ext4的脚本去制作ext4的文件系统
///构建内核//
make linux
只需配置好make menuconfig的kernel选项~
总结:
制作kernel很简单,制作文件系统也不复杂,但是整个制作过程很耗费时间,可能是packet包比较多,其中还包括编译这些包和kernel的时间!
问题点:
问:packet目录的运行原理?
答:编译不过时,找到对应的宏(比如BR2_PACKAGE_LIBFFI,主要是根据该packet包目录下的config.in文件里的宏确定),再Makefile里去掉。或者新增packet时,需手动修改config.in增加,并make menuconfig选中
原理就是根据make menuconfig里的配置,去packet目录下找对应的安装包,后执行对应的操作.不仅下载,下载完还会编译生成库和bin文件
问:如何避免每次编译都得重新下载packet包
答:尽量别make clean。make clean后一定会重新下载的。最好的方法是将packet包放在统一的地址统一进行维护
问:如何添加一个packet包
答:
问:如何到我指定的目录下去获取包
答:
问:output目录介绍
答:build host images staging target
build: 基本是安装过程中下载下来的源码包
host:?
images:生成的文件系统包
staging:应该是会拷贝到target目录下的?
target:文件系统里的具体文件
问:编译buildroot所用的编译器是
答:make menuconfig以下指定:
Toolchain type (External toolchain) ---> | |
| | *** Toolchain External Options *** | |
| | Toolchain (Linaro arm-linux-gnueabihf-gcc 4.9.4) --->
错误一:
>>> skeleton Extracting
>>> skeleton Patching
>>> skeleton Configuring
>>> skeleton Building
>>> skeleton Installing to target
>>> toolchain-external-linaro-arm-gcc4-eabihf 2017.01 Downloading
cp: cannot stat `/home/git/3rd-pkg/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf.tar.xz': No such file or directory
--2019-02-11 15:07:32-- https://releases.linaro.org/components/toolchain/binaries/4.9-2017.01/arm-linux-gnueabihf/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf.tar.xz
Resolving releases.linaro.org (releases.linaro.org)... 13.228.101.204
Connecting to releases.linaro.org (releases.linaro.org)|13.228.101.204|:443... connected.
ERROR: cannot verify releases.linaro.org's certificate, issued by `/C=US/O=Let\'s Encrypt/CN=Let\'s Encrypt Authority X3':
Issued certificate has expired.
ERROR: no certificate subject alternative name matches
requested host name `releases.linaro.org'.
To connect to releases.linaro.org insecurely, use `--no-check-certificate'.
--2019-02-11 15:07:33-- http://sources.buildroot.net/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf.tar.xz
Resolving sources.buildroot.net (sources.buildroot.net)... 104.25.210.19, 104.25.211.19, 2606:4700:20::6819:d313, ...
Connecting to sources.buildroot.net (sources.buildroot.net)|104.25.210.19|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2019-02-11 15:07:38 ERROR 404: Not Found.
make: *** [/work/huo_ov5640_camera/buildroot-es_udk-master/output/build/toolchain-external-linaro-arm-gcc4-eabihf-2017.01/.stamp_downloaded] Error 1
原因:
/home/git/3rd-pkg/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf.tar.xz下没有该文件,所以从官网去下载
解决方法:
自己从网站上下载文件并放到/home/git/3rd-pkg目录下
错误二:
configure: error: you should not run configure as root (set FORCE_UNSAFE_CONFIGURE=1 in environment to bypass this check)
解决方法: 设置 FORCE_UNSAFE_CONFIGURE 值为1
make rootfs-ext4_tiny4412 FORCE_UNSAFE_CONFIGURE=1
错误三:
Makefile.legacy:9: *** "You have legacy configuration in your .config! Please check your configuration.". Stop.
未解决,可能是xxx_defconfig有错误,换一个其它的xxx_defconfig后正常
杂项:
ftp://ftp.denx.de/pub/u-boot/u-boot-2018.01.tar.bz2
居然还会下载uboot代码!!!!!!!!!
git@github.com:zczjx/linux-4.4.38-for-tiny4412.git
https://github.com/zczjx/linux-4.4.38-for-tiny4412
现状:
能构建内核,文件系统(???????????用原版的buildroot去试)以及将uboot,内核,文件系统打包
Toolchain (Linaro arm-linux-gnueabihf-gcc 4.9.4) --->
构建内核
make menuconfig ------- 失败
文件系统
make ????? ------- 失败
欠缺:
1. 没有能力自己构建xxx_defconfig配置文件,只能基于现有的配置上进行更改
2. 制作一个现有的交叉工具链(比如从友善的官网获得)。无法从0制作一个稳定的交叉编译器 -------- 没有必要从0开始制作文件系统
构建内核
make menuconfig ------- 失败 ---------- 照葫芦画瓢应该能搞定
文件系统
make ????? ------- 失败 ---------- 照葫芦画瓢应该能搞定
一知半解.............