关闭

imx533 配置 制作SD卡启动文件系统

1963人阅读 评论(0) 收藏 举报

制作SD卡启动文件系统

1】对SD卡分区

按飞思卡尔文档列出的分区表用fdisk分区:

 

Partition Type/Index

Name

Start Offset

Size

File System

Content

N/A

BOOT

0

10MB

N/A

bootloader/kernel/uramdisk images

Primary 1

MEDIA

10MB

User Defined

VFAT. Mount as /sdcards

Media file storage

Primary 2

SYSTEM

follow MEDIA

>= 200MB

EXT4. Mount as /system (with read only)

Android system bin/libs (system.img)

Logic 5 (Extended 3)

DATA

follow SYSTEM

> 200MB

EXT4. Mount as /data

Android data (e.g. installed app)

Logic 6 (Extended 3)

CACHE

follow DATA

> 10MB

EXT4. Mount as /cache

Android cache

Primary 4

RECOVERY

follow CACHE

> 20MB

EXT4. Mount as / in recovery mode

Root file system for recovery mode (recovery.img)


To create these partitions, you can simply use MFG tool described in next section, or use fdisk utility on Linux PC.

After creating the partitions by fdisk, please format each file systems by the following commands:

 

hui@ubuntu:~$ sudo fdisk /dev/sdb

 

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to

         switch off the mode (command 'c') and change display units to

         sectors (command 'u').

 

#先查看分区

Command (m for help): p

#显示有一个分区sdb1

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1        1937    15554048    c  W95 FAT32 (LBA)

 

#删除分区

Command (m for help): d

Selected partition 1

 

Command (m for help): p    #查看分区

 .....

   Device Boot      Start         End      Blocks   Id  System

 #可见,已经无分区存在

 

#开始分区

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p    #选择主分区

Partition number (1-4): 1                   #分第一个分区

First cylinder (1-1936, default 1): +10M    #预留10兆空间

Last cylinder, +cylinders or +size{K,M,G} (1-1936, default 1936): +14000M           #主分区114000兆空间

 

#分第二个主分区

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p    #选择p分主分区

Partition number (1-4): 2          #分区2

First cylinder (1787-1936, default 1787):

Using default value 1787

Last cylinder, +cylinders or +size{K,M,G} (1787-1936, default 1936): +200M         #主分区2200兆空间

 

#分第三个分区

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

e                #选择e分扩展分区

Partition number (1-4): 3          #分区3

First cylinder (1813-1936, default 1813):

Using default value 1813

Last cylinder, +cylinders or +size{K,M,G} (1813-1936, default 1936): +320M         #分配320兆空间

 

#分第四个分区(主分区)

Command (m for help): n

Command action

   l   logical (5 or over)

   p   primary partition (1-4)

p       #主分区类型

Selected partition 4

First cylinder (1855-1936, default 1855):

Using default value 1855

Last cylinder, +cylinders or +size{K,M,G} (1855-1936, default 1936):

Using default value 1936

 

 

#分第五个分区(扩展分区)

Command (m for help): n

First cylinder (1813-1854, default 1813):

Using default value 1813

Last cylinder, +cylinders or +size{K,M,G} (1813-1854, default 1854): +300M

#分第六个分区(扩展分区)

Command (m for help): n

First cylinder (1852-1854, default 1852):

Using default value 1852

Last cylinder, +cylinders or +size{K,M,G} (1852-1854, default 1854):

Using default value 1854

 

Command (m for help): p    #查看分区

 

Disk /dev/sdb: 15.9 GB, 15931539456 bytes

255 heads, 63 sectors/track, 1936 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1        1786    14346013+  83  Linux

/dev/sdb2            1787        1812      208845   83  Linux

/dev/sdb3            1813        1854      337365    5  Extended

/dev/sdb4            1855        1936      658665   83  Linux

/dev/sdb5            1813        1851      313236   83  Linux

/dev/sdb6            1852        1854       24066   83  Linux

 

Command (m for help): w        #保存分区信息,退出

The partition table has been altered!

 

2分区完成后,下一步格式化:

[c-sharp] view plaincopy
  1. sudo mkfs.vfat /dev/sdb1  
  2. sudo mkfs.ext4 /dev/sdb2 -O ^extent -L system  
  3. sudo mkfs.ext4 /dev/sdb4 -O ^extent -L recovery  
  4. sudo mkfs.ext4 /dev/sdb5 -O ^extent -L data  
  5. sudo mkfs.ext4 /dev/sdb6 -O ^extent -L cache  

 

3把uboot,kernel,ramdisk,system文件同步到SD卡里:

[c-sharp] view plaincopy
  1. sudo dd if=u-boot.bin of=/dev/sdb bs=1K skip=1 seek=1; sync  
  2. sudo dd if=uImage of=/dev/sdb bs=1M seek=1; sync  
  3. sudo dd if=uramdisk.img of=/dev/sdb bs=1M seek=6; sync  
  4. sudo dd if=system.img of=/dev/sdb2; sync  
  5. sudo dd if=recovery.img of=/dev/sdb4; sync   
  


vi /usr/startx

#!/bin/sh

IS_BABBAGE=NO
grep Babbage /proc/cpuinfo > /dev/null 2>&1
if [ $? = 0 ]; then
IS_BABBAGE=YES
Xfbdev -keybd keyboard,,device=/dev/input/keyboard0 -mouse mouse,2,device=/dev/input/mice &
else
Xfbdev -mouse tslib,2,device=/dev/input/ts0 &
fi
sleep 5
# Calibrate when using the rootfs the first time
if [ $IS_BABBAGE = NO ]; then
ls /usr/etc | grep pointercal > /dev/null 2>&1
if [ $? = 1 ]; then
ts_calibrate
fi
fi


sleep 8


matchbox-window-manager -d :0 -use_lowlight no -use_titlebar yes -use_cursor yes&
matchbox-desktop&

matchbox-panel  --bgtrans yes  &



uboot 启动参数

setenv bootargs_mmc 'setenv bootargs ${bootargs} console=ttymxc0 root=/dev/mmcblk0p1 rootwait rw video=mxcdi0fb:800x480M-16@60,CLAA-WVGA di0_primary calibration ip=dhcp gpu_nommu gpu_memory=64M'

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:2591069次
    • 积分:23490
    • 等级:
    • 排名:第279名
    • 原创:52篇
    • 转载:754篇
    • 译文:1篇
    • 评论:284条
    最新评论