|
iTOP4412 开发环境搭建
===========================
Ubuntu12.04.2 64bit系统
# cat /etc/issue //查看ubuntu发布版本
Ubuntu 12.04.2 LTS \n \l
# uname -a //查看ubuntu是32bit还是64bit
Linux ubuntu 3.13.0-32-generic #57~precise1-Ubuntu SMP Tue Jul 15 03:50:54 UTC 2014 i686 i686 i386 GNU/Linux //32bit显示
Linux ubuntu 3.5.0-23-generic #35~precise1-Ubuntu SMP Fri Jan 25 17:13:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux //64bit显示
# lsb_release -a //查看ubuntu版本
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.2 LTS
Release: 12.04
Codename: precise
===========================
ubuntu数据源(选择国内163这个,很不错)
1. 数据源文件 & 备份
# /etc/apt/sources.list
# mov /etc/apt/sources.list /etc/apt/source.list_bp
2. 设置数据源地址
a. 点击ubuntu桌面右上角按钮
, ->Updates Available ... (Sofeware Up to Date)
b. "Update Manager"界面左下角"Settings..."按钮(PS:右面更新按钮千万不能点,软件千万不能更新) & 输入密码
c. 第一个分页"Ubuntu Software", 中间Download from的路径 -> "Other..."
d. 选择数据源地址 & -> "Choose Server"按钮
e. "close"按钮 & 到这一步界面操作已经完成
f. 将上面选择的数据源更新到sources.list数据源文件
# apt-get update
g. 安装软件
# apt-get install vim
h. 使用(.tar.gz)JDK安装( iTOP的jdk版本 jdk1.6.0_43)
1> 安装jdk
# cp ~/Downloads/jdk-7u80-linux-x64.tar.gz /opt
# cd /opt
# tar xvf jdk-7u80-linux-x64.tar.gz
# cd jdk1.7.0_80
# ls
bin lib src.zip
COPYRIGHT LICENSE THIRDPARTYLICENSEREADME-JAVAFX.txt
db man THIRDPARTYLICENSEREADME.txt
include README.html
jre release
2> jdk环境变量
etc-profile.d-jdk.sh 放到 /etc/profile.d/目录下, 以下是 etc-profile.d-jdk.sh
# ===============================================================
# Android4.2.2 build environment profile setting
# ===============================================================
# Overwrite JAVA_HOME environment variable setting if already exists
JAVA_HOME=/opt/jdk1.7.0_80
export JAVA_HOME
# Overwrite ANDROID_JAVA_HOME environment variable setting if already exists
ANDROID_JAVA_HOME=/opt/jdk1.7.0_80
export ANDROID_JAVA_HOME
# Overwrite PATH environment setting for JDK
PATH=/opt/jdk1.7.0_80/bin:$PATH
export PATH
重启有效:sudo reboot
i. 使用(bin)文件安装JDK( jdk1.6.0_43)
## 拷贝 jdk-6u43-linux-x64.bin 到 /opt 目录下, 直接执行
/opt # ./jdk-6u43-linux-x64.bin
/opt # ls
jdk1.6.0_43
/opt # cd jdk1.6.0_43
/opt # ls
bin jre README.html src.zip
COPYRIGHT lib register.html THIRDPARTYLICENSEREADME.txt
db LICENSE register_ja.html
include man register_zh_CN.html
ps:添加jdk环境变量,同上:etc-profile.d-jdk.sh 放到 /etc/profile.d/目录下, 以下是 etc-profile.d-jdk.sh
# ===============================================================
# Android4.2.2 build environment profile setting
# ===============================================================
# Overwrite JAVA_HOME environment variable setting if already exists
JAVA_HOME=/opt/jdk1.6.0_43
export JAVA_HOME
# Overwrite ANDROID_JAVA_HOME environment variable setting if already exists
ANDROID_JAVA_HOME=/opt/jdk1.6.0_43
export ANDROID_JAVA_HOME
# Overwrite PATH environment setting for JDK
PATH=/opt/jdk1.6.0_43/bin:$PATH
export PATH
j. 安装交叉编译器 arm-2009q3.tar.bz, 没有arm目录则新建一个
## 解压 arm-2009q3.tar.bz2 到 /opt目录下 ##
# tar jxvf arm-2009q3.tar.bz2
# cd /usr/local/arm/
# ls
arm-2009q3 arm-2009q3.tar.bz2
# cd /root
~# vim .bashrc
## 在文件尾 添加环境变量
export PATH=$PATH:/usr/local/arm/arm-2009q3/bin
# source .bashrc
#arm ##按下tab键试试
arm2hpdl arm-none-linux-gnueabi-gdbtui
arm-none-linux-gnueabi-addr2line arm-none-linux-gnueabi-gprof
arm-none-linux-gnueabi-ar arm-none-linux-gnueabi-ld
arm-none-linux-gnueabi-as arm-none-linux-gnueabi-nm
arm-none-linux-gnueabi-c++ arm-none-linux-gnueabi-objcopy
arm-none-linux-gnueabi-c++filt arm-none-linux-gnueabi-objdump
arm-none-linux-gnueabi-cpp arm-none-linux-gnueabi-ranlib
arm-none-linux-gnueabi-g++ arm-none-linux-gnueabi-readelf
arm-none-linux-gnueabi-gcc arm-none-linux-gnueabi-size
arm-none-linux-gnueabi-gcc-4.4.1 arm-none-linux-gnueabi-sprite
arm-none-linux-gnueabi-gcov arm-none-linux-gnueabi-strings
arm-none-linux-gnueabi-gdb arm-none-linux-gnueabi-strip
ps: /usr/local/arm/目录也可以换成/opt目录(环境变量对应该), 但是iTop的编译脚本写死了 /usr/local/arm/ 目录,所以还是撞到 /usr/local/arm/ 吧
k. 降低gcc版本, 以下命令按顺序执行 sudo
1.apt-get install gcc-4.4 g++-4.4 g++-4.4-multilib gcc-4.4-multilib
2.update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.4 100
3.update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 50
4.update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 100
5.update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 50
6.update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.4 100
7.update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.6 50
8.gcc -v
l. 安装 mkimage 工具
sudo apt-get install u-boot-tools
===========================
软硬件环境
硬件: ====
usb转串口, 串口线,网线,显示器连接线(7寸屏或以上),OTG数据线
软件: ====
串口驱动: usb转串口驱动, CH340串口线驱动.rar
终端软件: hyperterminal-v2.4.8.zip(超级终端-控制开发板)
SSH软件: SSH.zip(远程Ubuntu系统,windows与ubuntu系统传输文件)
ubuntu也需要安装: sudo apt-get install ssh
ADB驱动: 02_编译器以及烧写工具\tools\usb_otg_driver\win7_64位\android_drv_90000_64.exe
ADB工具: platform-tools.zip(ubuntu文件传输到开发板,或反向传输,和烧写工具同一个包)
fastboot: platform-tools.zip(烧写uboot,内核,文件系统)
Xshell:可以连接串口或SSH,既是可以代替SSH和中断软件hyperterminal
=============================
编译测试传文件
arm-none-linux-gnueabi-gcc -o xxx_test xxx_test.c -static
=============================
iTOP开发板 · 编译篇
=============================
一. 编译uboot
1.拷贝 iTOP-4412光盘资料\06_源码_uboot和kernel\CodeSign4SecureBoot_SCP 目录到 iTop4412_uboot 同目录
# ls
CodeSign4SecureBoot_SCP iTop4412_uboot
# cd iTop4412_uboot
# sudo ./build_uboot.sh SCP_1GDDR
make[1]: Leaving directory `/home/test/And4.2/iTop4412_uboot/sdfuse_q'
bl2aa file size= 14336B
before padding uboot.bin file size= 249988B
85884 B written
---------------编译成功的分割线------------------------------
二. 编译Android4.2+linux3.5
1. 编译linux3.5
make zImage
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready(编译成功)
问题1
/bin/sh: 1: /home/cym/exynos4412/4.2/android4.2.2_JLB_PC4_CYIT/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc: not found
解决:因为编译linux-3.5 内核需要使用Android4.2.2 源码自带的交叉编译器,而此时路径不对
1. 拷贝android4.2工程到Linux文件系统中:
# ~/And4.2/android-4.2.2_r1/
abi create.sh docs libcore pdk vendor
bionic cts external libnativehelper prebuilts
... ...
2. 路径为:
~/And4.2/android-4.2.2_r1/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin
3.修改linux3.5目录下的Makefile文件(test为linux用户名)
~/And4.2/linux-3.5 $ vi Makefile
CROSS_COMPILE ?= /home/test/And4.2/android-4.2.2_r1/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-
2. 编译Android4.2.2
/home/test/And4.2/android-4.2.2_r1# ./create.sh
编译完成后会在当前目录的“out/target/product/smdk4412”下面生成镜像文件:
ramdisk-uboot.img
system.img
问题0:kernel/samsung/exynos4412/arch/arm/boot/zImage not find; 解决
## 拷贝上面编译好的内核zImage到 kernel/samsung/exynos4412/arch/arm/boot 目录下
cp /home/test/And4.2/linux-3.5/arch/arm/boot/zImage kernel/samsung/exynos4412/arch/arm/boot/zImage
问题1:java not find(找不到到java编译器) ; 解决1:
sudo update-alternatives --install /usr/bin/java java /opt/jdk1.6.0_30/bin/java 300
sudo update-alternatives --install /usr/bin/javac javac /opt/jdk1.6.0_30/bin/javac 300
sudo update-alternatives --install /usr/bin/javah javah /opt/jdk1.6.0_30/bin/javah 300
sudo update-alternatives --install /usr/bin/jar jar /opt/jdk1.6.0_30/bin/jar 300
问题2:mkimage not find; 解决2:
sudo apt-get install u-boot-tools
编译成功信息
Total compile time is 96 seconds
[[[[[[[ Make additional images for fastboot ]]]]]]]
boot.img -> /home/test/And4.2/android-4.2.2_r1/out/target/product/smdk4412
update.zip -> /home/test/And4.2/android-4.2.2_r1/out/target/product/smdk4412
updating: android-info.txt (stored 0%)
updating: system.img (deflated 41%)
updating: boot.img (deflated 0%)
[[[[[[[ Make ramdisk image for u-boot ]]]]]]]
Image Name: ramdisk
Created: Sat May 20 02:48:06 2017
Image Type: ARM Linux RAMDisk Image (uncompressed)
Data Size: 184702 Bytes = 180.37 kB = 0.18 MB
Load Address: 40800000
Entry Point: 40800000
ok success !!!
=============================
iTOP开发板的烧写
=============================
使用fastboot烧写
一. 硬件
1. 串口线连接开发板串口con3-UART2 到PC的串口(实测:接到con2-UART1上没有反应)
2. OTG线连接开发板的OTG接口和PC的USB接口
二. 软件
1. 串口工具(超级终端),默认波特率为115200(安装hyperterminal-v2.4.8 & 设备管理器->COMn属性->端口设置),
2. ADB驱动(OTG连接USB驱动, Win10自动检测安装, 在Win10下使用android_usb_40_1_2_3_64.exe会安装失败)
3. fastboot烧写工具: platform-tools(里面包含fastboot和ADB工具)
4. USB串口驱动(WIN10自动检测安装,自带工具可能安装失败-没试过)
5. ssh工具SSHSecureShellClient-3.2.9, win系统(win10与虚拟机Ubuntu系统传输文件或远程操作)
6. Xshell:可以连接串口或SSH,既是可以代替SSH和中断软件hyperterminal
三. 镜像目录
文件路径:iTOP-4412光盘资料\03_镜像_Android4.0.3文件系统
1. Uboot 镜像“u-boot-iTOP-4412.bin”
2. 内核镜像“zImage”
3. 文件系统“ramdisk-uboot.img”和“system.img”
四. 烧写开发板
1. 拷贝前面准备的四个镜像到"platform-tools"文件夹下
2. 开发板进入uboot模式, 上电,启动开发板,超级终端中,按“回车”键(一上电就按),进入uboot模式
3. 开发板uboot模式下输入命令
a. 分区命令,超级终端中,输入命令:
fdisk -c 0
b. 格式化命令,超级终端中输入命令:
fatformat mmc 0:1
ext3format mmc 0:2
ext3format mmc 0:3
ext3format mmc 0:4
c. 连接命令,超级终端中输入命令:
fastboot //开始识别设备
4. 检查PC windows系统是否识别设备
5. Windows运行"platform-tools"文件夹中的文件"cmd.exe", 其实就是打开dos, 进入"platform-tools"文件目录
6. 以下均在dos窗口, 开始烧写 ~~~
a. 烧写uboot命令: (不建议烧写,已经有了)
fastboot.exe flash bootloader u-boot-iTOP-4412.bin
b. 烧写zImage内核命令:
fastboot.exe flash kernel zImage
c. 输入烧写ramdisk 命令:
fastboot.exe flash ramdisk ramdisk-uboot.img
d. 输入烧写system 文件系统命令:
fastboot.exe flash system system.img
e. 输入擦除命令:
fastboot -w
f. 输入重启开发板命令:
fastboot reboot
五. 开发板启动 ...(End)
Android应用安装 && PC windows系统传输文件到开发版(之前是采用nfs, android系统可使用OTG数据线)
=============================================================
一、用OTG数据线链接PC"USB接口"和开发版OTG接口,并安装开发版驱动(自动安装)
二、Windows运行"platform-tools"文件夹中的文件"cmd.exe", 其实就是打开dos, 进入"platform-tools"文件目录
三、使用命令传输文件(ADB工具)
android应用安装
adb install <软件名>
-- 安装之后会在Android的data/data下创建应用的包名
android应用卸载
adb uninstall <包名>
应用的包名是: com.example.hello
从电脑发送文件到开发版
adb push <本地路径> <远程路径>
从设备上下载文件到电脑
adb pull <远程路径> <本地路径>
ps:
adb push E:\ETrans\itop4412_jun.ko system/
adb pull system/ E:\ETrans\itop4412_jun.ko
ps: 如果push或pull失败,使用一下命令
adb remount
=============================
使用TF卡烧写(和fastboot对等的另一种烧写方式)
一. 硬件
1. 串口线连接开发板串口con3到PC的串口
2. TF卡插入开发板卡座
二. 软件
1. 串口工具(超级终端),默认波特率为115200(Hyper Terminal & 设备管理器->COMn属性->端口设置)
2. PC机安装USB驱动(Android adb驱动)
三. 将TF卡插入开发板,启动开发板,进入uboot模式(Enter键)
四. TF卡分区, 开发板超级终端输入命令
fdisk -c 1(注意这里的参数是“1”)
fatformat mmc 1:1
ext3format mmc 1:2
ext3format mmc 1:3
ext3format mmc 1:4
五. 拷贝资源文件到ubuntu系统,以下资源,拷贝到/home/xxx/uboot
CodeSign4SecureBoot_SCP
iTop4412_uboot_20151119.tar.gz
六. 解压
tar -vxf iTop4412_uboot_20151119.tar.gz
七. 拷贝 04_镜像_QT文件系统\uboot\xxx的镜像到到"六"解压出来的文件夹"iTop4412_uboot"中
/home/xxx/uboot/iTop4412_uboot/u-boot-iTOP-4412.bin
八. 将tf卡从开发板取出,和Ubuntu系统连接, 并查看盘符, 可看出是 /dev/sdb
# df -l
/dev/sda1 60894268 8705496 49095524 16% /
... ...
none 1018472 200 1018272 1% /run/shm
/dev/sdb4 302804 16584 270592 6% /media/f1ce5d9b-90a9-c2b7-f5c5-6192cd5e392b
/dev/sdb3 302804 16584 270592 6% /media/f87e644b-9759-0326-3534-a1000dcd7a99
/dev/sdb1 6072848 4 6072844 1% /media/0000-3333
/dev/sdb2 1035684 34112 948960 4% /media/5d2bc9f7-c247-2e14-6122-cdee39bba587
九. 制作TF烧写工具,进入到 iTop4412_uboot目录中
sudo ./mkuboot /dev/sdb // sdb根据df -l查看得知
ps:出现"u-boot-iTOP-4412.bin image has been fused successfully"提示,则制作成功
制作好的tf卡,在windows下查看,会少2G左右
十. 在TF卡中新建文件夹"sdupdate",PS: 名字一定要是"sdupdate"
十一. 拷贝Qt对应的四个镜像到“sdupdate”文件夹中(不建议拷贝uboot镜像)
1. Uboot 镜像“u-boot-iTOP-4412.bin”
2. 内核镜像“zImage”
3. 文件系统“ramdisk-uboot.img”和“system.img”
十二. TF卡插入开发板,启动开发板,进入uboot模式(Enter)
十三. 烧写命令,在uboot模式下,超级终端中输入
// 一起烧写的命令:
# sdfuse flashall
// 分开烧写的命令:
# sdfuse flash bootloader u-boot-iTOP-4412.bin
# sdfuse flash kernel zImage
# sdfuse flash ramdisk ramdisk-uboot.img
# sdfuse flash system system.img
//ps 第一次烧写建议分开烧写,而且不要烧写uboot
// 烧写完成之后,超级终端中输入重启命令
# reset
=============================
裸板烧写uboot
一. 确定TF卡是不是FAT32格式, 如果不是,格式化成FAT32格式
FormatTool.exe //格式化工具,和Windows自带格式化不一样
二. 拷贝资源文件到ubuntu系统,以下资源,拷贝到/home/xxx/uboot
CodeSign4SecureBoot_SCP
iTop4412_uboot_20151119.tar.gz
三.解压
/home/xxx/uboot/iTop4412_uboot/u-boot-iTOP-4412.bin
四. 将tf卡从开发板取出,和Ubuntu系统连接, 并查看盘符, 可看出是 /dev/sdb
# df -l
/dev/sda1 60894268 8705496 49095524 16% /
... ...
none 1018472 200 1018272 1% /run/shm/dev/sdb1 6072848 4 6072844 1% /media/0000-3333
五. 进入到iTop4412_uboot目录, 制作启动TF卡
# sudo ./mkuboot /dev/sdx
六. TF卡插入开发板,启动开发板,进入uboot,执行下面的命令(这一步为止,TF启动卡制作才算完成)
fdisk -c 1 300 300 300
fatformat mmc 1:1
ext3format mmc 1:2
ext3format mmc 1:3
ext3format mmc 1:4
ps: 薄码开关, 开发板需要设置为TF卡启动(1拨外,2拨内), 具体看手册,以手册为准
七. 后面的参看"使用TF卡烧写" 第十步开始
ps: 烧写好后,新启动之前, 薄码开关设置为eMMC启动
=============================
SSH软件使用
安装软件:SSHSecureShellClient-3.2.9.exe
打开软件(SSH Secure Shell 或 SSH Secure File Transfer) -> Quit Connect
Host Name: 192.168.137.158(虚拟机ip)
User Name: root(ubuntu登录账号)
Post: 22 (端口)
Authetication:Profile Setting(默认)
ps: SSH Secure Shell 和 SSH Secure File Transfer是一样的操作
=============================
Ubuntu编译工具安装
=============================
1. 内核&uboot编译器arm-xxx的安装
// 解压 arm-2009q3.tar.bz2到 /usr/local/arm/
# tar -vxf arm-2009q3.tar.bz2 /usr/local/arm/
2. 修改环境变量
# cd // home目录
# vim .bashrc // 环境变量文件
# source ./bashrc // 更新新的环境变量到系统
ps: shift + g 调到文件末尾添加
===============================
编译Android4.0+linux3.0
===============================
编译 uboot源码
===============================
源码位置
iTOP-4412光盘资料\06_源码_uboot和kernel\iTop4412_uboot_20151119.tar.gz
1. 新建目录 /Android4.0
# cd
# mkdir Android4.0
# cd Android4.0
// 拷贝iTop4412_uboot_20151119.tar.gz到 Android4.0目录,直接拖文件或使用ssh吗,并解压
# tar -vxf iTop4412_uboot_20151119.tar.gz
2. 在/Android4.0目录下新建文件夹"CodeSign4SecureBoot_SCP", 必须
3. 得到 iTop4412_uboot 目录,进入,可看到 build_uboot.sh 编译配置文件,编译
# ./build_uboot.sh SCP_1GDDR
ps: SCP_1GDDR参数根据开发板传递: SCP_1GDDR, SCP_2GDDR, POP_1GDDR, POP_2GDDR
4. 编译完后,在 iTop4412_uboot目录下,可看到 u-boot-iTOP-4412.bin 镜像文件,可用于写
ps: 烧写参考上面"iTOP开发板的烧写"
===============================
编译 内核源码
===============================
源码位置
iTOP-4412光盘资料\06_源码_uboot和kernel\iTop4412_Kernel_3.0_20151120.tar.gz
1. 拷贝到Android4.0目录(目录管理好),解压到当前目录
// 直接拖文件或使用ssh
# tar -vxf iTop4412_Kernel_3.0_20151120.tar.gz
2. 得到 iTop4412_Kernel_3.0,进入
# cd iTop4412_Kernel_3.0
3. config 备份文件解析: config_for_android_scp_elite
android: 安卓系统(linux, Ubuntu)
scp: 芯片组不一样(pop)
elite: 精英版(super表示全能版)
4. 拷贝config备份文件为.config正式使用文件, 编译
# cp config_for_android_scp_elite .config
# make zImage // 编译镜像
//# make menuconfig // 进入内核编译配置菜单
//# make modules // 编译内核驱动模块
5. 一段漫长的编译时间
6. 编译完成后,可在内核目录 iTop4412_Kernel_3.0/arch/arm/boot 找到内核镜像
LD arch/arm/boot/compressed/vmlinux
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready
==========================
编译Android4.0.3文件系统
==========================
源码位置
iTOP-4412光盘资料\07_源码_Android4.0.3文件系统\iTop4412_ICS_git_20151120.tar.gz
编译器:
Android4.0.3的编译器是gcc 4.4.7版本
# gcc -v //查看
1. 将以上源码压缩包拷贝到Ubuntu的Android4.0(创建的工作目录)中, 并解压,解压过程比较久
// 直接拖文件或使用ssh
# tar -vxf iTop4412_ICS_git_20151120.tar.gz
2. 解压后得到目录"iTop4412_ICS_git", 注意:Android源码文件夹"iTop4412_ICS_git"和内核源码文件夹"iTop4412_Kernel_3.0"需要放到同一目录下
3. 进入iTop4412_ICS_git目录,可看到编译脚本"build_android.sh"
4. 使用命令,执行编译脚本, 编译时间比较长
使用命令"./build_android.sh"
5. 编译完成后,在以下目录看到ranmdisk-uboot.img和system.img
# cd ???/iTop4412_ICS_git/out/target/product/smdk4x12
6.一段漫长的无聊的时间... ... the end! 以下是编译成功的末尾的信息
Creating filesystem with parameters:
Size: 314572800
Block size: 4096
Blocks per group: 32768
Inodes per group: 6400
Inode size: 256
Journal blocks: 1200
Label:
Blocks: 76800
Block groups: 3
Reserved block group size: 23
Created filesystem with 1065/19200 inodes and 62647/76800 blocks
Install system fs image: out/target/product/smdk4x12/system.img
out/target/product/smdk4x12/system.img+ total size is 253243228
Total compile time is 4311 seconds
[[[[[[[ Make ramdisk image for u-boot ]]]]]]]
Image Name: ramdisk
Created: Fri May 26 08:52:39 2017
Image Type: ARM Linux RAMDisk Image (uncompressed)
Data Size: 922119 Bytes = 900.51 kB = 0.88 MB
Load Address: 40800000
Entry Point: 40800000
[[[[[[[ Make additional images for fastboot ]]]]]]]
boot.img -> /home/test/And4.2/iTop4412_ICS_git/out/target/product/smdk4x12
update.zip -> /home/test/And4.2/iTop4412_ICS_git/out/target/product/smdk4x12
adding: android-info.txt (stored 0%)
adding: boot.img (deflated 1%)
adding: system.img (deflated 35%)
ok success !!!
===========================
qtopia和QtE 说明
===========================
区别:
Qtopia是一个构建于Qt/E之上的类似桌面系统的应用环境
QtE是一个专门为嵌入式系统设计图形用户界面的工具包
版本:
迅为提供的Qtopia版本是2.2.0(已是最高版本,不再更新)
迅为提供的QtE版本是4.7
QtE官网
http://www.qt.io/
Qtopia和QtE目前的使用情况
Qtopia在Android出现之前应用,但是2009年之后就不再更新。如果不
是有特定的需求,不建议学习和使用Qtopia
QtE一直在更新,在工业应用,汽车以及消费电子中比Android应用更加
广泛(除了智能手机,其它的嵌入式产品中应用Qte都不会比Android少)
QtE具有强大的移植功能
几乎在所有常见的操作系统上,都可以移植QtE的应用(包括window,
类linux,Android)
系统使用QtE或Qtopia,需要修改配置文件"/etc/init.d/rcS",可烧写进开发板后进开发板修改,或编译前修改
#/bin/qtopia & //注释表示不使用
/bin/qt4 &
#must run this shell
/bin/s[ 83.331490] CPU3: Booted secondary processor
[ 83.335025] Switched to NOHz mode on CPU #3 //末尾处
ps: 编译前修改路径"/home/topeet/Linux+QT/root/etc/init.d/rcS"(参考下面的编译)
===========================
qtopia的编译
文件:
ARM-qtopia-free-src-2.2.0.tar.gz
root_20150422.tar.gz
===========================
1. Qtopia和Android4.0.3使用的uboot是一样的
2. Qtopia(Linux)内核编译(编译的方法和Android编译一模一样)
a. 进入内核目录: iTop4412_Kernel_3.0
# cd iTop4412_Kernel_3.0
b. 拷贝config备份文件为.config正式使用文件, 编译
# cp config_for_linux_scp_elite .config
# make zImage // 编译镜像
//# make menuconfig // 进入内核编译配置菜单
//# make modules // 编译内核驱动模块
c. 一段漫长的编译时间
d. 编译完成后,可在内核目录 iTop4412_Kernel_3.0/arch/arm/boot 找到内核镜像
3. Qtopia文件系统的编译
a. 编译器 arm编译器4.4.1, 修改 ".bashrc"文件, cd
#export PATH=$PATH:/usr/local/arm/arm-2009q3/bin
export PATH=$PATH:/usr/local/arm/4.4.1/bin //文件末尾, 编译器4.4.1的bin文件路径
b. 使新增的环境变量生效
# source .bashrc
c. 编译器环境搭建完成 ==
d. 使用超级权限进入到"/root/yizhi"目录
root@ubuntu:~/yizhi# ls
3rdpart-lib-for-Qtopia2.2.0 qtopia2.2.0Makelog
3rdpart-lib-for-Qtopia2.2.0.tar.gz build
ARM-qtopia-free-src-2.2.0.tar.gz qtopia-free-src-2.2.0.tar.gz
e. 运行build文件,进行编译
./build
f. 一段漫长的编译时间
g. 编译完成后会多出一个文件夹(编译好的Qtopia)
qtopia-free-2.2.0
h. 处理字库问题, 使用绝对路径拷贝
cp -r /root/yizhi/qtopia-free-2.2.0/qt2/lib/fonts/helvetica* /root/yizhi/qtopia-free-2.2.0/qtopia/image/opt/Qtopia/lib/fonts/
i. 拷贝"08_源码_QtE以及qtopia2.2.0文件系统"目录下的 root_20150422.tar.gz 到"/home/topeet/Linux+QT/", 并解压
# tar -vxf root_20150422.tar.gz
j. i操作中的root文件目录的opt目录下可能带有 qt-4.71和Qtopia的
root@ubuntu:/home/topeet/Linux+QT/root/opt# ls
qt-4.7.1 Qtopia
k. 使用自己的Qtopia, 将其覆盖即可
cp -r /root/yizhi/qtopia-free-2.2.0/qtopia/image/opt/Qtopia /home/topeet/Linux+QT/root/opt
l. 进入"/home/topeet/Linux+QT"目录下,编译镜像
# make_ext4fs -s -l 314572800 -a root -L linux system.img root
m. 生成system.img文件
n. Qtopia还需要一个镜像ramdisk-uboot.img,这个是通用的
04_镜像_QT文件系统/system
===========================
qtE的编译
文件:
qt-everywhere-opensource-src-4.7.1_20141224.tar.gz
root_20150422.tar.gz
===========================
1. Qtopia和Android4.0.3使用的uboot是一样的
2. Qtopia(Linux)内核编译(编译的方法和Android编译一模一样)
a. 进入内核目录: iTop4412_Kernel_3.0
# cd iTop4412_Kernel_3.0
b. 拷贝config备份文件为.config正式使用文件, 编译
# cp config_for_linux_scp_elite .config
# make zImage // 编译镜像
//# make menuconfig // 进入内核编译配置菜单
//# make modules // 编译内核驱动模块
c. 一段漫长的编译时间
d. 编译完成后,可在内核目录 iTop4412_Kernel_3.0/arch/arm/boot 找到内核镜像
3. Qtopia文件系统的编译
a. 编译器 arm编译器4.3.2, 修改 ".bashrc"文件, "cd"进入当前用户所在目录
#export PATH=$PATH:/usr/local/arm/arm-2009q3/bin
#export PATH=$PATH:/usr/local/arm/4.4.1/bin
export PATH=$PATH:/usr/local/arm/4.3.2/libexec/gcc //文件末尾, 编译器4.4.1的bin文件路径
b. 拷贝文件"qt-everywhere-opensource-src-4.7.1_20141224.tar.gz"到"/root/yizhi"目录下,并解压
// 直接拖动或使用ssh拷贝
# tar -vxf qt-everywhere-opensource-src-4.7.1_20141224.tar.gz
// 得到"qt-everywhere-opensource-src-4.7.1"文件
# cd qt-everywhere-opensource-src-4.7.1 //进入该文件夹
# ls
build-all qt-everywhere-opensource-src-4.7.1.tar.gz
c. 运行编译脚本
./build-all
d. 一段漫长的编译时间
e. 编译完成后,在"/opt"目录下生成"qt-4.7.1"目录
ps: 没错, "/opt"是ubuntu根目录下的"opt"文件目录
f. 拷贝"08_源码_QtE以及qtopia2.2.0文件系统"目录下的 root_20150422.tar.gz 到"/home/topeet/Linux+QT/", 并解压
# tar -vxf root_20150422.tar.gz
g. f操作中的root文件目录的opt目录下可能带有 qt-4.71和Qtopia的
root@ubuntu:/home/topeet/Linux+QT/root/opt# ls
qt-4.7.1 Qtopia
h. 使用自己的QtE, 将其覆盖即可
cp -r qt-4.7.1 /home/topeet/Linux+QT/root/opt
i. 进入"/home/topeet/Linux+QT"目录下,编译镜像
make_ext4fs -s -l 314572800 -a root -L linux system.img root
j. 生成"system.img"镜像烧写文件
k. The end
===========================
开发板鼠标校准
===========================
如果开发板出现以下错误,可能是鼠标箭头不准
segmentation fault
可在超级终端中,输入命令(删除校准文件 & 重启)
rm -rf /etc/point*
reboot |
|