Using the microSD from user space

Read the microSD serial number

~# cd /sys/class/mmc_host/mmc?/mmc?:*
/sys/class/mmc_host/mmc0/mmc0:aaaa# cat serial
0x015c5340

A lot of other info are available:

/sys/class/mmc_host/mmc0/mmc0:aaaa# ls -al
total 0
drwxr-xr-x 4 root root    0 Jun 27 15:37 .
drwxr-xr-x 4 root root    0 Jun 27 15:37 ..
drwxr-xr-x 3 root root    0 Jun 27 15:37 block
-r--r--r-- 1 root root 4096 Jun 28 07:18 cid
-r--r--r-- 1 root root 4096 Jun 28 07:28 csd
-r--r--r-- 1 root root 4096 Jun 28 07:28 date
lrwxrwxrwx 1 root root    0 Jun 27 15:37 driver -> ../../../../../../bus/mmc/drk
-r--r--r-- 1 root root 4096 Jun 28 07:28 erase_size
-r--r--r-- 1 root root 4096 Jun 28 07:21 fwrev
-r--r--r-- 1 root root 4096 Jun 28 07:21 hwrev
-r--r--r-- 1 root root 4096 Jun 28 07:21 manfid
-r--r--r-- 1 root root 4096 Jun 27 15:37 name
-r--r--r-- 1 root root 4096 Jun 28 07:18 oemid
drwxr-xr-x 2 root root    0 Jun 28 07:28 power
-r--r--r-- 1 root root 4096 Jun 28 07:28 preferred_erase_size
-r--r--r-- 1 root root 4096 Jun 28 07:28 scr
-r--r--r-- 1 root root 4096 Jun 27 15:37 serial
lrwxrwxrwx 1 root root    0 Jun 27 15:37 subsystem -> ../../../../../../bus/mmc
-r--r--r-- 1 root root 4096 Jun 28 07:28 type
-rw-r--r-- 1 root root 4096 Jun 27 15:37 uevent