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
  • 2,343 posts

+120
Excellent

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

  • PLi® Core member
  • 68,624 posts

+1,739
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?


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Pro (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

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


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

  • PLi® Core member
  • 2,343 posts

+120
Excellent

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

  • PLi® Core member
  • 68,624 posts

+1,739
Excellent

Posted 20 March 2017 - 20:08

Ok.

 

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


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Pro (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

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


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

  • PLi® Core member
  • 2,343 posts

+120
Excellent

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

  • PLi® Core member
  • 68,624 posts

+1,739
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.

Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Pro (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

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


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

  • PLi® Core member
  • 2,343 posts

+120
Excellent

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
  • 2,343 posts

+120
Excellent

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

  • PLi® Core member
  • 68,624 posts

+1,739
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?


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Pro (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

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


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

  • PLi® Core member
  • 46,960 posts

+541
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 via SCR switches 2 x 2 x 6 user bands
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.


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

  • PLi® Core member
  • 68,624 posts

+1,739
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". ;)


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Pro (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

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



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users