Jump to content


Photo

During booting: cant open /sys/block/mmc/removable


  • Please log in to reply
30 replies to this topic

Re: During booting: cant open /sys/block/mmc/removable #21 Taapat

  • PLi® Core member
  • 1,112 posts

+59
Good

Posted 20 March 2017 - 08:37

But its still does not fix the second problem: cat: cant open /sys/block/mmc/device/model : No such file or directory
 
Look at the second part of my commit.
On zgemma does not exist /sys/block/$DEVBASE/device. I did not find any other records in /sys/block/$DEVBASE that may indicate to a model.
Therefore, I added a check or /sys/block/$DEVBASE/device/model exists and if not, assume that with 7-char DEVBASE it's mmc.


Re: During booting: cant open /sys/block/mmc/removable #22 WanWizard

  • Forum Moderator
    PLi® Core member
  • 35,561 posts

+507
Excellent

Posted 20 March 2017 - 17:21

How come $DEVVASE is "mmc"? It should be "mmcblk0", as it now takes the first 7 first, and checks if that exists in /sys/block, which it should do?

 

And according to your post at https://forums.openp...ed/#entry647457 /sys/block/mmcblk0/device does exist?


Many answers to your question can be found in our new and improved wiki.

Currently in active use: HD2400 (4xS2)VU+Duo2 (3xS2)Zgemma H2.H (S2+C), VU+Zero, Edision OS mini+

For testing purposes: ET10000 (4xS2)XP1000Formuler F1 (2xS2)Miraclebox Premium Micro (S2+C/T),  ET7500 (S2)ET8500 (S2), Zgemma H5.2TC (S2+C/T), SAB TripleAlpha (S2+C/T), Galaxy 4K (FBC)


Re: During booting: cant open /sys/block/mmc/removable #23 Taapat

  • PLi® Core member
  • 1,112 posts

+59
Good

Posted 20 March 2017 - 18:28

Sorry, /sys/block/$DEVBASE/device existed, does not exist /sys/block/$DEVBASE/device/model:

root@h3:~# ls -la /sys/block/mmcblk0/device/
drwxr-xr-x    3 root     root             0 Jan  1  1970 .
drwxr-xr-x    4 root     root             0 Jan  1  1970 ..
-r--r--r--    1 root     root          4096 Jan  1  1970 cid
-r--r--r--    1 root     root          4096 Jan  1  1970 csd
-r--r--r--    1 root     root          4096 Jan  1  1970 date
lrwxrwxrwx    1 root     root             0 Jan  1  1970 driver -> ../../../../../../bus/mmc/drivers/mmcblk
-r--r--r--    1 root     root          4096 Jan  1  1970 erase_size
-r--r--r--    1 root     root          4096 Jan  1  1970 fwrev
-r--r--r--    1 root     root          4096 Jan  1  1970 hwrev
-r--r--r--    1 root     root          4096 Jan  1  1970 manfid
-r--r--r--    1 root     root          4096 Jan  1  1970 name
-r--r--r--    1 root     root          4096 Jan  1  1970 oemid
drwxr-xr-x    2 root     root             0 Jan  1  1970 power
-r--r--r--    1 root     root          4096 Jan  1  1970 preferred_erase_size
-r--r--r--    1 root     root          4096 Jan  1  1970 scr
-r--r--r--    1 root     root          4096 Jan  1  1970 serial
lrwxrwxrwx    1 root     root             0 Jan  1  1970 subsystem -> ../../../../../../bus/mmc
-r--r--r--    1 root     root          4096 Jan  1  1970 type
-rw-r--r--    1 root     root          4096 Jan  1  1970 uevent

Edited by Taapat, 20 March 2017 - 18:28.


Re: During booting: cant open /sys/block/mmc/removable #24 WanWizard

  • Forum Moderator
    PLi® Core member
  • 35,561 posts

+507
Excellent

Posted 20 March 2017 - 20:08

Ok.

 

https://github.com/O...9ecd5c9f40c4d3b


Many answers to your question can be found in our new and improved wiki.

Currently in active use: HD2400 (4xS2)VU+Duo2 (3xS2)Zgemma H2.H (S2+C), VU+Zero, Edision OS mini+

For testing purposes: ET10000 (4xS2)XP1000Formuler F1 (2xS2)Miraclebox Premium Micro (S2+C/T),  ET7500 (S2)ET8500 (S2), Zgemma H5.2TC (S2+C/T), SAB TripleAlpha (S2+C/T), Galaxy 4K (FBC)


Re: During booting: cant open /sys/block/mmc/removable #25 Taapat

  • PLi® Core member
  • 1,112 posts

+59
Good

Posted 20 March 2017 - 22:58

Only DEVBASE can be mmcblk[0-9] not only mmcblk0.
Therefore, I think it is better to use:

if [ ${DEVBASE:0:6} = "mmcblk" ]; then


Re: During booting: cant open /sys/block/mmc/removable #26 WanWizard

  • Forum Moderator
    PLi® Core member
  • 35,561 posts

+507
Excellent

Posted 20 March 2017 - 23:04

Not sure if that works in shell, I think that is bash, I'll have to check.

 

Having said that, if you have multiple similar block devices, using "mmc" will cause a collision for the mount point.

 

edit: on my laptop it works in shell, but I have no box to test it at the moment

sh-4.3$ DEVBASE=mmcblk0
sh-4.3$ echo ${DEVBASE:0:6}
mmcblk
sh-4.3$ 

Edited by WanWizard, 20 March 2017 - 23:05.

Many answers to your question can be found in our new and improved wiki.

Currently in active use: HD2400 (4xS2)VU+Duo2 (3xS2)Zgemma H2.H (S2+C), VU+Zero, Edision OS mini+

For testing purposes: ET10000 (4xS2)XP1000Formuler F1 (2xS2)Miraclebox Premium Micro (S2+C/T),  ET7500 (S2)ET8500 (S2), Zgemma H5.2TC (S2+C/T), SAB TripleAlpha (S2+C/T), Galaxy 4K (FBC)


Re: During booting: cant open /sys/block/mmc/removable #27 Taapat

  • PLi® Core member
  • 1,112 posts

+59
Good

Posted 20 March 2017 - 23:23

Before write there I tested this on my box:
root@h3:~# DEVBASE="mmcblk0"
root@h3:~# if [ "$DEVBASE" == "mmcblk0" ]; then echo "EXIST"; fi
EXIST
root@h3:~# if [ ${DEVBASE:0:6} = "mmcblk" ]; then echo "EXIST"; fi
EXIST
root@h3:~# if [ ${DEVBASE:0:6} = "mmcblx" ]; then echo "EXIST"; fi
root@h3:~#


Re: During booting: cant open /sys/block/mmc/removable #28 Taapat

  • PLi® Core member
  • 1,112 posts

+59
Good

Posted 20 March 2017 - 23:26

Having said that, if you have multiple similar block devices, using "mmc" will cause a collision for the mount point.

 

No, if the mount point already exists, it is mounted as /media/$MDEV: https://github.com/O...v-mount.sh#L104



Re: During booting: cant open /sys/block/mmc/removable #29 WanWizard

  • Forum Moderator
    PLi® Core member
  • 35,561 posts

+507
Excellent

Posted 21 March 2017 - 11:55

I know that, I was just wondering if we shouldn't create "mmc1", "mmc2", etc... instead, since we have the device number.

 

And thanks for confirmation. I've bricked my box, and since it's 600km away from where I am at the moment, I can't test anymore. :(

 

Just wondering: if this works, why does the rest of the script things like "expr substr $MDEV 1 7", which requires a secondary shell? That could be replaced by ${MDEV:0:7} as well?


Many answers to your question can be found in our new and improved wiki.

Currently in active use: HD2400 (4xS2)VU+Duo2 (3xS2)Zgemma H2.H (S2+C), VU+Zero, Edision OS mini+

For testing purposes: ET10000 (4xS2)XP1000Formuler F1 (2xS2)Miraclebox Premium Micro (S2+C/T),  ET7500 (S2)ET8500 (S2), Zgemma H5.2TC (S2+C/T), SAB TripleAlpha (S2+C/T), Galaxy 4K (FBC)


Re: During booting: cant open /sys/block/mmc/removable #30 Erik Slagter

  • PLi® Core member
  • 40,490 posts

+435
Excellent

Posted 1 April 2017 - 09:34

The question is whether the braindead busybox shell understands this bash-ism. I fear not.


* Wavefrontier T90 with 28E/23E/19E/13E/9E/4.8E/0.8W/5W via SCR switches 2 x 2 x 6 user bands
* UPC digital cable TV (FTA)


Re: During booting: cant open /sys/block/mmc/removable #31 WanWizard

  • Forum Moderator
    PLi® Core member
  • 35,561 posts

+507
Excellent

Posted 1 April 2017 - 11:52

The code is tested before I've implemented it, so the answer is "yes, it does understand this". ;)


Many answers to your question can be found in our new and improved wiki.

Currently in active use: HD2400 (4xS2)VU+Duo2 (3xS2)Zgemma H2.H (S2+C), VU+Zero, Edision OS mini+

For testing purposes: ET10000 (4xS2)XP1000Formuler F1 (2xS2)Miraclebox Premium Micro (S2+C/T),  ET7500 (S2)ET8500 (S2), Zgemma H5.2TC (S2+C/T), SAB TripleAlpha (S2+C/T), Galaxy 4K (FBC)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users