新聞中心

        EEPW首頁 > 嵌入式系統(tǒng) > 設計應用 > 移植mtd-utils-20080508到9G9260開發(fā)板

        移植mtd-utils-20080508到9G9260開發(fā)板

        作者: 時間:2011-06-29 來源:網絡 收藏

        1,下載解壓源碼:

        本文引用地址:http://www.104case.com/article/150547.htm

        root@yuanxh-desktop:/home/yuanxh/sam9260# wget http://debian.mirror.inra.fr/debian/pool/main/m/mtd-utils/mtd-utils_20080508.orig.tar.gz

        root@yuanxh-desktop:/home/yuanxh/sam9260# wget http://www.zlib.net/zlib-1.2.3.tar.gz

        root@yuanxh-desktop:/home/yuanxh/sam9260# wget http://www.oberhumer.com/opensource/lzo/download/lzo-2.03.tar.gz

        root@yuanxh-desktop:/home/yuanxh/sam9260# tar xzvf zlib-1.2.3.tar.gz

        root@yuanxh-desktop:/home/yuanxh/sam9260# mv zlib-1.2.3 zlib-1.2.3-9g9260

        root@yuanxh-desktop:/home/yuanxh/sam9260# tar xzvf lzo-2.03.tar.gz

        root@yuanxh-desktop:/home/yuanxh/sam9260# mv lzo-2.03 lzo-2.03-9g9260

        root@yuanxh-desktop:/home/yuanxh/sam9260# tar xzvf mtd-utils_20080508.orig.tar.gz

        root@yuanxh-desktop:/home/yuanxh/sam9260# mv -9g9260

        2,編譯安裝zlib:

        root@yuanxh-desktop:/home/yuanxh/sam9260# cd zlib-1.2.3-9g9260

        root@yuanxh-desktop:/home/yuanxh/sam9260/zlib-1.2.3-9g9260# CC=arm-linux-gcc ./configure --shared --prefix=/usr/zlib-1.2.3

        root@yuanxh-desktop:/home/yuanxh/sam9260/zlib-1.2.3-9g9260# make

        root@yuanxh-desktop:/home/yuanxh/sam9260/zlib-1.2.3-9g9260# make install

        root@yuanxh-desktop:/home/yuanxh/sam9260/zlib-1.2.3-9g9260# cd ..

        3,編譯安裝lzo:

        root@yuanxh-desktop:/home/yuanxh/sam9260# cd lzo-2.03-9g9260/

        root@yuanxh-desktop:/home/yuanxh/sam9260/lzo-2.03-9g9260# CC=arm-linux-gcc ./configure --host=arm-linux --prefix=/usr/lzo-2.03

        root@yuanxh-desktop:/home/yuanxh/sam9260/lzo-2.03-9g9260# make

        root@yuanxh-desktop:/home/yuanxh/sam9260/lzo-2.03-9g9260# make install

        root@yuanxh-desktop:/home/yuanxh/sam9260/lzo-2.03-9g9260# cd ..

        4,修改mtd-utils的Makefile文件

        root@yuanxh-desktop:/home/yuanxh/sam9260# cd -9g9260/

        root@yuanxh-desktop:/home/yuanxh/sam9260/mtd-utils-20080508-9g9260# cp Makefile Makefile.arm

        root@yuanxh-desktop:/home/yuanxh/sam9260/mtd-utils-20080508-9g9260# cp Makefile Makefile.x86

        修改Makefile.arm文件

        root@yuanxh-desktop:/home/yuanxh/sam9260/mtd-utils-20080508-9g9260# vi Makefile.arm

        把第8行的 #CROSS=arm-linux-

        修改為 CROSS=arm-linux-

        把第10行的 CFLAGS := -I./include $(OPTFLAGS)

        修改為

        CFLAGS := -I./include $(OPTFLAGS) -I/usr/zlib-1.2.3/include -I/usr/lzo-2.03/include

        LDFLAGS := -L/usr/zlib-1.2.3/lib -L/usr/lzo-2.03/lib

        把第46行的 make -C $(BUILDDIR)/ubi-utils

        修改為 make -C ubi-utils

        把第46行的 make -C $(BUILDDIR)/ubi-utils clean

        修改為 make -C ubi-utils clean

        5,增加mtd-utils的編譯腳本

        root@yuanxh-desktop:/home/yuanxh/sam9260/mtd-utils-20080508-9g9260# vi mkall

        在 mkall中寫入:

        make -f Makefile.$1 clean

        make -f Makefile.$1 WITHOUT_XATTR=1

        root@yuanxh-desktop:/home/yuanxh/sam9260/mtd-utils-20080508-9g9260# vi mkclean

        在 mkall中寫入:

        make -f Makefile.$1 clean

        保存后修改可執(zhí)行權限

        root@yuanxh-desktop:/home/yuanxh/sam9260/mtd-utils-20080508-9g9260# chmod 777 mkall

        root@yuanxh-desktop:/home/yuanxh/sam9260/mtd-utils-20080508-9g9260# chmod 777 mkclean

        6,編譯mtd-utils

        ARM版本

        root@yuanxh-desktop:/home/yuanxh/sam9260/mtd-utils-20080508-9g9260# ./mkall arm

        可以得到flash_eraseall等工具命令

        X86版本

        root@yuanxh-desktop:/home/yuanxh/sam9260/mtd-utils-20080508-9g9260# ./mkall x86

        可以得到mkfs.jffs2等工具命令

        7,清除mtd-utils目標碼

        root@yuanxh-desktop:/home/yuanxh/sam9260/mtd-utils-20080508-9g9260# ./mkclean arm

        root@yuanxh-desktop:/home/yuanxh/sam9260/mtd-utils-20080508-9g9260# ./mkclean x86



        評論


        相關推薦

        技術專區(qū)

        關閉
        主站蜘蛛池模板: 梁山县| 临邑县| 乌苏市| 邓州市| 根河市| 彩票| 阳信县| 子长县| 蚌埠市| 瑞丽市| 正蓝旗| 桐乡市| 汉寿县| 那曲县| 迁安市| 陈巴尔虎旗| 大厂| 滨海县| 柘城县| 商水县| 漳平市| 荆州市| 阜新市| 乌兰察布市| 积石山| 广西| 台山市| 新安县| 博野县| 治县。| 财经| 道孚县| 平度市| 彰化县| 宜黄县| 荃湾区| 台前县| 忻城县| 天水市| 德清县| 淳安县|