DM8168心得之SD卡快速分区制作
DM8168心得之SD卡快速分區(qū)制作?
?
??????????????????????????????
/******************************************************************
*???????author:????????盧浩
*???????time:??????????12.03.08
*???????environment:???ubuntu10.04LTS?+TI?DM8186
*???????kernel?version:??linux-2.6.37
******************************************************************/
?
?
?
這一個(gè)星期一直在搞DM8168,雖然還有一些細(xì)節(jié)需要完善,但現(xiàn)在也基本從SD卡和nandflash可以正常啟動(dòng)起來了...
首先我們需要給SD卡分區(qū),至于怎么分區(qū),辦法還是挺多的,我在上一家公司的時(shí)候,他們的文檔里面是在linux下用sudo?fdisk?/dev/sdb進(jìn)行分區(qū),具體這個(gè)怎么做,我建議大家搜一下百度谷歌,我這里就不詳細(xì)講了,我下面截一張關(guān)于這個(gè)的圖
?
大家進(jìn)去之后可以按m看看具體怎么做。接下來我講講TI給的關(guān)于SD卡分區(qū)的資料,這個(gè)就比較方便了
首先我們看一個(gè)連接。關(guān)于TI給的SD卡分區(qū)的連接
http://processors.wiki.ti.com/index.php/How_to_Make_3_Partition_SD_Card
首先在linux主機(jī)上建立一個(gè)文件,命名為mk3PartSDCard,把下面段代碼復(fù)制進(jìn)去并保存
?
?
?
?
#!?/bin/sh
#?mk3PartSDCard.sh?v0.3
#?Licensed?under?terms?of?GPLv2
?
DRIVE=$1
?
dd?if=/dev/zero?of=$DRIVE?bs=1024?count=1024
?
SIZE=`fdisk?-l?$DRIVE?|?grep?Disk?|?awk?'{print?$5}'`
?
echo?DISK?SIZE?-?$SIZE?bytes
?
CYLINDERS=`echo?$SIZE/255/63/512?|?bc`
?
sfdisk?-D?-H?255?-S?63?-C?$CYLINDERS?$DRIVE?<<?EOF
,9,0x0C,*
10,115,,-
126,,,-
EOF
?
mkfs.vfat?-F?32?-n?"boot"?${DRIVE}1
umount?${DRIVE}1
mkfs.ext3?-L?"rootfs"?${DRIVE}2
umount?${DRIVE}2
mkfs.ext3?-L?"START_HERE"?${DRIVE}3
?
插上你的SD卡,并且讓linux主機(jī)識(shí)別到改變文件的可執(zhí)行屬性
user@UbuntuVbox1004:~$?chmod?755?mk3PartSDCard
在命令終端輸入df?-hT來顯示掛載分區(qū)情況
?
?
?
執(zhí)行這個(gè)腳本之前請(qǐng)umount你的SD卡
user@Ubuntu1004:~$?umount?/dev/sdb1?然后執(zhí)行這個(gè)腳本
user@Ubuntu1004:~$?sudo?./mk3PartSDCard?/dev/sdb?然后你會(huì)看到
?
user@UbuntuVbox1004:~$?sudo?./mk3PartSD?/dev/sdb
[sudo]?password?for?user:
1024+0?records?in
1024+0?records?out
1048576?bytes?(1.0?MB)?copied,?1.53109?s,?685?kB/s
Disk?/dev/sdb?doesn't?contain?a?valid?partition?table
DISK?SIZE?-?1977614336?bytes
Checking?that?no-one?is?using?this?disk?right?now?...
OK
?
Disk?/dev/sdb:?240?cylinders,?255?heads,?63?sectors/track
sfdisk:?ERROR:?sector?0?does?not?have?an?msdos?signature
/dev/sdb:?unrecognized?partition?table?type
Old?situation:
No?partitions?found
New?situation:
Units?=?cylinders?of?8225280?bytes,?blocks?of?1024?bytes,?counting?from?0
?
Device??Boot????Start???End?????#cyls???#blocks?????????Id?System
/dev/sdb1?*?????0+??8???9-??72261???????c?W95?FAT32?(LBA)
/dev/sdb2???10??124?????115?????923737+?????????83?Linux
/dev/sdb3???126?????239?????114?????915705??????83?Linux
/dev/sdb4???0???-?0?????0???0???????Empty
Successfully?wrote?the?new?partition?table
Re-reading?the?partition?table?...
?
If?you?created?or?changed?a?DOS?partition,?/dev/foo7,?say,?then?use?dd(1)
to?zero?the?first?512?bytes:?dd?if=/dev/zero?of=/dev/foo7?bs=512?count=1
(See?fdisk(8).)
mkfs.vfat?3.0.7?(24?Dec?2009)
umount:?/dev/sdb1:?not?mounted
mke2fs?1.41.11?(14-Mar-2010)
Filesystem?label=rootfs
OS?type:?Linux
Block?size=4096?(log=2)
Fragment?size=4096?(log=2)
Stride=0?blocks,?Stripe?width=0?blocks
57856?inodes,?230934?blocks
11546?blocks?(5.00%)?reserved?for?the?super?user
First?data?block=0
Maximum?filesystem?blocks=239075328
8?block?groups
32768?blocks?per?group,?32768?fragments?per?group
7232?inodes?per?group
Superblock?backups?stored?on?blocks:
32768,?98304,?163840,?229376
Writing?inode?tables:?done
Creating?journal?(4096?blocks):?done
Writing?superblocks?and?filesystem?accounting?information:?done
?
This?filesystem?will?be?automatically?checked?every?20?mounts?or
180?days,?whichever?comes?first.?Use?tune2fs?-c?or?-i?to?override.
umount:?/dev/sdb2:?not?mounted
mke2fs?1.41.11?(14-Mar-2010)
Filesystem?label=START_HERE
OS?type:?Linux
Block?size=4096?(log=2)
Fragment?size=4096?(log=2)
Stride=0?blocks,?Stripe?width=0?blocks
57232?inodes,?228926?blocks
11446?blocks?(5.00%)?reserved?for?the?super?user
First?data?block=0
Maximum?filesystem?blocks=234881024
7?block?groups
32768?blocks?per?group,?32768?fragments?per?group
8176?inodes?per?group
Superblock?backups?stored?on?blocks:
32768,?98304,?163840
Writing?inode?tables:?done
Creating?journal?(4096?blocks):?done
Writing?superblocks?and?filesystem?accounting?information:?done
?
This?filesystem?will?be?automatically?checked?every?27?mounts?or
180?days,?whichever?comes?first.?Use?tune2fs?-c?or?-i?to?override.
然后輸入這些
user@Ubuntu1004:~$?umount?/dev/sdb1
user@Ubuntu1004:~$?umount?/dev/sdb2
user@Ubuntu1004:~$?umount?/dev/sdb3
再輸入df?-hT查看分區(qū)情況
?
記住第一個(gè)分區(qū)/media/boot用來存放MLO???uboot.bin???uImage?
第二個(gè)分區(qū)/media/rootfs用來存放你的文件系統(tǒng)?
轉(zhuǎn)自: ?http://wenku.baidu.com/link?url=FDrXc1BWShrZPYQyvcHT8_6se1cnd9NJ5sva_u0VAoSz2d1QyWzWKmS_OnZ4oQdb-6pT_GCwOt32ftIdetc3jxzwcLc5Ve4r3pull6F-zei
第二種方法:
/ti-ezsdk_dm816x-evm_5_05_02_00/bin/mksdboot.sh ?就是SD格式化腳本
host $?cd ti-ezsdk_dm816x-evm_xxx/bin
host $ sudo ./mksdboot.sh --device /dev/sdX --sdk /home/user/ti-ezsdk_dm816x-evm_xxx
總結(jié)
以上是生活随笔為你收集整理的DM8168心得之SD卡快速分区制作的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 互联网晚报 | 3月3日 星期四 |
- 下一篇: DM8168 开发环境搭建