008-BSP学习笔记-buildroot构建

一、下载编译

make menuconfig
1、配置 Target options
 Target options
-> Target Architecture = ARM (little endian)
-> Target Binary Format = ELF
-> Target Architecture Variant = cortex-A7
-> Target ABI = EABIhf
-> Floating point strategy = NEON/VFPv4
-> ARM instruction set = ARM
2、配置Toolchain
 Toolchain
-> Toolchain type = External toolchain
-> Toolchain = Custom toolchain //用户自己的交叉编译器
-> Toolchain origin = Pre-installed toolchain //预装的编译器
-> Toolchain path =/usr/local/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf
-> Toolchain prefix = $(ARCH)-linux-gnueabihf //前缀
-> External toolchain gcc version = 4.9.x
-> External toolchain kernel headers series = 4.1.x
-> External toolchain C library = glibc/eglibc
-> [*] Toolchain has SSP support? (NEW) //选中
-> [*] Toolchain has RPC support? (NEW) //选中
-> [*] Toolchain has C++ support? //选中
-> [*] Enable MMU support (NEW) //选中
3、配置System configuration
System configuration
-> System hostname = alpha_imx6ull //平台名字,自行设置
-> System banner = Welcome to alpha i.mx6ull //欢迎语
-> Init system = BusyBox //使用 busybox
-> /dev management = Dynamic using devtmpfs + mdev //使用 mdev
-> [*] Enable root login with password (NEW) //使能登录密码
-> Root password = 123456 //登录密码为 123456
4、配置Filesystem images
-> Filesystem images
-> [*] ext2/3/4 root filesystem //如果是 EMMC 或 SD 卡的话就用 ext3/ext4
-> ext2/3/4 variant = ext4 //选择 ext4 格式
-> [*] ubi image containing an ubifs root filesystem //如果使用 NAND 的话就用 ubifs
5、禁止编译 Linux 内核和 uboot
-> Kernel
-> [ ] Linux Kernel //不要选择编译 Linux Kernel 选项!
-> Bootloaders
-> [ ] U-Boot //不要选择编译 U-Boot 选项!
6、配置Target packages

此选项用于配置要选择的第三方库或软件、比如 alsa-utils、 ffmpeg、 iperf 等工具,但是现
在我们先不选择第三方库,防止编译不下去!先编译一下最基本的根文件系统,如果没有问题
的话再重新配置选择第三方库和软件

7、编译
sudo make

若第三方软件无法下载、下载缓慢,自行下载后放入dl文件夹,编译完成后生成文件output/image

8、测试验证
cd /home/zuozhongkai/linux/nfs //进入到 nfs 目录下
mkdir buildrootfs //创建 buildrootfs 目录
cd buildrootfs //进入到 buildrootfs 目录
cp ../../IMX6ULL/tool/buildroot-2019.02.6/output/images/rootfs.tar ./ //拷贝到 rootfs.tar
tar
tar -vxf rootfs.tar //解压缩 rootfs.tar
rm rootfs.tar //删除 rootfs.tar

进入uboot

setenv bootargs 'console=tty1 console=ttymxc0,115200 root=/dev/nfs nfsroot=192.168.1.253:
/home/zuozhongkai/linux/nfs/buildrootfs rw ip=192.168.1.251:192.168.1.253:192.168.1.1:255.255.
255.0::eth0:off

二、配置busybox

压缩包存放在dl目录,buildroot自动解压到output/build
在 buildroot下打开 busybox 的配置界面输入如下命令:

sudo make busybox-menuconfig

查看Buildroot所有包

sudo make show-targets

单独编译busybox

sudo make busybox

打包编译buildroot

sudo make

附1、命令行显示当前路径配置

PS1 = ‘命令列表’
\! 显示该命令的历史记录编号。
\# 显示当前命令的命令编号。
\$ 显示$符作为提示符,如果用户是 root 的话,则显示#号。
\\ 显示反斜杠。
\d 显示当前日期。
\h 显示主机名。
\n 打印新行。
\nnn 显示 nnn 的八进制值。
\s 显示当前运行的 shell 的名字。
\t 显示当前时间。
\u 显示当前用户的用户名。
\W 显示当前工作目录的名字。
\w 显示当前工作目录的路径

打开/etc/profile,屏蔽代码

3 if [ "$PS1" ]; then
4 if [ "`id -u`" -eq 0 ]; then
5 export PS1='# '
6 else
7 export PS1='$ '
8 fi
9 fi

改为

1 PS1='[\u@\h]:\w$:'
2 export PS1
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值