yashsingh1/xdaforums huggingface dataset:
[Nexus S Android Development] Skyline969:
I used Android Terminal Emulator and ran su to become root prior to running "cp /storage/sdcard0/99marmite.sh /etc/init.d" and it complained about being a read-only file system.

After that, I also tried ES File Explorer (my favorite file explorer by far) with root access to copy the file, and it failed as well.
[Nexus S Android Development] polobunny:
Are you sure you have root? :p

You don't need the file extension by the way when dropping your script in init.d and init.d is a directory so

cp /sdcard/99marmite.sh /etc/init.d/99marmite

Should work. Have you enabled root access in ES File Explorer options?
[Nexus S Android Development] Skyline969:
I'm 100% sure I have root, yes. Both with the terminal and in ES File Explorer I've had prompts to grant root access (which I have done), and I received the notice that the application has been given root access. I'm 100% sure that root access is enabled in ES File Explorer, as I've gone and double-checked my settings.

C'mon, I work with Linux (and Windows, but that's irrelevant in this case) systems for a living. Cut me some slack. :p
[Nexus S Android Development] polobunny:
Hey never know. :p

Still wondering though, you shouldn't have trouble accessing init.d in RW if you have root.
[Nexus S Android Development] kiden:
Hey, try using this app: https://play.google.com/store/apps/...sMSwxLDIxMiwib3MudG9vbHMuc2NyaXB0bWFuYWdlciJd

That's what I've always used.
[Nexus S Android Development] polobunny:
That's cool and all, but it's another app running at boot when you already have init.d support in the ROM. Kinda going overkill you know. :/

Edit: Thanks for the script example BTW, makes up for a really clean, easy to edit script. Good for beginners too!
[Nexus S Android Development] Skyline969:
HA. Wow. I just realized my mistake. I was getting root access, sure, but what I didn't do is check the option in ES File Explorer to mount / and /system as writable. Checked that, copied just fine on the first try.

However, now it doesn't seem to be executing at all. The changes I made in there don't seem to be taking effect. Is there something else I need to set somewhere else to actually execute said script on boot?
[Nexus S Android Development] polobunny:
I'm going to beat you up with a stick. :p

Do you have a working busybox install? If you aren't sure, you can download BusyBox by stericson on the Play store.

Oh and you ROM needs init.d support. Most custom roms do, but stock doesn't for instance.
[Nexus S Android Development] Skyline969:
Hey, hey now! No need for violence! :p At least I'm open to admitting mistakes and trying things without hesitation. That's gotta count for something, right?

First thing I noticed was a major facepalm on my end - file permissions. So I set those properly (rwxr-xr-x, or 755), still no dice.

I'm not sure if busybox is included with my ROM - Slim Bean. (Link to features: http://slimroms.net/index.php/slim-bean-features). I'm gonna go ahead and brace myself for an incoming stick... but what exactly does busybox do?

EDIT: Before you swing that stick, I'll let you know that according to BusyBox by stericson, busybox 1.20.2-jb is installed to /system/xbin/.
[Nexus S Android Development] polobunny:
I might be wrong but I believe Slim Bean has init.d support.

BusyBox is a set of tools for Unix/Linux packaged in one neat executable. Many root programs use it and often ship with their own version (Titanium Backup for example). For a working init.d setup, you need this. A lot of roms ship with Busybox already, but without being able to verify you can simply install the one I told you about.

Make sure in your init.d script you have the line

#!/system/bin/sh

At the top, so your system knowns it's a script.

Edit: So that means Busybox is installed and should be working. At least, some version of it. :)
[Nexus S Android Development] Skyline969:
Alright, so we're clearing some air here! Progress! :p

Well, this is my script (taken from one on the original post and modified slightly), I'm pretty sure the syntax is correct:

#!/system/bin/sh
# ---------- CPU (Overclock and Gov) ----------
echo "smartassV2" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 200000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 1200000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq

# ---------- BLD (Backlight Dimmer) ----------
# Enabled (0 - Disable; 1 - Enable)
echo 1 > /sys/devices/virtual/misc/backlightdimmer/enabled

# Delay (in milliseconds)
echo 5000 > /sys/devices/virtual/misc/backlightdimmer/delay

# ---------- Vodoo Colors ----------
echo 1951208320 > /sys/class/misc/voodoo_color/red_multiplier
echo 1720296160 > /sys/class/misc/voodoo_color/green_multiplier
echo 1974299520 > /sys/class/misc/voodoo_color/blue_multiplier
echo -50 > /sys/class/misc/voodoo_color/red_v1_offset
echo -53 > /sys/class/misc/voodoo_color/green_v1_offset
echo -44 > /sys/class/misc/voodoo_color/blue_v1_offset

# ---------- BLN (Backlight Notification) ----------
# Enabled (0 - Disable; 1 - Enable)
echo 1 > /sys/class/misc/backlightnotification/enabled

# Blink (0 - Disable; 1 - Enable)
echo 1 > /sys/class/misc/backlightnotification/in_kernel_blink

# Blink Speed (1 is fastest; 10 is slowest)
echo 7 > /sys/class/misc/backlightnotification/blink_speed

# Blink Mode
# MODE 1: Normal blinking, no special timing effects
# MODE 2: Starts fast, and slows
# MODE 3: Starts slow, and speeds up
# MODE 4: Starts fast, slows, then speeds up again, etc
echo 1 > /sys/class/misc/backlightnotification/blink_mode

# Max Blink Mode
# MODE 1: how blinks there will be.
# MODE 2/3/4: how many times the pattern will repeat
echo 5 > /sys/class/misc/backlightnotification/max_blink_count

# Final Blink State(1 is on, 0 is off)
echo 1 > /sys/class/misc/backlightnotification/blink_finalstate
[Nexus S Android Development] kiden:
No I mean for copying the script into etc/init.d! Its worked well for me for copying scripts as well as easily editing and running and whatnot. Also, I'm on slim bean too, and haven't had issues.

And you are welcome. I'm glad it helped!
[Nexus S Android Development] polobunny:
The script is sound, it should be working.

If you run the script manually, does it work? Are your backlight dimmer settings working and all that? It should, obviously. Just to troubleshoot whether it's the script creating an issue or init.d not running properly.

Ah I misunderstood you. Have not used script manager so much so I did not recall that!
[Nexus S Android Development] Skyline969:
Well, it definitely did something. Here, a screenshot!

Now, when I get a notification the buttons below the screen light up. I thought from that script they were supposed to blink slowly 5 times...?

However, something reeeeeeeeally annoying happens - my buttons seem to turn off when the screen is on after some time, about 5 seconds. Would that be BLD? If so, that's getting axed really quickly.
[Nexus S Android Development] kiden:
Make sure that in script manager you have it set to get grant SU to that script. I usually get errors like that when I forget to do that.
[Nexus S Android Development] polobunny:
The lights turning off is BLD yep.

From your script they should light up and flash 5 times relatively slow yeah.
[Nexus S Android Development] Skyline969:
How do I go about ensuring that? I've set it so in SManager /system is mounted as rw for the time being. "Browse as Root" is also enabled in the settings.

EDIT: Found the button for su. Done.

I've modified the script as so:

#!/system/bin/sh
# ---------- CPU (Overclock and Gov) ----------
echo "smartassV2" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 200000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 1200000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
# ---------- BLD (Backlight Dimmer) ----------
# Enabled (0 - Disable; 1 - Enable)
echo 0 > /sys/devices/virtual/misc/backlightdimmer/enabled
# Delay (in milliseconds)
echo 5000 > /sys/devices/virtual/misc/backlightdimmer/delay
# ---------- Voodoo Colors ----------
echo 1951208320 > /sys/class/misc/voodoo_color/red_multiplier
echo 1720296160 > /sys/class/misc/voodoo_color/green_multiplier
echo 1974299520 > /sys/class/misc/voodoo_color/blue_multiplier
echo -50 > /sys/class/misc/voodoo_color/red_v1_offset
echo -53 > /sys/class/misc/voodoo_color/green_v1_offset
echo -44 > /sys/class/misc/voodoo_color/blue_v1_offset
# ---------- BLN (Backlight Notification) ----------
# Enabled (0 - Disable; 1 - Enable)
echo 1 > /sys/class/misc/backlightnotification/enabled
# Blink (0 - Disable; 1 - Enable)
echo 1 > /sys/class/misc/backlightnotification/in_kernel_blink
# Blink Speed (1 is fastest; 10 is slowest)
echo 10 > /sys/class/misc/backlightnotification/blink_speed
# Blink Mode
# MODE 1: Normal blinking, no special timing effects
# MODE 2: Starts fast, and slows
# MODE 3: Starts slow, and speeds up
# MODE 4: Starts fast, slows, then speeds up again, etc
echo 1 > /sys/class/misc/backlightnotification/blink_mode
# Max Blink Mode
# MODE 1: how blinks there will be.
# MODE 2/3/4: how many times the pattern will repeat
echo 25 > /sys/class/misc/backlightnotification/max_blink_count
# Final Blink State(1 is on, 0 is off)
echo 1 > /sys/class/misc/backlightnotification/blink_finalstate

EDIT: So running the script as root seems to now produce all of the results that I want. Now I just need to get it to run at boot.
[Nexus S Android Development] kiden:
When you select a script there is a window that pops up and gives you the choice to Run/Exit/Edit/Save and right under Run there is a Star and SU icon. Make sure you tap the SU icon, it will be green when its enabled and gray when disabled.

EDIT: Oh i see you found it and it worked! Woo!

Also, it may be simple to overlook, but make sure that init.d is enabled in settings (under performance, also i recommend the SD boost and fix permissions tweaks in there) and that notification lights are enabled (under interface>display)
[Nexus S Android Development] polobunny:
It's good to know Slim Bean has a special toggle for init.d

Don't need to touch the notification lights though, since he'll be using his script. That's kind of conflicting. ;)
[Nexus S Android Development] Skyline969:
Here's what I've got under Performance:

Now here's something that I'm curious about, take a look here:

Some of the scripts seem to correspond to the options in the Performance menu. Do you think that, as a "sweep it under the rug" way of doing things, I could enable one of these tweaks in the menu and then just edit that init.d script to do something else? EDIT: Or would that be unnecessary if I change one of the settings here?
[Nexus S Android Development] kiden:
Actually if the switch isn't enabled in there, even when they are enabled in the script, they wont go on. I use that to quickly disable them without editing my script.

Yep that's where the scripts are from. Sounds like you would be able to do that. It should work, but there is no need to do it. Also, you can delete the 98mounts script, its the same tweaks as 98tweaks, and running both I've read could cause issues. One is from the Rom and the other is from flashing the kernel I believe.

Edit: If you do edit them instead of adding a new script, they would be changed when you update slim bean and you would have to edit them again.
[Nexus S Android Development] Skyline969:
I'll look into removing one of those once I get this script figured out. Thanks for letting me know about that.

Okay, so if I just keep 99marmite in /etc/init.d with my current configuration, how can I get it to run on boot? Currently it doesn't run.
[Nexus S Android Development] kiden:
doh. I should have thought of this earlier. You need to set the permissions on the script. Otherwise the system cant run it.
[Nexus S Android Development] Skyline969:
Read up a little bit. I made sure to set them after forgetting to. They're currently set to rwxr-xr-x (755).
[Nexus S Android Development] kiden:
Here is mine

EDIT: Same thing. Should work now!
[Nexus S Android Development] Skyline969:
Mine appears to be the exact same:

However, it does not execute on system boot. I noticed that the path is different in my screenshot than yours, but that's just because /etc is a symlink to /system/etc. Shouldn't affect things at all.
[Nexus S Android Development] kiden:
Dang it. I feel like we are missing something. I do remember having issues when I placed it in there through the /ect sysmlink. So I place it directly through /system/ect now, but in theory it shouldn't affect it.
[Nexus S Android Development] Skyline969:
We must be missing something small. So to summarize everything, here is my current setup:

Settings (view attachments)

Script:

#!/system/bin/sh
# ---------- CPU (Overclock and Gov) ----------
echo "smartassV2" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 200000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 1200000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
# ---------- BLD (Backlight Dimmer) ----------
# Enabled (0 - Disable; 1 - Enable)
echo 0 > /sys/devices/virtual/misc/backlightdimmer/enabled
# Delay (in milliseconds)
echo 5000 > /sys/devices/virtual/misc/backlightdimmer/delay
# ---------- Voodoo Colors ----------
echo 1951208320 > /sys/class/misc/voodoo_color/red_multiplier
echo 1720296160 > /sys/class/misc/voodoo_color/green_multiplier
echo 1974299520 > /sys/class/misc/voodoo_color/blue_multiplier
echo -50 > /sys/class/misc/voodoo_color/red_v1_offset
echo -53 > /sys/class/misc/voodoo_color/green_v1_offset
echo -44 > /sys/class/misc/voodoo_color/blue_v1_offset
# ---------- BLN (Backlight Notification) ----------
# Enabled (0 - Disable; 1 - Enable)
echo 1 > /sys/class/misc/backlightnotification/enabled
# Blink (0 - Disable; 1 - Enable)
echo 1 > /sys/class/misc/backlightnotification/in_kernel_blink
# Blink Speed (1 is fastest; 10 is slowest)
echo 10 > /sys/class/misc/backlightnotification/blink_speed
# Blink Mode
# MODE 1: Normal blinking, no special timing effects
# MODE 2: Starts fast, and slows
# MODE 3: Starts slow, and speeds up
# MODE 4: Starts fast, slows, then speeds up again, etc
echo 4 > /sys/class/misc/backlightnotification/blink_mode
# Max Blink Mode
# MODE 1: how blinks there will be.
# MODE 2/3/4: how many times the pattern will repeat
echo 100 > /sys/class/misc/backlightnotification/max_blink_count
# Final Blink State(1 is on, 0 is off)
echo 1 > /sys/class/misc/backlightnotification/blink_finalstate

Executing the script as root works 100%, however it does not run on boot.
[Nexus S Android Development] kiden:
Okay, I would make sure init.d scripts are being run correctly by adding the BLD lines to the 07fixperms script. Then on the next boot, if your backlights turn off, we know that's working and can look elsewhere.
[Nexus S Android Development] JokerAce:
Actually the best way to test is to change the freq levels. Try changing the max to 1000mhz and the min to 400mhz. Reboot. If you check under performance settings and you get these values, it means the script ran.
[Nexus S Android Development] Skyline969:
In my script I am changing the freq levels. When I reboot and go to check my freqs, they're still 1000/100, not 1200/200 like I set. If I just run the script as root and then check the freqs, they are 1200/200.
[Nexus S Android Development] :
No, you're right in thinking your battery will run out sooner if it's only charged to 90%, but you'll be able to cycle it more times, increasing the usable lifetime of the battery from maybe two or three years to three or four. Or something.
[Nexus S Android Development] alen1901:
But blx doesnt mean anything if you let your phone to discharge to 5%, or 1%. Charge it at around 20-25%. ;)

Sent from SpeedMachine i9023
[Nexus S Android Development] :
You may find this interesting.
[Nexus S Android Development] Randomwalker:
OK, redid the stabiltity test for all frequencies for v13 and this time all freq. passed :good:.
[Nexus S Android Development] :
Hey seriously, that is above and beyond the call of duty. Thanks very much for your time!
[Nexus S Android Development] :
Okay, after the abject failure of my previous attempt at a working 400 MHz fixed frequency Deep Idle... I now have a working build.

Since the last one proved to be an unstable SOD (hint hint) this one release is going to be a PM only affair.

Want to get your test on? PM me for the download link. I'm going to bed very shortly, so act fast, or you'll have to wait until I read my messages in about 8 hours time.

EDIT: It's worth re-stating how cool this is. Any fans of the battery drain benchmark thread will, I'm sure, remember Harbb's excellent set of ten hour drain studies. Here's a little summary:

- 15% - SmartassV2 with DI

- 16% - Conservative with DI

- 21% - Lazy with DI and SOMF

- 23% - Lazy with DI

- 36% - Conservative

- 39% - Lazy

The reason we assume for smartassV2 having the least drain over the 10 hours was due to the governor sitting on the 800MHz spot. Remember, 400MHz should be even better.

Still to come: Hopefully I can work out how to temporarily switch governors to performance when entering deep idle, and switch back when coming back out. This will save further CPU cycles, and will also make my fixed fq DI tweak need less code, which will again save CPU cycles.
[Nexus S Android Development] ehiggins:
Any chance you can add the fast charge toggle ?its the only way I can get good charging in the car
[Nexus S Android Development] morfic:
morfic@othris:/data/devstuff/NSDEV/trinity-ns-ics$ grep SLUB .config

CONFIG_SLUB_DEBUG=y

CONFIG_SLUB=y

# CONFIG_SLUB_DEBUG_ON is not set

# CONFIG_SLUB_STATS is not set

morfic@othris:/data/devstuff/NSDEV/trinity-ns-ics$ grep CFQ .config

CONFIG_IOSCHED_CFQ=y

CONFIG_DEFAULT_CFQ=y

morfic@othris:/data/devstuff/NSDEV/trinity-ns-ics$

So slub and cfq are enabled and defaulted in the defconfig.
[Nexus S Android Development] 309041291a:
My custom Voodoo colors just aren't the same on this kernel... does anyone have any REALLY deep/dark settings that work well with this kernel?

Nexus S (GMS i9020a)

Paranoid (1.6 - 4.0.4)

Matrix Kernel (CFS - 20.0)

Intellidemmand (800/100)

Deep Idle (On - Noop)

Live OC - 105 (800/1000)

BLX - 98 (Inverted Apps)
[Nexus S Android Development] :
I downloaded cyanogenmod nightly, pulled the .config from that. As you say SLUB is enabled. When I wrote that I enabled SLUB, I was using an older .config that I pulled from a cyanogenmod based rom, perhaps it had been customised...

...anyway, from the most recent .config, I see CFQ is disabled???
[Nexus S Android Development] morfic:
Nah, i mean over stock, forgetting Kalim gobbles up everything into CM kernel, even common configuration choices.

I just have a thing with people writing "Added XYZ" when XYZ is a standard kernel feature.
[Nexus S Android Development] :
v1.3b http://d-h.st/n55

Bugfix for some frequency stepping issues.

Everyone using my kernel should upgrade to this one. This will be the final release until I can either get the 400 MHz DI working, or JB source is released.

It's a smaller download too!
[Nexus S Android Development] :
Actually i was testing 400mhz DI overnight and no problems so far. I could still use a couple more testers? PM please!
[Nexus S Android Development] caliban2:
Only testing it for an hour, but I'd say it's working fine. Top-off accumulating and cpuspy speaks for itself. :)
[Nexus S Android Development] :
Ohhh... So kalim chose to stop cfq. Ok i get it. I'll try and get the wording right in the op
[Nexus S Android Development] Randomwalker:
No worries, I just like marmite, too :-).
[Nexus S Android Development] :
I'm not releasing until I'm sure there'd be no SOD, so continue testing with lots of different screen-off behaviors if you can. But, damn... I'm really excited about this :D Is that normal?? :D :D
[Nexus S Android Development] pan1980:
so with deep idle on its best to have 400MHz while screen is off.

what about with screen on and cpu is idle ?

have you done any test on this ?
[Nexus S Android Development] :
Yes, indeed I did! Follow the link in the bit you quoted to the original research. When the screen is on, unsurprisingly you need the lowest possible CPU freq, which is 100 MHz. As a little bonus, the bus clocks down at the 100 MHz step too, for further power savings. Just FYI, that's the screen-on behaviour I'm shooting for with my ondemand tweaks.
[Nexus S Android Development] y3mita:
No SODs at all on test version, running since last night.
[Nexus S Android Development] JokerAce:
Go to system/bin/ and see if you got the "sh" file.
[Nexus S Android Development] Skyline969:
I just thought of that actually. Yes, it's there, but for ****s and giggles I tried specifying #!/system/xbin/sh. No difference.

Version 2.7.0 just came out for Slim Bean, so I'm gonna go check and see if that fixes this issue.
[Nexus S Android Development] polobunny:
If you enable one of the tweaks in Slim Bean and reboot, it should work. If it doesn't, something else is fubar'ed.

I'd try enabling something like BLN then rebooting.
[Nexus S Android Development] Skyline969:
I added the lines to change the clock speed into 98tweaks, we'll see if it gets run on boot time based on my configuration....

Aaaaaaand it does! Ok, this'll fix it - just add all of my tweaks into 98tweaks and we'll be peachy.

EDIT: Or not. If I add just the freq modification, it works. But once I copy my entire script (minus the initial #! since that's already in place), it doesn't execute.

EDIT(2): Permissions issue once again. Setting permissions and rebooting to see if that fixed it.

EDIT(3): Okay, permissions was the problem. Thanks to everyone who helped. I'd thank you more, but I can only thank 8 times a day.

For those of you on Slim Bean, add your tweaks to 98tweaks, and then enable startup tweaks inside of Performance -> Startup Tweaks and everything will be just fine.
[Nexus S Android Development] polobunny:
Magic!

Something isn't right though, everything in init.d should run, regardless of the name of the file as long as the permissions are set right.
[Nexus S Android Development] Skyline969:
I know that it's strange and that that's how it should work, but for some reason or another that's not how it's working. I don't know if there's a configuration file somewhere else for this ROM that dictates which scripts in init.d should be run, but I sure would be curious to find out. Perhaps once I charge again (I'm at work and this stuff has already chewed my battery down to 40%) I'll look into it.
[Nexus S Android Development] granets:
hey bedalus, just wanted you to know, i was playing around with your guide, and the java thing doesn't work. it shows a message that there is no such thing, and it is probably obsolete. any tips how to get around this? i am sort of new to ubuntu. using the latest beta 2, ubuntu 12.10 on a virtual machine.
[Nexus S Android Development] kiden:
I'm glad you figured it out! Did you update to slim bean 2.7? Does it play well with v5? I haven't updated yet cause I just got mine working just how I want it... xD
[Nexus S Android Development] FirePoncho86:
Well, there's a new stable release, I'll flash ur now. But first, I never rebooted on the last stable (4.8)

keep it up, bed!
[Nexus S Android Development] :
If you just want to build kernels you can skip java, bit of you want to build the ROM too, you'll need it. Search Google for instal java jdk Ubuntu
[Nexus S Android Development] :
Nice to see users supporting each other today!
[Nexus S Android Development] jimdem:
Unfortunately I can't help you because my phone never rebooted while using all versions from 4.8 to 5 along with the aokp jb b4. So, no last_kmsg. Sorry :P

:) haha keep up the good work, everything is fantastic ;)

Στάλθηκε;;; από το;;; Nexus S μο;;;υ;;; χρησιμο;;;πο;;;ιώντας Tapatalk 2