FORUMS
Remove All Ads from XDA

[DEV][TEMPLATE] AnyKernel3 - Easily Mod ROM Ramdisk + Pack Image.gz [Flashable Zip]

13,783 posts
Thanks Meter: 30,544
 
By osm0sis, Recognized Developer / Recognized Contributor on 5th March 2014, 03:32 AM
Post Reply Email Thread
17th August 2017, 10:14 PM |#501  
baloo30310's Avatar
Senior Member
Flag France
Thanks Meter: 97
 
More
Hi friend ! Is it functional with the Note 4 snapdragon? please
18th August 2017, 04:42 AM |#502  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,544
 
Donate to Me
More
Quote:
Originally Posted by baloo30310

Hi friend ! Is it functional with the Note 4 snapdragon? please

Probably! Check the development section for your device to see if kernel devs are already using it.
The Following User Says Thank You to osm0sis For This Useful Post: [ View ]
18th August 2017, 04:21 PM |#503  
Senior Member
Thanks Meter: 190
 
More
Quote:
Originally Posted by baloo30310

Hi friend ! Is it functional with the Note 4 snapdragon? please


The devs are already using it.
The Following User Says Thank You to Watanabe_You For This Useful Post: [ View ] Gift Watanabe_You Ad-Free
20th August 2017, 04:09 AM |#504  
Senior Member
Thanks Meter: 190
 
More
Hi, I got a few more questions.
If I want to edit an entry in build.prop, say ro.qcom.ad=0 to =1. Is the following code correct?
Code:
# update build.prop
replace_string /system/build.prop "ro.qcom.ad=1" "ro.qcom.ad=0" "ro.qcom.ad=1"
Same thing with /system/etc/init.qcom.post_boot.sh. This file has been overwriting my Spectrum settings on boot, and have run out of ideas on how to prevent it. Normally I'd replace the entire file but it might break something across different ROMs. The line I'm trying to edit is the #governor settings:

Code:
                #governor settings
                echo 1 > /sys/devices/system/cpu/cpu0/online
                echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
                echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
                echo 60000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate

There are actually a lot more lines but I'll keep it clean to post here. According to the readme, the code should go:

Code:
replace_section /system/etc/init.qcom.post_boot.sh "#governor settings" "                echo 60000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate" "                #governor settings
                echo 1 > /sys/devices/system/cpu/cpu0/online
                echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
                echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
                echo 60000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate"
I'd look for individual lines and replace them but there are several more of the same lines but they do not affect the main Interactive governor, so I'd leave them alone.
20th August 2017, 05:09 AM |#505  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,544
 
Donate to Me
More
Quote:
Originally Posted by Watanabe_You

Hi, I got a few more questions.
If I want to edit an entry in build.prop, say ro.qcom.ad=0 to =1. Is the following code correct?

Code:
# update build.prop
replace_string /system/build.prop "ro.qcom.ad=1" "ro.qcom.ad=0" "ro.qcom.ad=1"
Same thing with /system/etc/init.qcom.post_boot.sh. This file has been overwriting my Spectrum settings on boot, and have run out of ideas on how to prevent it. Normally I'd replace the entire file but it might break something across different ROMs. The line I'm trying to edit is the #governor settings:

Code:
                #governor settings
                echo 1 > /sys/devices/system/cpu/cpu0/online
                echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
                echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
                echo 60000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate

There are actually a lot more lines but I'll keep it clean to post here. According to the readme, the code should go:

Code:
replace_section /system/etc/init.qcom.post_boot.sh "#governor settings" "                echo 60000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate" "                #governor settings
                echo 1 > /sys/devices/system/cpu/cpu0/online
                echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
                echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
                echo 60000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate"
I'd look for individual lines and replace them but there are several more of the same lines but they do not affect the main Interactive governor, so I'd leave them alone.

There's a function for that!

Code:
patch_prop <prop file> <prop name> <new prop value>
As for sections you're much better off nowadays using this as your end search string: " "

That way it'll just replace the whole chunk up to the next blank line. Then remember that you'd need to either join the lines with \ or put them all on one line with \n.
The Following 2 Users Say Thank You to osm0sis For This Useful Post: [ View ]
20th August 2017, 05:36 AM |#506  
Senior Member
Thanks Meter: 190
 
More
Quote:
Originally Posted by osm0sis

There's a function for that!

Code:
patch_prop <prop file> <prop name> <new prop value>
As for sections you're much better off nowadays using this as your end search string: " "

That way it'll just replace the whole chunk up to the next blank line. Then remember that you'd need to either join the lines with \ or put them all on one line with \n.


I see. So build.prop will look like this:
Code:
# update build.prop
patch_prop /system/build.prop "ro.qcom.ad" "1"
What if the value is already "1", will it ignore?

Also, for the init.qcom.post_boot.sh it will go something like this:
Code:
replace_section /system/etc/init.qcom.post_boot.sh "The entire section I'm specifically looking for" "The replacement for the entire section I want to use"
Then, in the section itself the \n is used to break into a new line, is that what you meant?
Like so:
Code:
\n                echo 1 > /sys/devices/system/cpu/cpu0/online
\n                echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 
\n                echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
20th August 2017, 05:48 AM |#507  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,544
 
Donate to Me
More
Quote:
Originally Posted by Watanabe_You

I see. So build.prop will look like this:

Code:
# update build.prop
patch_prop /system/build.prop "ro.qcom.ad" "1"
What if the value is already "1", will it ignore?

Also, for the init.qcom.post_boot.sh it will go something like this:
Code:
replace_section /system/etc/init.qcom.post_boot.sh "The entire section I'm specifically looking for" "The replacement for the entire section I want to use"
Then, in the section itself the \n is used to break into a new line, is that what you meant?
Like so:
Code:
\n                echo 1 > /sys/devices/system/cpu/cpu0/online
\n                echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 
\n                echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load

Yes:
https://github.com/osm0sis/AnyKernel...4c89e66c61bc23

Well technically it replaces it anyway, which is in effect the same.

And what I was saying is this won't work:
Code:
replace_section /system/etc/init.qcom.post_boot.sh "#governor settings" "                echo 60000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate" "                #governor settings
                echo 1 > /sys/devices/system/cpu/cpu0/online
                echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
                echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
                echo 60000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate"
You'd want:
Code:
replace_section /system/etc/init.qcom.post_boot.sh "#governor settings" "                echo 60000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate" "                #governor settings\n                echo 1 > /sys/devices/system/cpu/cpu0/online\n                echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor\n                echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load\n                echo 60000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate"
or:
Code:
replace_section /system/etc/init.qcom.post_boot.sh "#governor settings" "                echo 60000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate" "                #governor settings\
                echo 1 > /sys/devices/system/cpu/cpu0/online\
                echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor\
                echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load\
                echo 60000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate"
And I was saying it's often easier replacing an entire section if it's isolated like this in the target file:
Code:
<stuff before>

                #governor settings
                echo 1 > /sys/devices/system/cpu/cpu0/online
                echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
                echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
                echo 60000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate"

<stuff after>
with something like this:
Code:
replace_section /system/etc/init.qcom.post_boot.sh "#governor settings" " " "                #governor settings\n                echo 1 > /sys/devices/system/cpu/cpu0/online\n                echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor\n                echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load\n                echo 60000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate\n"
Note how the second argument is " " and there is a trailing \n to replace that.
The Following 2 Users Say Thank You to osm0sis For This Useful Post: [ View ]
20th August 2017, 05:56 AM |#508  
Senior Member
Thanks Meter: 190
 
More
Quote:
Originally Posted by osm0sis

Yes:
https://github.com/osm0sis/AnyKernel...4c89e66c61bc23

Well technically it replaces it anyway, which is in effect the same.

And what I was saying is this won't work:
Code:
replace_section /system/etc/init.qcom.post_boot.sh "#governor settings" "                echo 60000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate" "                #governor settings
                echo 1 > /sys/devices/system/cpu/cpu0/online
                echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
                echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
                echo 60000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate"
You'd want:
Code:
replace_section /system/etc/init.qcom.post_boot.sh "#governor settings" "                echo 60000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate" "                #governor settings\n                echo 1 > /sys/devices/system/cpu/cpu0/online\n                echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor\n                echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load\n                echo 60000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate"
or:
Code:
replace_section /system/etc/init.qcom.post_boot.sh "#governor settings" "                echo 60000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate" "                #governor settings\
                echo 1 > /sys/devices/system/cpu/cpu0/online\
                echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor\
                echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load\
                echo 60000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate"
And I was saying it's often easier replacing an entire section if it's isolated like this in the target file:
Code:
<stuff before>

                #governor settings
                echo 1 > /sys/devices/system/cpu/cpu0/online
                echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
                echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
                echo 60000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate"

<stuff after>
with something like this:
Code:
replace_section /system/etc/init.qcom.post_boot.sh "#governor settings" " " "                #governor settings\n                echo 1 > /sys/devices/system/cpu/cpu0/online\n                echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor\n                echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load\n                echo 60000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate\n"
Note how the second argument is " " and there is a trailing \n to replace that.



Ah I get it now. Thanks so much for your time, this will really help!
20th August 2017, 11:12 AM |#509  
Senior Member
Thanks Meter: 190
 
More
I'm back ;_;
I can patch default_prop just fine but anything regarding the post_boot.sh and build.prop does not seem to work.
I've attached the file below, just rename .txt to .sh.
Attached Files
File Type: txt anykernel.txt - [Click for QR Code] (2.3 KB, 30 views)
20th August 2017, 06:22 PM |#510  
osm0sis's Avatar
OP Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,544
 
Donate to Me
More
Quote:
Originally Posted by Watanabe_You

I'm back ;_;
I can patch default_prop just fine but anything regarding the post_boot.sh and build.prop does not seem to work.
I've attached the file below, just rename .txt to .sh.

That's because you still did this wrong by splitting it over 2 lines with no \:
Code:
replace_section /system/etc/init.qcom.post_boot.sh "#governor settings" " " "                #governor settings\n                echo 1 > /sys/devices/system/cpu/cpu0/online\n                echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor\n                echo 0 > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay\n                echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load\n                echo 60000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate\n
                echo 652800 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq\n                echo 0 > /sys/devices/system/cpu/cpufreq/interactive/io_is_busy\n                echo "80 652800:57 1036800:67 1401600:75 1689600:9 1804800:85 1958400:87" > /sys/devices/system/cpu/cpufreq/interactive/target_loads\n                echo 0 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time\n                echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor\n                echo 652800 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq\n"
Please reread my previous posts to you.

You also probably need to escape those " in the replacement string.
The Following User Says Thank You to osm0sis For This Useful Post: [ View ]
21st August 2017, 04:29 PM |#511  
Senior Member
Thanks Meter: 190
 
More
Quote:
Originally Posted by osm0sis

That's because you still did this wrong by splitting it over 2 lines with no \:

Code:
replace_section /system/etc/init.qcom.post_boot.sh "#governor settings" " " "                #governor settings\n                echo 1 > /sys/devices/system/cpu/cpu0/online\n                echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor\n                echo 0 > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay\n                echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load\n                echo 60000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate\n
                echo 652800 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq\n                echo 0 > /sys/devices/system/cpu/cpufreq/interactive/io_is_busy\n                echo "80 652800:57 1036800:67 1401600:75 1689600:9 1804800:85 1958400:87" > /sys/devices/system/cpu/cpufreq/interactive/target_loads\n                echo 0 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time\n                echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor\n                echo 652800 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq\n"
Please reread my previous posts to you.

You also probably need to escape those " in the replacement string.


I've tried everything, doesn't seem to work. I also skipped the post_boot file and attempted to just adjust the build.prop values, also failed.
Thanks anyway, I'll make do with manually editing everything.
Post Reply Subscribe to Thread

Tags
anykernel, flashable zip, kernel, scripting, template

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes