【Tiny4412】搭建Qt网络文件系统

00. 目录

文章目录

    • 00. 目录
    • 01. 编译内核
    • 02. 烧写Linux内核
    • 03. 烧写Qt根分区映像
    • 04. 搭建Qt网络文件系统
    • 05. 附录

01. 编译内核

1.1 解压内核源码

[root@itcast tools]# tar -xjvf linux-3.5_analyse.tar.bz2 

1.2 配置内核

[root@itcast linux-3.5_analyse]# make clean 
[root@itcast linux-3.5_analyse]# cp tiny4412_linux_defconfig  .config 
[root@itcast linux-3.5_analyse]# 

1.3 关闭TtrustZone

[root@itcast linux-3.5_analyse]# vim .config +485
注释485行
485 #CONFIG_ARM_TRUSTZONE is not set #=y

1.4 编译源码

[root@itcast linux-3.5_analyse]# make -j4
.....
  CC      crypto/ansi_cprng.mod.o
  CC      drivers/char/tiny4412_hello_module.mod.o
  CC      drivers/scsi/scsi_wait_scan.mod.o
  OBJCOPY arch/arm/boot/Image
  LD [M]  crypto/ansi_cprng.ko
  LD [M]  drivers/scsi/scsi_wait_scan.ko
  LD [M]  drivers/char/tiny4412_hello_module.ko
  Kernel: arch/arm/boot/Image is ready
  AS      arch/arm/boot/compressed/head.o
  GZIP    arch/arm/boot/compressed/piggy.gzip
  CC      arch/arm/boot/compressed/misc.o
  CC      arch/arm/boot/compressed/decompress.o
  CC      arch/arm/boot/compressed/string.o
  SHIPPED arch/arm/boot/compressed/lib1funcs.S
  SHIPPED arch/arm/boot/compressed/ashldi3.S
  AS      arch/arm/boot/compressed/lib1funcs.o
  AS      arch/arm/boot/compressed/ashldi3.o
  AS      arch/arm/boot/compressed/piggy.gzip.o
  LD      arch/arm/boot/compressed/vmlinux
  OBJCOPY arch/arm/boot/zImage
  Kernel: arch/arm/boot/zImage is ready

02. 烧写Linux内核

minicom端输入

DengJin # fastboot
[Partition table on MoviNAND]
ptn 0 name='fwbl1' start=0x1000A len=N/A (use hard-coded info. (cmd: movi))
ptn 1 name='bl2' start=N/A len=N/A (use hard-coded info. (cmd: movi))
ptn 2 name='bootloader' start=N/A len=N/A (use hard-coded info. (cmd: movi))
ptn 3 name='tzsw' start=N/A len=N/A (use hard-coded info. (cmd: movi))
ptn 4 name='kernel' start=N/A len=N/A (use hard-coded info. (cmd: movi))
ptn 5 name='ramdisk' start=N/A len=0x6800(~27262976KB) (use hard-coded info. (cmd: movi))
ptn 6 name='system' start=0x1000A len=0x51888(~341975040KB) 
ptn 7 name='userdata' start=0x1000A len=0xC9FAE(~847165440KB) 
ptn 8 name='cache' start=0x1000A len=0x81B64(~544051200KB) 
ptn 9 name='fat' start=0x1000A len=0x5A736E(~1775089664KB) 
OTG cable Connected!

PC端输入

[root@itcast linux-3.5_analyse]# fastboot flash kernel arch/arm/boot/zImage 
sending 'kernel' (4671 KB)...
OKAY [  1.268s]
writing 'kernel'...
OKAY [  0.372s]
finished. total time: 1.641s
[root@itcast linux-3.5_analyse]# 

03. 烧写Qt根分区映像

[root@itcast Qt]# fastboot flash ramdisk ramdisk-u.img 
sending 'ramdisk' (987 KB)...
OKAY [  0.277s]
writing 'ramdisk'...
OKAY [  0.081s]
finished. total time: 0.358s
[root@itcast Qt]# 

04. 搭建Qt网络文件系统

4.1 解压qt网络文件系统

[root@itcast Qt]# pwd
/home/tools/Qt
[root@itcast Qt]# ls
ramdisk-u.img  rootfs_qtopia_qt4-20141213.tar.gz
[root@itcast Qt]# tar -xzvf rootfs_qtopia_qt4-20141213.tar.gz 

4.2 移动目录

[root@itcast Qt]# mv rootfs_qtopia_qt4  /
[root@itcast Qt]# cd /
[root@itcast /]# mv rootfs_qtopia_qt4/ qtrootfs
[root@itcast /]# ls
bin   cgroup  etc   lib    lost+found  misc  net  proc      root  selinux  sys  usr
boot  dev     home  lib64  media       mnt   opt  qtrootfs  sbin  srv      tmp  var
[root@itcast /]# 

4.3 设置nfs共享

[root@itcast /]# vim /etc/exports 
#最后添加一下内容
/qtrootfs *(rw,sync,no_root_squash)

4.4 启动nfs服务

[root@itcast /]# iptables -F 
[root@itcast /]# setenforce  0
[root@itcast /]# /etc/init.d/rpcbind restart
停止 rpcbind:                                             [确定]
正在启动 rpcbind:                                         [确定]
[root@itcast /]# /etc/init.d/nfs restart
关闭 NFS 守护进程:                                        [失败]
关闭 NFS mountd:                                          [失败]
关闭 NFS quotas:                                          [失败]
Shutting down RPC idmapd:                                  [失败]
启动 NFS 服务:                                            [确定]
关掉 NFS 配额:                                            [确定]
启动 NFS mountd:                                          [确定]
启动 NFS 守护进程:                                        [确定]
正在启动 RPC idmapd:                                      [确定]
[root@itcast /]# 

4.5 验证共享目录

[root@itcast Android]# showmount  -e 172.16.0.53
Export list for 172.16.0.53:
/qtrootfs *

4.6 设置启动参数

DengJin #set bootargs root=/dev/nfs nfsroot=172.16.0.88:/qtrootfs 
ip=172.16.0.77  console=ttySAC0,115200 lcd=S70 ctp=2
DengJin #save

4.7 环境变量如下

DengJin # printenv
baudrate=115200
bootargs=root=/dev/nfs nfsroot=172.16.0.53:/qtrootfs ip=172.16.0.251 
console=ttySAC0,115200 lcd=S70 ctp=2
bootcmd=movi read kernel 0 40008000;bootm 40008000
bootdelay=3
ethaddr=00:40:5c:26:0a:5b
gatewayip=192.168.0.1
ipaddr=192.168.0.20
netmask=255.255.255.0
serverip=192.168.0.10

Environment size: 691/16380 bytes
DengJin # 

4.8 Qt界面显示如下
成功启动Qt文件系统的界面如下:

05. 附录

5.1 Qt内核和根文件系统下载
下载:Qt镜像和文件系统.rar

5.2 Qt文件系统下载
下载:rootfs_qtopia_qt4-20141213.tar.gz

你可能感兴趣的:(ARM)