NEED HELP - Android Q&A, Help & Troubleshooting

I have some scripts in my init.d folder, but when i check it on init.d log file.. it doesn't work. I do same as tutorial that i got here.. but it said "nonexistent directory" . Is there anyone know why?
I still confused because two of my scripts (zipalign & loopy_smoothness) are working.. but not for the other..
Here one of my tweaks :
#!system/bin/sh
echo "64" > /sys/module/lowmemorykiller/parameters/cost
echo "0,1,2,4,9,15" > /sys/module/lowmemorykiller/parameters/minfree
echo "0" > /sys/module/lowmemorykiller/parameters/debug_level
The log file said " nonexistent directory "..
Thanks before.. and sorry for my bad english..
Sent from my Hisense E-860 using Tapatalk 2

Looks like you have a typo on line 1.
Should start
#!/system/bin/sh
Sent from my HTC One X+ using Tapatalk 2

albraine said:
I have some scripts in my init.d folder, but when i check it on init.d log file.. it doesn't work. I do same as tutorial that i got here.. but it said "nonexistent directory" . Is there anyone know why?
I still confused because two of my scripts (zipalign & loopy_smoothness) are working.. but not for the other..
Here one of my tweaks :
#!system/bin/sh
echo "64" > /sys/module/lowmemorykiller/parameters/cost
echo "0,1,2,4,9,15" > /sys/module/lowmemorykiller/parameters/minfree
echo "0" > /sys/module/lowmemorykiller/parameters/debug_level
The log file said " nonexistent directory "..
Thanks before.. and sorry for my bad english..
Sent from my Hisense E-860 using Tapatalk 2
Click to expand...
Click to collapse
try this and make sure about script permissions
Code:
#!/system/bin/sh
echo "64" > /sys/module/lowmemorykiller/parameters/cost;
echo "0,1,2,4,9,15" > /sys/module/lowmemorykiller/parameters/minfree;
echo "0" > /sys/module/lowmemorykiller/parameters/debug_level;
you can also add #!/system/xbin/busybox/sh instead of #!/system/bin/sh

No.
I'm not using tipo..
I'm on hisense E-860
Thanks..
I just saw this post..
.
My init.d script is working now

Related

[Need help on shell script]

Can anyone tell me how to add lines in one file by another bash file?
I make a script to change governors and frequency but I need to make the setting set on boot (But I dun want use 3rd party app like SetCPU).
So I need to add these lines to init.d folder's file :
Code:
#!/system/bin/bash (and i add line but this is by default?)
echo "interactiveX" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor (if the next time i chg setting , will this line be deleted or there will be another line with new setting?)
echo "800000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo "245670" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
so what command should i use to add these line ?
Code:
#!/system/bin/sh
an0nym0us_ said:
Code:
#!/system/bin/sh
Click to expand...
Click to collapse
thanks for your reply but i dont really understand...
those '800000' , '245670' and 'interactiveX' are just some example
i mean i want to write this:
echo "800000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
in init.d folder's file by other file
this file is in /system/bin
so i can access and chg my cpu setting by typing 'cpuclock'
there for i need a command to add line to init.d in order to set on boot
Code:
echo " Change CPU Governor Profile "
echo ""
echo ""
echo " Current Governor: "
echo "$CUR_GOV"
echo ""
$sleep
echo " Available Governors: "
echo "$AVAIL_GOV"
echo ""
$sleep
echo " Insert your desired governor: "
echo -n " Your Governor: ";read GOV
echo $GOV > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
[COLOR="Red"][so now i change my current governor,but the governor will be reset to default(ondemand) after next reboot]
[all i want is , while echoing current governor , i need to add one line to init.d there too , but i don know how :(][/COLOR]
echo " Complete "
echo ""
$sleep
echo -e " Current Governor: "
echo ""
echo ""
$sleep
echo -n " Press Enter Key To Continue... ";
read enterKey
opt=0;;
asd

[SOLVED]Ondemand tweaks using init.d script

I want to edit some ondemand values and I have a script but when I run it in script manager it shows errors.
My Q is what commands do I have to add for it to work?
This was my original post regarding the Q,please refer here for more details: http://forum.xda-developers.com/showthread.php?t=1815616
Here's what I have:
#!/system/bin/sh
echo 85 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo 2 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
echo 50000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias
So many devs and no one can help.. Whats Q&A good for?
EDIT---
Solved by myself

make a .sh file

how can i make a .sh file with more than 1 command in it?
for example:
echo "90" > /sys/devices/system/cpu/cpufreq/lulzactive/inc_cpu_load
echo "1" > /sys/devices/system/cpu/cpufreq/lulzactive/pump_up_step
echo "2" > /sys/devices/system/cpu/cpufreq/lulzactive/pump_down_step
echo "50000" > /sys/devices/system/cpu/cpufreq/lulzactive/up_sample_time
echo "40000" > /sys/devices/system/cpu/cpufreq/lulzactive/down_sample_time
echo "5" > /sys/devices/system/cpu/cpufreq/lulzactive/screen_off_min_step
can i make a single .sh file and don't have to split it in 6 different file???
(this file should be executed with scriptmanager)
hope i have made myself clear.
Of course you can, simply copy all the lines you need into a file, and add before them #!/system/bin/sh, and that's it. Save and run your file.
thanks it worked...very strange, i made the exact same thing before posting this question, but each time it doesn't worked...
hahaha... yeah, it happens :silly:

[Q] edit init.rc to run shell scripts on boot (help urgent!l

I've added the following lines into init.rc
"service sysinit /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d"
My script is created inside the init.d directory.
#!/system/bin/sh
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb
Actually, the above action is worked. But when I have added one more script below the echo "2048... script, the problem was come.
( echo "1337" > /system/etc/init.d/gg.txt) p.s. gg.txt is not existed at the beginning
So, finally read_ahead_kb file has changed, but the gg.txt hasn't been created.
Can any one provide the reason and the solution to me?? Emergent! Thanks a lot!!
Or is it necessary for me to add ";" symbol at the end of each script?
If I want to use an infinity loop's script on boot (while : do xxxx done )
is it possible to do so? And how? Thanks
Any body can help?
No one??
hades94720 said:
No one??
Click to expand...
Click to collapse
use double >>
echo 11111 >> abc.txt
echo 2222 >> abc.txt

How to get init.d support on MIUI 7?

Hey everyone,
I've been failing miserably to get init.d support on the MIUI 7 developer roms for the Redmi Note 2 and tried every possible thing from this thread on XDA: http://forum.xda-developers.com/showthread.php?t=1933849. I found a couple of posts regarding init.d support on en.miui.com as well, but they are all targeted at MIUI 5/6. Is there anyone who can help me out with this? I would love to get the support to prevent data from leaking at boot (firewall).
Thanks!
Edit 24/01: Flashed Namaless' MIUI Speed MOD which enabled init.d support. Scripts are being executed correctly on boot.
Smiui ?
Have you tried the smiui rom ? http://www.smiui.net/
It works OK on my Redmi Note 2 Prime and claims to have init.d support although I haven't used this feature yet.
Discussed here
http://forum.xda-developers.com/redmi-note-2/development/rom-smiui-rom-kitchen-major-xiaomi-t3225567
I'm using Miui 7 5.11.19
elaurens said:
Hey everyone,
I've been failing miserably to get init.d support on the MIUI 7 developer roms for the Redmi Note 2 and tried every possible thing from this thread on XDA: http://forum.xda-developers.com/showthread.php?t=1933849. I found a couple of posts regarding init.d support on en.miui.com as well, but they are all targeted at MIUI 5/6. Is there anyone who can help me out with this? I would love to get the support to prevent data from leaking at boot (firewall).
Thanks!
Click to expand...
Click to collapse
Pal, this 'switcher' made the magic for me, https://play.google.com/store/apps/details?id=com.broodplank.initdtoggler&hl=it
Redmi Note 2 Prime Dev EU 5.11.1 here
fourlans said:
Have you tried the smiui rom ? http://www.smiui.net/
It works OK on my Redmi Note 2 Prime and claims to have init.d support although I haven't used this feature yet.
Discussed here
http://forum.xda-developers.com/redmi-note-2/development/rom-smiui-rom-kitchen-major-xiaomi-t3225567
I'm using Miui 7 5.11.19
Click to expand...
Click to collapse
Thanks for the tip. Gonna use that as a last resort as I'd rather just run the Chinese developer rom + init.d support (don't really need any of the other features which smiui offers).
oldslowdiver said:
Pal, this 'switcher' made the magic for me, https://play.google.com/store/apps/details?id=com.broodplank.initdtoggler&hl=it
Redmi Note 2 Prime Dev EU 5.11.1 here
Click to expand...
Click to collapse
Installed on 5.11.19 and enabled AfWall+ data leaking fix (script on startup), but it's still not running. Can you tell me which script you managed to get running after enabling init.d through the toggler app?
Thx.
elaurens said:
Installed on 5.11.19 and enabled AfWall+ data leaking fix (script on startup), but it's still not running. Can you tell me which script you managed to get running after enabling init.d through the toggler app?
Thx.
Click to expand...
Click to collapse
These ones:
Strict min free
echo "2048,3072,6144,15360,17920,20480" > /sys/module/lowmemorykiller/parameters/minfree
VM Management
echo "4096" > /proc/sys/vm/min_free_kbytes
echo "0" > /proc/sys/vm/oom_kill_allocating_task;
echo "0" > /proc/sys/vm/panic_on_oom;
echo "0" > /proc/sys/vm/laptop_mode;
echo "0" > /proc/sys/vm/swappiness
echo "50" > /proc/sys/vm/vfs_cache_pressure
echo "90" > /proc/sys/vm/dirty_ratio
echo "70" > /proc/sys/vm/dirty_background_ratio
Normalize Sleeper
mount -t debugfs none /sys/kernel/debug
echo NO_NORMALIZED_SLEEPER > /sys/kernel/debug/sched_features
---------- Post added at 06:17 PM ---------- Previous post was at 06:12 PM ----------
oldslowdiver said:
These ones:
Strict min free
echo "2048,3072,6144,15360,17920,20480" > /sys/module/lowmemorykiller/parameters/minfree
VM Management
echo "4096" > /proc/sys/vm/min_free_kbytes
echo "0" > /proc/sys/vm/oom_kill_allocating_task;
echo "0" > /proc/sys/vm/panic_on_oom;
echo "0" > /proc/sys/vm/laptop_mode;
echo "0" > /proc/sys/vm/swappiness
echo "50" > /proc/sys/vm/vfs_cache_pressure
echo "90" > /proc/sys/vm/dirty_ratio
echo "70" > /proc/sys/vm/dirty_background_ratio
Normalize Sleeper
mount -t debugfs none /sys/kernel/debug
echo NO_NORMALIZED_SLEEPER > /sys/kernel/debug/sched_features
Click to expand...
Click to collapse
You know what.. they actually won't work! I was sure they did, I just checked, and they actually don't. Still, Init.d is enabled.. wtf?
oldslowdiver said:
These ones:
Strict min free
echo "2048,3072,6144,15360,17920,20480" > /sys/module/lowmemorykiller/parameters/minfree
VM Management
echo "4096" > /proc/sys/vm/min_free_kbytes
echo "0" > /proc/sys/vm/oom_kill_allocating_task;
echo "0" > /proc/sys/vm/panic_on_oom;
echo "0" > /proc/sys/vm/laptop_mode;
echo "0" > /proc/sys/vm/swappiness
echo "50" > /proc/sys/vm/vfs_cache_pressure
echo "90" > /proc/sys/vm/dirty_ratio
echo "70" > /proc/sys/vm/dirty_background_ratio
Normalize Sleeper
mount -t debugfs none /sys/kernel/debug
echo NO_NORMALIZED_SLEEPER > /sys/kernel/debug/sched_features
---------- Post added at 06:17 PM ---------- Previous post was at 06:12 PM ----------
You know what.. they actually won't work! I was sure they did, I just checked, and they actually don't. Still, Init.d is enabled.. wtf?
Click to expand...
Click to collapse
Yeah see.. that's my problem with it I can't find the thread back on en.miui.com's forum, but I read earlier today that MIUI uses another way to launch scripts on startup. No further explanation was given though. Weird, maybe I should try the sMIUI ROM and see what it gives.
Enable Init.d on Redmi Note 2
elaurens said:
Yeah see.. that's my problem with it I can't find the thread back on en.miui.com's forum, but I read earlier today that MIUI uses another way to launch scripts on startup. No further explanation was given though. Weird, maybe I should try the sMIUI ROM and see what it gives.
Click to expand...
Click to collapse
Okay, I found the thread you mentioned on MIUI's website (http://en.miui.com/thread-129336-1-1.html), but you need to correct the path as it follows in Terminal Emulator:
Type :
su
sh /storage/sdcard1/term-init.sh
You have to place the term-init.sh inside the internal SD card in this case, download file here https://www.androidfilehost.com/?w=...5e497fa2bc98ce82437cb8cbfbdb4e56c73c1dd621ead
Anyway, if it works, it should create a Test.log file in /data, but it won't
Try your luck
oldslowdiver said:
Okay, I found the thread you mentioned on MIUI's website (http://en.miui.com/thread-129336-1-1.html), but you need to correct the path as it follows in Terminal Emulator:
Type :
su
sh /storage/sdcard1/term-init.sh
You have to place the term-init.sh inside the internal SD card in this case, download file here https://www.androidfilehost.com/?w=...5e497fa2bc98ce82437cb8cbfbdb4e56c73c1dd621ead
Anyway, if it works, it should create a Test.log file in /data, but it won't
Try your luck
Click to expand...
Click to collapse
Cool of you to follow this up The term-init.sh script actually comes from XDA and this is its original thread: http://forum.xda-developers.com/showthread.php?t=1933849. I copied the script to the internal SD card and executed it (with different versions of busybox), the script ran successfully (/system/etc/init.d and other files are created, permissions set correctly), but that Test.log file isn't being created in /data after a reboot. Of course, when I run the following command manually from a terminal, it does create the Test.log file: /system/xbin/busybox run-parts /system/etc/init.d. So for some reasons, the scripts in /system/etc/init.d/ aren't being executed at boot (and my knowledge is too restricted to troubleshoot this further :/)
elaurens said:
Cool of you to follow this up The term-init.sh script actually comes from XDA and this is its original thread: http://forum.xda-developers.com/showthread.php?t=1933849. I copied the script to the internal SD card and executed it (with different versions of busybox), the script ran successfully (/system/etc/init.d and other files are created, permissions set correctly), but that Test.log file isn't being created in /data after a reboot. Of course, when I run the following command manually from a terminal, it does create the Test.log file: /system/xbin/busybox run-parts /system/etc/init.d. So for some reasons, the scripts in /system/etc/init.d/ aren't being executed at boot (and my knowledge is too restricted to troubleshoot this further :/)
Click to expand...
Click to collapse
Exactly. And I found here http://en.miui.com/thread-99174-1-1.html you may edit Build.prop and add
sys.initd = 1
to enable Init.d scripts at boot, but, again, it won't work. So, if anyone finds a solution, please, share.
oldslowdiver said:
Exactly. And I found here http://en.miui.com/thread-99174-1-1.html you may edit Build.prop and add
sys.initd = 1
to enable Init.d scripts at boot, but, again, it won't work. So, if anyone finds a solution, please, share.
Click to expand...
Click to collapse
Haha. Are you oldmyself on the official MIUI forum who gave me the exact same reply in this thread?
elaurens said:
Haha. Are you oldmyself on the official MIUI forum who gave me the exact same reply in this thread?
Click to expand...
Click to collapse
heheheheh small world, it's me.
oldslowdiver said:
heheheheh small world, it's me.
Click to expand...
Click to collapse
Just so you know, I've got init.d support and scripts being executed on boot thanks to @Namaless' MIUI speed mod. I'm currently running the latest version (v.1.19) and AfWall's firewall rules are being applied on boot. Big thanks to him for that

Categories

Resources