This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MTD utilities for dm8168 can not be installed

Dear sir :

I works on TI8168 EVM platform and the OS of my host is ubuntu 10.04.

I try to build cross compiled MTD utilities according the description on http://processors.wiki.ti.com/index.php/MTD_Utilities.

When I go to final step, I get a error message.

(1)make step ,maybe all is ok.


root@wzh-desktop:/home/ss/mtd-utils-d37fcc0# WITHOUT_XATTR=1 make
CHK include/version.h
CC ftl_format.o
CC lib/libmtd.o
CC lib/libmtd_legacy.o
CC lib/libcrc32.o
CC lib/libfec.o
AR lib/libmtd.a
LD ftl_format
CC flash_erase.o
LD flash_erase
CC nanddump.o
LD nanddump
CC doc_loadbios.o
LD doc_loadbios
CC ftl_check.o
LD ftl_check
CC mkfs.jffs2.o
CC compr_rtime.o
CC compr_zlib.o
CC compr_lzo.o
CC compr.o
CC rbtree.o
LD mkfs.jffs2
CC flash_lock.o
LD flash_lock
CC flash_unlock.o
LD flash_unlock
CC flash_otp_info.o
LD flash_otp_info
CC flash_otp_dump.o
LD flash_otp_dump
CC mtd_debug.o
LD mtd_debug
CC flashcp.o
flashcp.c:255:2: warning: #warning "Check for smaller erase regions"
LD flashcp
CC nandwrite.o
LD nandwrite
CC nandtest.o
LD nandtest
CC jffs2dump.o
LD jffs2dump
CC nftldump.o
LD nftldump
CC nftl_format.o
LD nftl_format
CC docfdisk.o
LD docfdisk
CC rfddump.o
LD rfddump
CC rfdformat.o
LD rfdformat
CC serve_image.o
LD serve_image
CC recv_image.o
LD recv_image
CC sumtool.o
LD sumtool
CC jffs2reader.o
LD jffs2reader
CC mkfs.ubifs/mkfs.ubifs.o
CC mkfs.ubifs/crc16.o
CC mkfs.ubifs/lpt.o
CC mkfs.ubifs/compr.o
CC mkfs.ubifs/devtable.o
CC mkfs.ubifs/hashtable/hashtable.o
CC mkfs.ubifs/hashtable/hashtable_itr.o
CC ubi-utils/libubi.o
AR ubi-utils/libubi.a
LD mkfs.ubifs/mkfs.ubifs
CC ubi-utils/ubiupdatevol.o
CC ubi-utils/ubiutils-common.o
LD ubi-utils/ubiupdatevol
CC ubi-utils/ubimkvol.o
LD ubi-utils/ubimkvol
CC ubi-utils/ubirmvol.o
LD ubi-utils/ubirmvol
CC ubi-utils/ubicrc32.o
LD ubi-utils/ubicrc32
CC ubi-utils/ubinfo.o
LD ubi-utils/ubinfo
CC ubi-utils/ubiattach.o
LD ubi-utils/ubiattach
CC ubi-utils/ubidetach.o
LD ubi-utils/ubidetach
CC ubi-utils/ubinize.o
CC ubi-utils/libubigen.o
AR ubi-utils/libubigen.a
CC ubi-utils/libiniparser.o
CC ubi-utils/dictionary.o
AR ubi-utils/libiniparser.a
LD ubi-utils/ubinize
CC ubi-utils/ubiformat.o
CC ubi-utils/libscan.o
AR ubi-utils/libscan.a
LD ubi-utils/ubiformat
CC ubi-utils/ubirename.o
LD ubi-utils/ubirename
CC ubi-utils/mtdinfo.o
LD ubi-utils/mtdinfo
CC ubi-utils/ubirsvol.o
LD ubi-utils/ubirsvol

(2)here is the problem:


root@wzh-desktop:/home/ss/mtd-utils-d37fcc0# make install DESTDIR=/home/ss/install
CHK include/version.h
LD mkfs.jffs2
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: mkfs.jffs2.o: Relocations in generic ELF (EM: 3)
mkfs.jffs2.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** [mkfs.jffs2] Error 1
root@wzh-desktop:/home/ss/mtd-utils-d37fcc0# echo $PATH
root/CodeSourcery/Sourcery_G++_Lite/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
root@wzh-desktop:/home/ss/mtd-utils-d37fcc0#

=========================================================================

In the last line,is the PATH para.

below is the process step from:http://processors.wiki.ti.com/index.php/MTD_Utilities

//-------------------------------------------------------
Target 
This section describes how to cross compile the MTD utilities on the Linux development host for Linux ARM target.

Note : 
When using MontaVista toolchain, there is a version of the MTD utilities compiled for the ARM target provided in the MontaVista tool chain. The target file system from MontaVista, located at <MontaVista install dir>/pro/devkit/arm/v5t_le/target, contains these tools for the target.


zlib


host$ tar xvf zlib-1.2.5.tar.gz
host$ cd zlib-1.2.5/
host$ ./configure --prefix=~/mtd/install
Edit resulting Makefile and add toolchain prefix arm-arago-linux-gnueabi- to gcc, ldshared, cpp, ar and ranlib.

host$ vi Makefile
CC=arm-arago-linux-gnueabi-gcc
LDSHARED=arm-arago-linux-gnueabi-gcc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map
CPP=arm-arago-linux-gnueabi-gcc -E
AR=arm-arago-linux-gnueabi-ar rc
RANLIB=arm-arago-linux-gnueabi-ranlib
Save and close vi editor. Then you should be ready to compile.

host$ make
host$ make install
host$ cd ..
Result should be zlib.a in ~/mtd/install/lib directory and zlib's headers in ~/mtd/install/include.


lzo


host$ tar xvf lzo-2.06.tar.gz
host$ cd lzo-2.06/
host$ ./configure --build=i686-pc-linux --prefix=~/mtd/install --host=arm-arago-linux-gnueabi
host$ make
host$ make install
host$ cd ..
Result should be liblzo2.a in ~/mtd/install/lib directory and lzo's headers in ~/mtd/install/include/lzo.


e2fsprogs


host$ tar xvf e2fsprogs-1.42.tar.gz
host$ cd e2fsprogs-1.42/
host$ ./configure --build=i686-pc-linux --prefix=~/mtd/install --host=arm-arago-linux-gnueabi
host$ make
host$ make install
host$ cd lib/uuid/
host$ make install
host$ cd ../../../
Result should be libuuid.a in ~/mtd/install/lib directory and uuid's headers in ~/mtd/install/include/uuid.

#################################################################
mtd-utils


host$ tar xvf mtd-utils-d37fcc0.tar.gz
host$ cd mtd-utils-d37fcc0/
MTD-Utils don't have a configure script, so we have to edit Makefile again. Depending on the version of MTD Utils, make sure head of top level Makefile has:

host$ vi Makefile
PREFIX = ~/mtd/install
ZLIBCPPFLAGS = -I$(PREFIX)/include
LZOCPPFLAGS = -I$(PREFIX)/include
ZLIBLDFLAGS = -L$(PREFIX)/lib
LZOLDFLAGS = -L$(PREFIX)/lib
LDFLAGS += $(ZLIBLDFLAGS) $(LZOLDFLAGS)
CFLAGS ?= -O2 -g $(ZLIBCPPFLAGS) $(LZOCPPFLAGS)
CROSS=arm-none-linux-gnueabi-
Save and close vi editor. Edit common.mk and comment PREFIX=/usr. 
host$ vi common.mk
# PREFIX=/usr
Save and close vi editor. Then you should be ready to compile.

host$ WITHOUT_XATTR=1 make
host$ make install DESTDIR=~/mtd/install
host$ cd ..
?????????????????????????????????????????????????????????

//-------------------------------------------------------

Could someone help me? Thank you very much!

I also cannot understand the difference between the MTD utilities for host and for target, may I have an answer?

  • I also cannot understand the difference between the MTD utilities for host and for target, may I have an answer?

    I mean that if use the MTD utilities for host command make.jffs2 to create a filesystem jffs2 file, then I burn it

    to the nand flash, will it work? Or must I  use the MTD utilities for target(DM8168) to create jffs2 file and burn?

    Thank you!


  • I have experience with mtd-utils for UBIFS for the AM335x device.

    See this thread.

    http://e2e.ti.com/support/arm/sitara_arm/f/791/p/248144/872892.aspx#872892

    There are three ways to get mtd-utils

    1) Ubuntu apt-get install

    2) AM335x EZSDK target file system

    3) From pulling down and building from sourcesfrom the "infradead" website.

    Only this third option supports the mkfs.ubifs -F option as described here.

    http://www.linux-mtd.infradead.org/faq/ubifs.html#L_free_space_fixup

    which is required for UBIFS to work on Linux with AM335x.

    MichaelT

  • Thank you ,Michael T!

    still I can not understand why I can not pass the cross compiling of the MTD for EZSDK of dm8168. I just do as I can to be the same  with the steps described in Wiki.

    (1)Is there anything I can do to complete the MTD utilities install ?

    (2)'Ubuntu apt-get instal' command install the MTD utilities is for host, maybe is not for target. What's the difference between the utilities for host and for target?

    I am waiting for an answer urgently, thank you very much!

                                                                                                                                          zhiheng wei

  • Is there someone who can help me? Thank you!

  • Hello,

    How did you solved that?

    Because I have compiled following this site:

    http://processors.wiki.ti.com/index.php/MTD_Utilities

    But as the version of the mtd-utils focused in that page had a compilation error, I have taken the mtd-utils version 1.5.0 from git clone git://git.infradead.org/mtd-utils.git

    cd mtd-utils/

    git chekout v1.5.0

    But once everything is compiled with the libraries...,

    I can not find the command mkfs.ubifs

    It says it is in sbin/mkfs.ubifs

    but once I go to that directory is not there.

    Please, I need help

  • Hi Ann,

    Could you please create new thread for your issue,

    Do you want to instyall "mkfs.ubifs" bin into the host PC or arm platform?

    If Host ubuntu PC,

    sudo apt-get install mtd-utils

    It will install the required mkfs.* including mkfs.ubifs with all dependencies.

    If it is ARM pltform, then only you need to cross compile the mtd-utils.