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 utilites intigration to Android TI_Android_JB_4.2.2_DevKit_4.1 build system

Hi all,

How to intigrate the mtd utilites to TI_Android_JB_4.2.2_DevKit_4.1  build system?

I could able to intigrate the i2c tools by adding the attached Android.mk file into the i2c tools directory.

mtd utilities has the dependencies of lzo and zlib.  Please let me know how to do? Thanks in advace.

I need mtdinfo ,ubiformat, nandwrite utilites. Is there any other alternate?

Android.mk

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := eng
LOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/$(KERNEL_DIR)/include
LOCAL_SRC_FILES := tools/i2cbusses.c tools/util.c
LOCAL_MODULE := i2c-tools
include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := eng
LOCAL_SRC_FILES:=tools/i2cdetect.c
LOCAL_MODULE:=i2cdetect
LOCAL_CPPFLAGS += -DANDROID
LOCAL_SHARED_LIBRARIES:=libc
LOCAL_STATIC_LIBRARIES := i2c-tools
LOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/$(KERNEL_DIR)/include
include $(BUILD_EXECUTABLE)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := eng
LOCAL_SRC_FILES:=tools/i2cget.c
LOCAL_MODULE:=i2cget
LOCAL_CPPFLAGS += -DANDROID
LOCAL_SHARED_LIBRARIES:=libc
LOCAL_STATIC_LIBRARIES := i2c-tools
LOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/$(KERNEL_DIR)/include
include $(BUILD_EXECUTABLE)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := eng
LOCAL_SRC_FILES:=tools/i2cset.c
LOCAL_MODULE:=i2cset
LOCAL_CPPFLAGS += -DANDROID
LOCAL_SHARED_LIBRARIES:=libc
LOCAL_STATIC_LIBRARIES := i2c-tools
LOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/$(KERNEL_DIR)/include
include $(BUILD_EXECUTABLE)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := eng
LOCAL_SRC_FILES:=tools/i2cdump.c
LOCAL_MODULE:=i2cdump
LOCAL_CPPFLAGS += -DANDROID
LOCAL_SHARED_LIBRARIES:=libc
LOCAL_STATIC_LIBRARIES := i2c-tools
LOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/$(KERNEL_DIR)/include
include $(BUILD_EXECUTABLE)

  • Hi all,

    Some more update here.

    I added the android.mk file in the mtd-utils directory. Please find the Android.mk content below the error.

    I am facing below error. Please can any one help me out on this.

    #make TARGET_PRODUCT=am335xevm OMAPES=4.x WILINK=wl18xx
    ============================================
    PLATFORM_VERSION_CODENAME=REL
    PLATFORM_VERSION=4.2.2
    TARGET_PRODUCT=am335xevm
    TARGET_BUILD_VARIANT=eng
    TARGET_BUILD_TYPE=release
    TARGET_BUILD_APPS=
    TARGET_ARCH=arm
    TARGET_ARCH_VARIANT=armv7-a-neon
    HOST_ARCH=x86
    HOST_OS=linux
    HOST_OS_EXTRA=Linux-3.5.0-23-generic-x86_64-with-Ubuntu-12.04-precise
    HOST_BUILD_TYPE=release
    BUILD_ID=JDQ39
    OUT_DIR=out
    ============================================
    fatal: No names found, cannot describe anything.
    fatal: No names found, cannot describe anything.
    fatal: No names found, cannot describe anything.
    fatal: No names found, cannot describe anything.
    find: `src': No such file or directory
    Import includes file: out/host/linux-x86/obj/EXECUTABLES/mkfs_ubifs_intermediates/import_includes
    host C: mkfs_ubifs <= external/mtd-utils/ubi-utils/src/libubi.c
    host C: mkfs_ubifs <= external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c
    In file included from external/mtd-utils/mkfs.ubifs/mkfs.ubifs.h:56:0,
    from external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c:23:
    external/mtd-utils/mkfs.ubifs/ubifs.h: In function 'ubifs_idx_branch':
    external/mtd-utils/mkfs.ubifs/ubifs.h:441:55: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
    In file included from external/mtd-utils/mkfs.ubifs/mkfs.ubifs.h:57:0,
    from external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c:23:
    external/mtd-utils/mkfs.ubifs/key.h: In function 'key_write':
    external/mtd-utils/mkfs.ubifs/key.h:165:12: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c: In function 'fix_stat':
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c:225:2: error: too many arguments to function 'fs_config'
    system/core/include/private/android_filesystem_config.h:231:20: note: declared here
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c: In function 'prepare_node':
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c:812:43: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c: In function 'write_leb':
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c:828:13: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c: In function 'do_pad':
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c:864:13: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c:867:6: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c:882:43: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c:886:14: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c: In function 'add_node':
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c:1064:17: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c:1065:17: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c:1065:24: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c: In function 'add_dent_node':
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c:1417:2: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'ino_t' [-Wformat]
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c:1417:2: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'ino_t' [-Wformat]
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c: In function 'add_file':
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c:1517:23: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c: In function 'add_directory':
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c:1846:4: warning: passing argument 2 of 'add_non_dir' makes integer from pointer without a cast [enabled by default]
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c:1603:12: note: expected 'ino_t' but argument is of type 'ino_t *'
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c: In function 'add_idx_node':
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c:1971:17: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c:1972:17: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
    external/mtd-utils/mkfs.ubifs/mkfs.ubifs.c:1972:24: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
    make: *** [out/host/linux-x86/obj/EXECUTABLES/mkfs_ubifs_intermediates/mkfs.ubifs/mkfs.ubifs.o] Error

     

    Android.mk

    # Copyright 2009 The Android Open Source Project
    #

    LOCAL_PATH:= $(call my-dir)
    include $(CLEAR_VARS)

    include $(CLEAR_VARS)

    LOCAL_CFLAGS += -O2 -Wall
    LOCAL_LDLIBS += -lz -lm
    LOCAL_STATIC_LIBRARIES := libselinux
    LOCAL_SRC_FILES := \
    ubi-utils/src/libubi.c \
    mkfs.ubifs/mkfs.ubifs.c \
    mkfs.ubifs/crc16.c \
    mkfs.ubifs/crc32.c \
    mkfs.ubifs/lpt.c \
    mkfs.ubifs/compr.c \
    mkfs.ubifs/devtable.c \
    mkfs.ubifs/hashtable/hashtable.c \
    mkfs.ubifs/hashtable/hashtable_itr.c \
    lzo-2.03/src/lzo1x_9x.c \
    uuid/gen_uuid.c \
    uuid/unpack.c \
    uuid/pack.c \
    uuid/unparse.c

    LOCAL_C_INCLUDES += \
    $(LOCAL_PATH)/include \
    $(LOCAL_PATH)/ubi-utils/include \
    $(LOCAL_PATH)/ubi-utils/src \
    $(LOCAL_PATH)/lzo-2.03/include \
    $(LOCAL_PATH)/uuid/ \
    external/libselinux/include

    LOCAL_MODULE := mkfs_ubifs

    include $(BUILD_HOST_EXECUTABLE)

    #==================
    include $(CLEAR_VARS)

    LOCAL_SRC_FILES:= \
    ubi-utils/src/ubinize.c \
    ubi-utils/src/common.c \
    ubi-utils/src/crc32.c \
    ubi-utils/src/libiniparser.c \
    ubi-utils/src/dictionary.c \
    ubi-utils/src/libubigen.c

    LOCAL_C_INCLUDES+= \
    $(LOCAL_PATH)/include \
    $(LOCAL_PATH)/ubi-utils/include \
    $(LOCAL_PATH)/ubi-utils/src

    LOCAL_MODULE:=ubinize

    LOCAL_CFLAGS+=-O3

    include $(BUILD_HOST_EXECUTABLE)

    include $(CLEAR_VARS)

    LOCAL_SRC_FILES := \
    ubi-utils/src/libubi.c \
    ubi-utils/src/libmtd_legacy.c \
    ubi-utils/src/libmtd.c \
    ubi-utils/src/libscan.c \
    ubi-utils/src/libubigen.c \
    ubi-utils/src/crc32.c \
    ubi-utils/src/common.c

    LOCAL_CFLAGS = -O2 -Wall
    LOCAL_CFLAGS += -Wall -Wextra -Wwrite-strings -Wno-sign-compare -D_FILE_OFFSET_BITS=64

    LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/ubi-utils/include
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/ubi-utils/src

    LOCAL_MODULE := libubi
    LOCAL_MODULE_TAGS := optional

    include $(BUILD_SHARED_LIBRARY)

    # libubi static lib.
    include $(CLEAR_VARS)

    LOCAL_SRC_FILES := \
    ubi-utils/src/libubi.c \
    ubi-utils/src/libmtd_legacy.c \
    ubi-utils/src/libmtd.c \
    ubi-utils/src/libscan.c \
    ubi-utils/src/libubigen.c \
    ubi-utils/src/crc32.c \
    ubi-utils/src/common.c

    LOCAL_CFLAGS = -O2 -Wall
    LOCAL_CFLAGS += -Wall -Wextra -Wwrite-strings -Wno-sign-compare -D_FILE_OFFSET_BITS=64

    LOCAL_C_INCLUDES += $(LOCAL_PATH)/ubi-utils/include
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/ubi-utils/src

    LOCAL_MODULE := libubi
    LOCAL_MODULE_TAGS := optional
    include $(BUILD_STATIC_LIBRARY)

    # ubinfo util
    #
    include $(CLEAR_VARS)

    LOCAL_SRC_FILES := ubi-utils/src/ubinfo.c

    LOCAL_CFLAGS = -O2 -Wall
    LOCAL_CFLAGS += -Wall -Wextra -Wwrite-strings -Wno-sign-compare -D_FILE_OFFSET_BITS=64

    LOCAL_C_INCLUDES += $(LOCAL_PATH)/ubi-utils/include
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/ubi-utils/src

    LOCAL_SHARED_LIBRARIES := libubi

    LOCAL_MODULE := ubinfo
    LOCAL_MODULE_TAGS := optional

    include $(BUILD_EXECUTABLE)

    # ubiformat util
    #
    include $(CLEAR_VARS)

    LOCAL_SRC_FILES := ubi-utils/src/ubiformat.c

    LOCAL_CFLAGS = -O2 -Wall
    LOCAL_CFLAGS += -Wall -Wextra -Wwrite-strings -Wno-sign-compare -D_FILE_OFFSET_BITS=64

    LOCAL_C_INCLUDES += $(LOCAL_PATH)/ubi-utils/include
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/ubi-utils/src

    LOCAL_SHARED_LIBRARIES := libubi

    LOCAL_MODULE := ubiformat
    LOCAL_MODULE_TAGS := optional

    include $(BUILD_EXECUTABLE)

    # ubimkvol util
    #
    include $(CLEAR_VARS)

    LOCAL_SRC_FILES := ubi-utils/src/ubimkvol.c

    LOCAL_CFLAGS = -O2 -Wall
    LOCAL_CFLAGS += -Wall -Wextra -Wwrite-strings -Wno-sign-compare -D_FILE_OFFSET_BITS=64

    LOCAL_C_INCLUDES += $(LOCAL_PATH)/ubi-utils/include
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/ubi-utils/src

    LOCAL_SHARED_LIBRARIES := libubi

    LOCAL_MODULE := ubimkvol
    LOCAL_MODULE_TAGS := optional

    include $(BUILD_EXECUTABLE)

    # ubiattach util
    #
    include $(CLEAR_VARS)

    LOCAL_SRC_FILES := ubi-utils/src/ubiattach.c

    LOCAL_CFLAGS = -O2 -Wall
    LOCAL_CFLAGS += -Wall -Wextra -Wwrite-strings -Wno-sign-compare -D_FILE_OFFSET_BITS=64

    LOCAL_C_INCLUDES += $(LOCAL_PATH)/ubi-utils/include
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/ubi-utils/src

    LOCAL_SHARED_LIBRARIES := libubi

    LOCAL_MODULE := ubiattach
    LOCAL_MODULE_TAGS := optional

    include $(BUILD_EXECUTABLE)

    # ubidetach util
    #
    include $(CLEAR_VARS)

    LOCAL_SRC_FILES := ubi-utils/src/ubidetach.c

    LOCAL_CFLAGS = -O2 -Wall
    LOCAL_CFLAGS += -Wall -Wextra -Wwrite-strings -Wno-sign-compare -D_FILE_OFFSET_BITS=64

    LOCAL_C_INCLUDES += $(LOCAL_PATH)/ubi-utils/include
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/ubi-utils/src

    LOCAL_SHARED_LIBRARIES := libubi

    LOCAL_MODULE := ubidetach
    LOCAL_MODULE_TAGS := optional

    include $(BUILD_EXECUTABLE)

    # ubiupdatevol util
    #
    include $(CLEAR_VARS)

    LOCAL_SRC_FILES := ubi-utils/src/ubiupdatevol.c

    LOCAL_CFLAGS = -O2 -Wall
    LOCAL_CFLAGS += -Wall -Wextra -Wwrite-strings -Wno-sign-compare -D_FILE_OFFSET_BITS=64

    LOCAL_C_INCLUDES += $(LOCAL_PATH)/ubi-utils/include
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/ubi-utils/src

    LOCAL_SHARED_LIBRARIES := libubi

    LOCAL_MODULE := ubiupdatevol
    LOCAL_MODULE_TAGS := optional

    include $(BUILD_EXECUTABLE)

     

     

  • Hi Ashok,

    This would be outside the scope of support provided in this forum. We would not be able support you effectively in this case. Sorry for the inconvenience.