USB Mount/ Umount configuration

cancel
Showing results for 
Search instead for 
Did you mean: 

USB Mount/ Umount configuration

770 Views
vinothkumars
Senior Contributor III

Dear NXP,

I done manually for mount , umount the usb stick. But, I need Mount and unmount the usb automatically in android 9.

Mount :

   mount -t vfat /dev/block/sda /mnt/media_rw/

Umount:

   umount /mnt/media_rw

Thanks & Regards,

VinothS,

Regards,
Vinothkumar Sekar
0 Kudos
5 Replies

390 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi,

You could try with the following procedure applied by other user:

Please have the following change.

android_source/device/fsl

diff --git a/imx8m/evk_8mm/fstab.freescale b/imx8m/evk_8mm/fstab.freescale
index 72d412fd..89c5e84a 100644
--- a/imx8m/evk_8mm/fstab.freescale
+++ b/imx8m/evk_8mm/fstab.freescale
@@ -3,6 +3,7 @@
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK

+/devices/platform/30b50000.mmc/mmc_host/* /mnt/media_rw/extsd vfat defaults voldmanaged=extsd:auto
/devices/platform/32e40000.usb/ci_hdrc.0/* auto auto defaults voldmanaged=usb:auto
/dev/block/by-name/system / ext4 ro,barrier=1 wait,slotselect
/dev/block/by-name/userdata /data ext4 nosuid,nodev,nodiratime,noatime,nomblk_io_submit,noauto_da_alloc,errors=panic wait,formattable,quota,fileencryption=software,reservedsize=128M

diff --git a/imx8m/evk_8mm/init.rc b/imx8m/evk_8mm/init.rc
index 8a5ee83f..f6dfe004 100644
--- a/imx8m/evk_8mm/init.rc
+++ b/imx8m/evk_8mm/init.rc
@@ -20,6 +20,8 @@ on init
# Support legacy paths
symlink /sdcard /mnt/sdcard
symlink /sdcard /storage/sdcard0
+ mkdir /mnt/media_rw/extsd 0755 system system
+ symlink /mnt/media_rw/extsd /storage/extsd

# setup the global environment
export CORE_REGISTER_FILE /vendor/etc/core_register

android_source/frameworks/base

diff --git a/core/res/res/xml/storage_list.xml b/core/res/res/xml/storage_list.xml
index ceebdccdafe..88d2dfe7cba 100644
--- a/core/res/res/xml/storage_list.xml
+++ b/core/res/res/xml/storage_list.xml
@@ -25,4 +25,8 @@
android:mountPoint="/storage/sdcard"
android:storageDescription="@string/storage_usb"
android:primary="true" />
+ <storage
+ android:mountPoint="/storage/extsd"
+ android:storageDescription="@string/storage_sd_card"
+ android:primary="true" />
</StorageList>

Hope this will be useful for you.
Best regards!
/Carlos
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

-------------------------------------------------------------------------------

0 Kudos

390 Views
vinothkumars
Senior Contributor III

Thank you Carlos,

          

Is it applicable for imx8q?

Thanks & Regards,

VinothS,

Regards,
Vinothkumar Sekar
0 Kudos

390 Views
vinothkumars
Senior Contributor III

Thank you Carlos,

I tried your configuration it's not working for me. As per this thread (USB Storage is not mount in IMX8QM ). I closed this thread now,

Regards,

VinothS.

Regards,
Vinothkumar Sekar
0 Kudos

390 Views
pandaerliu
Contributor II

I had tried on imx6q. It doesn't work, too

0 Kudos

390 Views
vinothkumars
Senior Contributor III

Hi pandaerliu

Give me some more information.

Regards, 

VinothS

Regards,
Vinothkumar Sekar
0 Kudos