I'm using a bare bones Linux distribution running on a Phytec i.MX6 ULL SoM on the Phytec demo board for this SoM. I need to be able to copy a file from an SD card.
I flashed the SoM NAND from an SD card in the demo board SD card slot so I know the SD card hardware is good. Now I'm booting from the NAND and attempting to read from the SD card after the OS boots.
When I boot up, there is no mmc* device in dev:
$ ls -l /dev | grep mmc
(no result)
However the SD card is apparently visible via /proc/devices:
$ cat /proc/devices
.
.
.
Block devices:
.
.
.
179 mmc
.
.
.
Is there a way I can create an entry in /dev from the /proc/devices data? Based on Googling I suspect I should use the mknod command but I can't work how.
-- Edit --
Darn, I thought I had it figured out for a second. Based on this https://programmer.group/manual-creation-of-device-nodes-under-dev-in-linux.html I did:
mknod /dev/mmcblk0 b 179 0
mknod /dev/mmcblk0p1 b 179 1
mount /dev/mmcblk0p1 /mnt/
But I get the error:
mount: /mnt: /dev/mmcblk0p1 is not a valid block device.
-- Edit2 --
@user414777
If I do:
ls /sys/block
I get
loop0@ loop3@ loop6@ mtdblock1@ mtdblock4@ ram10@ ram13@ ram2@ ram5@ ram8@
loop1@ loop4@ loop7@ mtdblock2@ ram0@ ram11@ ram14@ ram3@ ram6@ ram9@
loop2@ loop5@ mtdblock0@ mtdblock3@ ram1@ ram12@ ram15@ ram4@ ram7@
There is no mmc in my /sys/block
I'm going to read up on devtmpfs as I'm not familiar with that.
-- Edit3 --
Here are my /dev/block and /sys/dev/ block contents:
$ ls -l /dev/block
lrwxrwxrwx 1 root root 7 Jan 1 00:16 1:0 -> ../ram0
lrwxrwxrwx 1 root root 7 Jan 1 00:16 1:1 -> ../ram1
lrwxrwxrwx 1 root root 8 Jan 1 00:16 1:10 -> ../ram10
lrwxrwxrwx 1 root root 8 Jan 1 00:16 1:11 -> ../ram11
lrwxrwxrwx 1 root root 8 Jan 1 00:16 1:12 -> ../ram12
lrwxrwxrwx 1 root root 8 Jan 1 00:16 1:13 -> ../ram13
lrwxrwxrwx 1 root root 8 Jan 1 00:16 1:14 -> ../ram14
lrwxrwxrwx 1 root root 8 Jan 1 00:16 1:15 -> ../ram15
lrwxrwxrwx 1 root root 7 Jan 1 00:16 1:2 -> ../ram2
lrwxrwxrwx 1 root root 7 Jan 1 00:16 1:3 -> ../ram3
lrwxrwxrwx 1 root root 7 Jan 1 00:16 1:4 -> ../ram4
lrwxrwxrwx 1 root root 7 Jan 1 00:16 1:5 -> ../ram5
lrwxrwxrwx 1 root root 7 Jan 1 00:16 1:6 -> ../ram6
lrwxrwxrwx 1 root root 7 Jan 1 00:16 1:7 -> ../ram7
lrwxrwxrwx 1 root root 7 Jan 1 00:16 1:8 -> ../ram8
lrwxrwxrwx 1 root root 7 Jan 1 00:16 1:9 -> ../ram9
lrwxrwxrwx 1 root root 12 Jan 1 00:16 31:0 -> ../mtdblock0
lrwxrwxrwx 1 root root 12 Jan 1 00:16 31:1 -> ../mtdblock1
lrwxrwxrwx 1 root root 12 Jan 1 00:16 31:2 -> ../mtdblock2
lrwxrwxrwx 1 root root 12 Jan 1 00:16 31:3 -> ../mtdblock3
lrwxrwxrwx 1 root root 12 Jan 1 00:16 31:4 -> ../mtdblock4
lrwxrwxrwx 1 root root 8 Jan 1 00:16 7:0 -> ../loop0
lrwxrwxrwx 1 root root 8 Jan 1 00:16 7:1 -> ../loop1
lrwxrwxrwx 1 root root 8 Jan 1 00:16 7:2 -> ../loop2
lrwxrwxrwx 1 root root 8 Jan 1 00:16 7:3 -> ../loop3
lrwxrwxrwx 1 root root 8 Jan 1 00:16 7:4 -> ../loop4
lrwxrwxrwx 1 root root 8 Jan 1 00:16 7:5 -> ../loop5
lrwxrwxrwx 1 root root 8 Jan 1 00:16 7:6 -> ../loop6
lrwxrwxrwx 1 root root 8 Jan 1 00:16 7:7 -> ../loop7
$ ls -l /sys/dev/block
lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:0 -> ../../devices/virtual/block/ram0/
lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:1 -> ../../devices/virtual/block/ram1/
lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:10 -> ../../devices/virtual/block/ram10/
lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:11 -> ../../devices/virtual/block/ram11/
lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:12 -> ../../devices/virtual/block/ram12/
lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:13 -> ../../devices/virtual/block/ram13/
lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:14 -> ../../devices/virtual/block/ram14/
lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:15 -> ../../devices/virtual/block/ram15/
lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:2 -> ../../devices/virtual/block/ram2/
lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:3 -> ../../devices/virtual/block/ram3/
lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:4 -> ../../devices/virtual/block/ram4/
lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:5 -> ../../devices/virtual/block/ram5/
lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:6 -> ../../devices/virtual/block/ram6/
lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:7 -> ../../devices/virtual/block/ram7/
lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:8 -> ../../devices/virtual/block/ram8/
lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:9 -> ../../devices/virtual/block/ram9/
lrwxrwxrwx 1 root root 0 Jan 1 00:17 31:0 -> ../../devices/soc0/soc/1806000.gpmi-nand/mtd/mtd0/mtdblock0/
lrwxrwxrwx 1 root root 0 Jan 1 00:17 31:1 -> ../../devices/soc0/soc/1806000.gpmi-nand/mtd/mtd1/mtdblock1/
lrwxrwxrwx 1 root root 0 Jan 1 00:17 31:2 -> ../../devices/soc0/soc/1806000.gpmi-nand/mtd/mtd2/mtdblock2/
lrwxrwxrwx 1 root root 0 Jan 1 00:17 31:3 -> ../../devices/soc0/soc/1806000.gpmi-nand/mtd/mtd3/mtdblock3/
lrwxrwxrwx 1 root root 0 Jan 1 00:17 31:4 -> ../../devices/soc0/soc/1806000.gpmi-nand/mtd/mtd4/mtdblock4/
lrwxrwxrwx 1 root root 0 Jan 1 00:16 7:0 -> ../../devices/virtual/block/loop0/
lrwxrwxrwx 1 root root 0 Jan 1 00:16 7:1 -> ../../devices/virtual/block/loop1/
lrwxrwxrwx 1 root root 0 Jan 1 00:16 7:2 -> ../../devices/virtual/block/loop2/
lrwxrwxrwx 1 root root 0 Jan 1 00:16 7:3 -> ../../devices/virtual/block/loop3/
lrwxrwxrwx 1 root root 0 Jan 1 00:16 7:4 -> ../../devices/virtual/block/loop4/
lrwxrwxrwx 1 root root 0 Jan 1 00:16 7:5 -> ../../devices/virtual/block/loop5/
lrwxrwxrwx 1 root root 0 Jan 1 00:16 7:6 -> ../../devices/virtual/block/loop6/
lrwxrwxrwx 1 root root 0 Jan 1 00:16 7:7 -> ../../devices/virtual/block/loop7/
I don't seem to have a /sys/dev/block/179:0