Odroid-xu 板环境搭建

本文档详细介绍了Odroid-XU开发板的启动流程、U-Boot配置、内核编译环境搭建、文件系统分区调整及VNC Server安装过程等关键技术细节。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.

Boot Sequence

Upon power on the board will search for the boot media. It will perform the following:

  • 1) iROM (Code inside the SoC) will attempt to read the boot media at the first 512 bytes of it. On those first 512 bytes fwbl1 should exist.
  • 2) fwbl1 will load bl2 (SPL) that is part of the U-boot.
  • 3) bl2 will load U-boot.
  • 4) U-Boot will do whats left, such as handle TrustZone, load kernel image if setted.
fwbl1

This blob is the first thing that CPU will call, we don't have much information on it since its provided by Samsung. Position on SD: 1

bl2

This is the SPL, part of the U-Boot, upon building U-Boot you'll have the mkspl program what will extract it from the u-boot.bin Position on SD: 31

u-boot.bin

This is the U-Boot itself built. For more information about U-Boot please check their website:http://www.denx.de/wiki/U-BootPosition on SD: 63

TrustZone Software

This is the blob done by Samsung/ARM to support Trustzone platform. Position on SD: 719

Default Env

The default env provided in U-Boot will attempt the following:

  • 1) Load boot.ini script from the first FAT type partition from the boot media.
  • 2) Load kernel from its on media/ramdisk position (This is the Android Boot)

Boot media sector map for Odroid-xu

  • Odroid-xu has Min 8Gbyte eMMC or MicroSD memory card for system area.
  • FAT partition to calculate the remaining blocks to create the partition.
Area NameSize in bytesFrom(sector #)To(Sector #)Partition Name
FAT32 for StorageUp to 4GB6979920remaining blocksmmcblk0p1
EXT4 for Android cache256MB64465206979919mmcblk0p4
EXT4 for Android userdata2GB22402806446519mmcblk0p3
EXT4 for Android system1GB1371602240179mmcblk0p2
Reserved58MB17647137159 
Kernel8MB126317646 
u-boot environment16KB12311262 
TrustZone SW256KB7191230 
u-boot328KB63718 
bl216KB3162 
fwbl115KB130 
Partition table / MBR51200 

* “Sector number - 1” in SD map is used in the eMMC map.

 

 

Download Xubuntu Desktop 14.04 LTS for XU 

http://odroid.in/ubuntu_14.04lts/

OS Image flashing tool for

Download and unzip this file.
http://dn.odroid.com/DiskImager_ODROID/Win32DiskImager-odroid-v1.3.zip

 

download 后烧录成功

 SD 卡的安装和扩容

扩充前

root@odroid-desktop:~# df
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/mmcblk0p2   3150076 2132236    857792  72% /
none                   4       0         4   0% /sys/fs/cgroup
udev              892784       4    892780   1% /dev
tmpfs             178812    1000    177812   1% /run
none                5120       8      5112   1% /run/lock
none              894060      72    893988   1% /run/shm
none              102400      12    102388   1% /run/user
/dev/mmcblk0p1    102182    7714     94468   8% /media/boot

 

默认的镜像剩余大小固定,如使用8/16G SD card时需要对没有分配的空间进行扩容

1. 先把烧录上述image的 SD card 通过USB card reader插入到一个Linux host,然后 fdisk 删除并创建分区

Disk /dev/sdb: 7948 MB, 7948206080 bytes
245 heads, 62 sectors/track, 1021 cylinders, total 15523840 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0003f9f7

Device Boot Start End Blocks Id System
/dev/sdb1 4096 208895 102400 c W95 FAT32 (LBA)
/dev/sdb2 208896 6610943 3201024 83 Linux
root@odroid-desktop:~# fdisk /dev/sdb

208896 为First sector

 

sudo fdisk /dev/mmcblk0
p
(see starting block of p2, e.g. 266240)
d (delete)
2 (partition 2)
n (new)
p (primary)
2 (partition 2)
266240 (starting block)
<enter> (it will take ending block as end partition, so you have entire space)
w (write partitions)

2. 使用该SD卡启动并做resize2fs

oot@odroid-desktop:~# resize2fs /dev/mmcblk0p2
resize2fs 1.42.9 (4-Feb-2014)
Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/mmcblk0p2 is now 3863424 blocks long.

root@odroid-desktop:~# df
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/mmcblk0p2  15213368 2139708  12426548  15% /
none                   4       0         4   0% /sys/fs/cgroup
udev              892784       4    892780   1% /dev
tmpfs             178812    1012    177800   1% /run
none                5120       0      5120   0% /run/lock
none              894060      72    893988   1% /run/shm
none              102400      12    102388   1% /run/user
/dev/mmcblk0p1    102182    7714     94468   8% /media/boot
root@odroid-desktop:~# fdisk -l

 

VNC Server 安装

安装之前需要设置代理如:

 export http_proxy=http://172.16.2.187:8080

参考http://forum.odroid.com/viewtopic.php?f=52&t=4489

     http://www.linuxidc.com/Linux/2014-09/106805.htm

apt-get install x11vnc

x11vnc -storepasswd 12345 /etc/x11vnc.pass  设置密码为12345

命令运行或者让自动启动

x11vnc -display :0 -auth /var/run/lightdm/root/:0 -forever -bg  -rfbauth /etc/x11vnc.pass -rfbport 5900

 或  vi /etc/init/x11vnc.conf

start on login-session-start

script

x11vnc -display :0 -auth /var/run/lightdm/root/:0 -forever -bg -o /var/log/x11vnc.log -rfbauth /etc/x11vnc.pass -rfbport 5900

end script

reboot 

Step-by-Step guide to building a odroid-xu Kernel

Download the cross tool chain package

[ http://dn.odroid.com/ODROID-XU/compiler/arm-eabi-4.6.tar.gz ]

Copy the cross tool package to /opt/toolchains

If the '/opt/toolchains' directory does not exist in host pc, then create the directory.

# sudo mkdir /opt/toolchains
# sudo cp arm-eabi-4.6.tar.gz /opt/toolchains
# cd /opt/toolchains
# sudo tar zxvf arm-eabi-4.6.tar.gz
Uncompress the cross tool with tar command
# cd /opt/toolchains
# sudo tar xvfz arm-eabi-4.6.tar.gz
Add Path in your environment file

Modify your ~/.bashrc file to add a new path with editor (gedit or vi)

export ARCH=arm
export PATH=${PATH}:/opt/toolchains/arm-eabi-4.6/bin
export CROSS_COMPILE=arm-eabi-

To apply this change, login again or restart the .bashrc

# source ~/.bashrc
Check the tool-chain path to see if it is set up correctly or not.
# arm-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-eabi-gcc
COLLECT_LTO_WRAPPER=/opt/toolchain/arm-eabi-4.6/bin/../libexec/gcc/arm-eabi/4.6.x-google/lto-wrapper
Target: arm-eabi
Configured with: /tmp/android-15472/src/build/../gcc/gcc-4.6/configure --prefix=/usr/local --target=arm-eabi --host=x86_64-linux-gnu 
--build=x86_64-linux-gnu --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --with-gmp=/tmp/android-15472/obj/temp-install --with-
mpfr=/tmp/android-15472/obj/temp-install --with-mpc=/tmp/android-15472/obj/temp-install --without-ppl --without-cloog --disable-libs
sp --enable-threads --disable-nls --disable-libmudflap --disable-libgomp --disable-libstdc__-v3 --disable-sjlj-exceptions --disable-
shared --disable-tls --disable-libitm --with-float=soft --with-fpu=vfp --with-arch=armv5te --enable-target-optspace --with-abi=aapcs
 --with-gcc-version=4.6 --with-binutils-version=2.21 --with-gmp-version=4.2.4 --with-mpfr-version=2.4.1 --with-gdb-version=7.3.x --w
ith-arch=armv5te --with-sysroot=/tmp/android-15472/install/sysroot --with-prefix=/tmp/android-15472/install --with-gold-version=2.21
 --enable-gold --disable-gold --disable-multilib --program-transform-name='s&^&arm-eabi-&'
Thread model: single
gcc version 4.6.x-google 20120106 (prerelease) (GCC)
Source code download

 

 

参考

http://odroid.com/dokuwiki/doku.php?id=en:odroid-xu

 

 

转载于:https://www.cnblogs.com/fastwave2004/p/4579187.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值