Noob Dev Question

hameerabbasi

Senior Member
Oct 12, 2012
389
78
0
28
Messel
www.iolympiads.com
First, I'm on Carbon ROM (13/11 Nightly) and Plasma Kernel 2.02. I noticed it had the frandom module (and was probably linking it to /dev/random and /dev/urandom too, since /dev/random.ori and /dev/urandom.ori existed. But since every entropy checker ever was showing 4096 constant, I suspect it linked both to /dev/erandom. To work around this, I wrote the following init.d script (named 20frandom):

Code:
#!/system/bin/sh

if [ -e /dev/frandom ];
then
  mv /dev/random /dev/random.orig
  ln -s /dev/random /dev/frandom
fi

if [ -e /dev/erandom ];
then
  mv /dev/urandom /dev/urandom.orig
  ln -s /dev/urandom /dev/erandom
fi
(Yes, I did put an empty enter there). I set permissions to rwx for user and r-x for others with root explorer. I tried executing the script (worked fine), ls showed the extra .orig files, but root explorer would constantly crash. Tried rebooting, bootloop. Deleted the init.d script from recovery, we're back!

But is there some unwritten rule I'm breaking here? Why the bootloop? Any way around this?

Sent from my GT-N7100 using Tapatalk 4
 

gub

Senior Member
Apr 18, 2006
81
31
0
Unlike hard links, a symbolic link is not the same as the file it points to.
You may want to try to replace the "ln -s" with just "ln" in your script.
 
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone