1.ARM交叉编译工具链:GCC
1)64bit版本的:
wget -c https:
//releases.linaro.org/components/toolchain/binaries/6.4-2017.11/arm-linux-gnueabih
f/gcc-
li
naro-6.4.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz
tar xf gcc-linaro-6.4.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz
export CC=`pwd`/gcc-linaro-6.4.1-2017.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
|
测试一下:
${CC}gcc --version
arm-linux-gnueabihf-gcc (Linaro GCC 6.4-2017.11) 6.4.1 20171012
Copyright (C) 2017 Free Software Foundation, Inc.
This is
free
software; see the source
for
copying conditions. There is NO
warranty; not even
for
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
2.Bootloader:U-Boot
1)下载:
git clone https:
//github.com/u-boot/u-boot
cd u-boot/
git checkout v2017.01 -b tmp
|
2)补丁:
git pull --no-edit git:
//git.ti.com/ti-u-boot/ti-u-boot.git ti-u-boot-2017.01
git checkout 590c7d7fe15d06a4d708403d3234bcd01cd039e1
wget -c https:
//rcn-ee.com/repos/git/u-boot-patches/ti-2017.01/0001-beagle_x15-uEnv.txt-bootz-n-
fixes.pa
tch
patch -p1 < 0001-beagle_x15-uEnv.txt-bootz-n-fixes.patch
|
3)编译:
make ARCH=arm CROSS_COMPILE=${CC} distclean
make ARCH=arm CROSS_COMPILE=${CC} am57xx_evm_defconfig
make ARCH=arm CROSS_COMPILE=${CC}
|
3.Linux Kernel:
1)下载:
git clone https:
//github.com/RobertCNelson/ti-linux-kernel-dev.git
cd ti-linux-kernel-dev/
|
2)TI v4.9.x版本:
git checkout origin/ti-linux-4.9.y -b tmp
|
TI v4.9.x real-time版本:
git checkout origin/ti-linux-rt-4.9.y -b tmp
|
3)编译:
./build_kernel.sh
|
这个脚本会编译kernel、modules、设备树文件,然后复制到目标文件夹。
4.根文件系统(debian / ubuntu)
1)基于Debian 9
用户名 |
密码 |
---|---|
debian | temppwd |
root | root |
下载:
wget -c https:
//rcn-ee.com/rootfs/eewiki/minfs/debian-9.3-minimal-armhf-2017-12-09.tar.xz
|
认证:
sha256sum debian-9.3-minimal-armhf-2017-12-09.tar.xz
5120fcfb8ff8af013737fae52dc0a7ecc2f52563a9aa8f5aa288aff0f3943d61 debian-9.3-minimal-armhf
-2017-12-09.
tar.xz
|
解压:
tar xf debian-9.3-minimal-armhf-2017-12-09.tar.xz
|
2)基于Ubuntu 16.04 LTS
User |
Password |
---|---|
ubuntu | temppwd |
下载:
wget -c https:
//rcn-ee.com/rootfs/eewiki/minfs/ubuntu-16.04.3-minimal-armhf-2017-12-09.tar.xz
|
认证:
sha256sum ubuntu-16.04.3-minimal-armhf-2017-12-09.tar.xz
cacc1a8c56649808e3bc27ca58f94dbe817b9e86e660780009a3535709823cc1 ubuntu-16.04.3-minimal-arm
hf-2017-12
-09.tar.xz
|
解压:
tar xf ubuntu-16.04.3-minimal-armhf-2017-12-09.tar.xz
|
5.安装SD启动卡
1)在下面的步骤中,假设DISK=/dev/mmcblk0 ,lsblk可以查看到你当前sd卡的设备文件
export DISK=/dev/mmcblk0
2)格式化sd卡盘符:
sudo dd
if
=/dev/zero of=${DISK} bs=1M count=10
3)安装Bootloader:
sudo dd
if
=./u-boot/MLO of=${DISK} count=2 seek=1 bs=128k
sudo dd
if
=./u-boot/u-boot.img of=${DISK} count=4 seek=1 bs=384k
|
4)创建rootfs分区用于存根文件系统:
首先看下版本:
sudo sfdisk --version
sfdisk from util-linux 2.27.1
sudo sfdisk ${DISK} <<-__EOF__
4M,,L,*
__EOF__
|
sudo sfdisk --unit M ${DISK} <<-__EOF__
4,,L,*
__EOF__
|
5)格式化分区:
对于:
DISK=/dev/mmcblk0 这种的
sudo mkfs.ext4 -L rootfs ${DISK}p1
对于
: DISK=/dev/sdX 这种的(X为数字)
sudo mkfs.ext4 -L rootfs ${DISK}1
6)挂载分区:
许多系统上应该会完成自动挂载,如果没有:
sudo mkdir -p /media/rootfs/
对于
: DISK=/dev/mmcblk0
sudo mount ${DISK}p1 /media/rootfs/
对于
: DISK=/dev/sdX
sudo mount ${DISK}1 /media/rootfs/
|
6.安装Kernel和根文件系统
1)为了帮助新用户让kernel版本可以随意切换.kernel building 脚本里给提示你当前你使用的版本信息。像这样:
-----------------------------
Script Complete
eewiki.net: [user@localhost:~$ export kernel_version=4.X.Y-Z]
-----------------------------
复制这个“export kernel_version=4.X.Y-Z”到你的终端上。
2)复制根文件系统:
sudo tar xfvp .
/*-*-*-armhf-*/
armhf-rootfs-*.tar -C /media/rootfs/
sync
sudo chown root:root /media/rootfs/
sudo chmod 755 /media/rootfs/
|
3)在/boot/uEnv.txt设置 uname_r :
sudo sh -c
"echo 'uname_r=${kernel_version}' >> /media/rootfs/boot/uEnv.txt"
|
4)复制kernel镜像文件:
sudo cp -v ./ti-linux-kernel-dev/deploy/${kernel_version}.zImage /media/rootfs/boot/vmlinuz-${
kernel_v
ersion}
|
5)复制设备树文件:
sudo mkdir -p /media/rootfs/boot/dtbs/${kernel_version}/
sudo tar xfv ./ti-linux-kernel-dev/deploy/${kernel_version}-dtbs.tar.gz -C /media/rootfs/boot
/dtbs/${k
ernel_version}/
|
6)复制modules:
sudo tar xfv ./ti-linux-kernel-dev/deploy/${kernel_version}-modules.tar.gz -C /media/rootfs/
|
7)设置文件系统标签:
sudo sh -c
"echo '/dev/mmcblk0p1 / auto errors=remount-ro 0 1' >> /media/rootfs/etc/fstab"
|
8)然后弹出sd卡插到bb-x15上:
sync
sudo umount /media/rootfs
7.用Etnaviv Project 加速2D图像显示
1)用sudo apt install安装你喜欢的桌面:lxde, lxqt, xfce, kde, gnome等
2)确认你的kernel已经得到etnaviv支持:
debian@BeagleBoard-X15:~$ dmesg | grep etnaviv
[ 5.372076] etnaviv gpu-subsystem: bound 59000000.bb2d (ops gpu_ops)
[ 5.372086] etnaviv-gpu 59000000.bb2d: model: GC320, revision: 5301
|
sudo apt-get update
sudo apt-get install xserver-xorg-video-armada-etnaviv
|
3)在/etc/X11中创建xorg.conf文件添加一下内容:
Section
"Monitor"
Identifier
"Builtin Default Monitor"
EndSection
Section
"Device"
Identifier
"Builtin Default fbdev Device 0"
Driver
"armada"
EndSection
Section
"Screen"
Identifier
"Builtin Default fbdev Screen 0"
Device
"Builtin Default fbdev Device 0"
Monitor
"Builtin Default Monitor"
EndSection
Section
"ServerLayout"
Identifier
"Builtin Default Layout"
Screen
"Builtin Default fbdev Screen 0"
EndSection
|
OK,重启。
原本地址:http://eewiki.net/display/linuxonarm/BeagleBoard-X15