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.

Android4.0 how to set the gadget backing file?

 Hi all:

the android use backing file when work at the gadget mass storage mode.   I select the blaze_defconfig when build the kernel. there isn`t any  *.ko generated .so It build into the kernel. So ,I want to know where to set the backing file for the driver?

 thanks

 herry.su

  • Herry,

    Which release are you working with (for example, 4AI.1.5)?  The backing file is described in /drivers/usb/gadget/f_mass_storage.c.  Here are some excerpts:

    * MSF is configured by specifying a fsg_config structure.  It has the
     * following fields:
     *
     * nluns Number of LUNs function have (anywhere from 1
     * to FSG_MAX_LUNS which is 8).
     * luns An array of LUN configuration values.  This
     * should be filled for each LUN that
     * function will include (ie. for "nluns"
     * LUNs).  Each element of the array has
     * the following fields:
     * ->filename The path to the backing file for the LUN.
     * Required if LUN is not marked as
     * removable.

    * The pathnames of the backing files and the ro settings are
    * available in the attribute files "file" and "ro" in the lun<n> (or
    * to be more precise in a directory which name comes from
    * "lun_name_format" option!) subdirectory of the gadget's sysfs
    * directory.

    If you want to build a driver as a module, make sure it is specified as "=m" in the config file.  (It is better to set this using menuconfig or xconfig, rather than directly editing blaze_defconfig, in order to take care of any dependencies.)  You also need to run "make modules" after building the kernel.
    Regards,
    Gina