Include an individual file in the lineage sources - LineageOS Questions & Answers

Hello folks,
I am a beginner. Sorry if it's a stupid question.
I want to include a file when compiling a custom rom with Lineage OS. It should be under "/sys/module/dwc3/parameters", named "aca_enable" and contain a "Y".
How can I build this into the sources so that it is already there after flashing?
I've already searched the web, but couldn't find anything.
Thanks for replies in advance!

This is not a normal file. Kernel modules expose flags under /sys/module/<module-name> which can be changed by file operations. Pretty common under linux to have such interfaces (e.g. procfs).
I can't give you a complete answer, but can probably point you in the right direction: You need to do some research on init.rc. Basically you need to set a rule in an .rc file in /system/etc/init. (Or compile a new kernel / the dwc3 module and set a new default value)

sn00x said:
This is not a normal file. Kernel modules expose flags under /sys/module/<module-name> which can be changed by file operations. Pretty common under linux to have such interfaces (e.g. procfs).
I can't give you a complete answer, but can probably point you in the right direction: You need to do some research on init.rc. Basically you need to set a rule in an .rc file in /system/etc/init. (Or compile a new kernel / the dwc3 module and set a new default value)
Click to expand...
Click to collapse
Hello, many thank you for the answer!
Yes I understand. These files are created and modified at runtime. Then I know where to look. An example would be best. "Copy and Paste" is a popular method. ;-)

First try - quick and dirty - did not work.
I put the following lines into the system/core/rootdir/init.usb.rc (lineageos sources):
# Set /sys/module/dwc3/parameters/aca_enable to "Y"
write /sys/module/dwc3/parameters/aca_enable Y
After compiling the ROM, flashing it on the device and boot the device the file /sys/module/dwc3/parameters/aca_enable contain a "N".
On the Spartphone the file /etc/init/hw/init.usb.rc contains the modified lines.
In the modified file dwc3_otg.c i can't find anything that write a "N".
Maybe someone has an idea or an alternative?
(Here is the source code of dwc3_otg.c https://github.com/sollapse/opo_dwc3_otg/)

Well, just change 0 to 1 in line 42.

sn00x said:
Well, just change 0 to 1 in line 42.
Click to expand...
Click to collapse
Hello, oh yes - I had tomatoes on my eyes. Thank you very much for the tip!

sn00x said:
Well, just change 0 to 1 in line 42.
Click to expand...
Click to collapse
It works!
Thank you so much for making the effort.
fyi: Another option would be here.

Related

Flashing Galaxy S kernel from update.zip : template update.zip

NEWS :
Koush's bmlunlock (a simple IOCTL send to the bml device) is just out and can replace redbend_ua !
http://github.com/CyanogenMod/android_device_samsung_bmlunlock
Hey
Is Flashing from update.zip the new trend ?
'Don't know but here is how you can do it quite easily using this template.
If you target a GT-I9000 on Eclair, you'll need to customize one thing :
In build-update-zip.sh, set DROID_HOME to the source code path for your local Android repository.
If you target another Galaxy S phone or another version of Android, you'll need to adjust ro.hardware and ro.build.id properties accordingly.
This template is done for Linux/Unixes/OSX.
If Linux cost too much for you or your employer, please contribute by sending a .bat equivalent to the .sh
Of course, you also need to put a valid zImage to replace the template's empty zImage
Feel free to adjust to your needs. License is WTFPL
Note : requirement are Java and Android source repo, already build.
Looks awesome!
I have a question though... why do you need to flash the kernel in an update.zip at boot?
As far as I know, the system will read the kernel at boot up time and load it into ram. It won't access the on-disk file again until the next boot. If that is true, then flashing while running should be 100% safe, right?
RyanZA it's an update.zip, not a ramdisk.
The point is getting an easy flashing method, requiring no computer.
And you don't even need to root your phone !
curio, as i see this script is quite simple, so dont u think this all could actually be done on the phone directly? i mean if people cant afford a linux machine...
edit:
sorry for major dumbness, but do you think this could also somehow be used to reflash a nandroid backup?
FadeFx said:
curio, as i see this script is quite simple, so dont u think this all could actually be done on the phone directly? i mean if people cant afford a linux machine...
Click to expand...
Click to collapse
I don't think the signing tool works on android -- maybe it does? Anyway editing scripts on a phone seems a bit silly!
FadeFx said:
curio, as i see this script is quite simple, so dont u think this all could actually be done on the phone directly? i mean if people cant afford a linux machine...
edit:
sorry for major dumbness, but do you think this could also somehow be used to reflash a nandroid backup?
Click to expand...
Click to collapse
Nope actually this is not dumb at all
Yes the flashing part run in updater-script can be started manually.
In the script :
Code:
"redbend_ua", "restore", "zImage", "/dev/block/bml7"
The update.zip presented here mainly targets custom kernel creators in order to give them another way to distribute their work.
This is a working example of how to use redbend_ua programmatically, hopefully it may help new ideas coming. redbend_ua usage is not limited at all to kernel flashing.
PS : you can use this template with windows as well, you'll just need to translate the ulta-basic .sh to a .bat script, or do the signing part manually.
supercurio said:
Hey
If you target a GT-I9000 on Eclair, you'll need to customize one thing :
In build-update-zip.sh, set DROID_HOME to the source code path for your local Android repository.
Click to expand...
Click to collapse
quick question, the build-update-zip.sh is not a must if i only want to flash zImage, rite?
looks like that, I need to modify updater-script (if needed), as well as putting a zImage into ur zip file, and finally remove the build-update-zip.sh from ur zip attached
then, ur zip file can be used for flashing
is it correct?
thx
So this will let people flash any rom from an update.zip (once the ROM makers take this into account) via RomManager without ever having to use Odin to get off stock?
Awesome!
Thanks for the update script curio! this looks great.
One quick question - ive noticed several update.zip scripts for the galaxy S
have update-binary included.
Does anyone know what that does?? where did you get yours?
ive had success in using update.zips without that file at all.
Could anyone post information on what that binary is/does?
supercurio said:
Hey
Is Flashing from update.zip the new trend ?
'Don't know but here is how you can do it quite easily using this template.
If you target a GT-I9000 on Eclair, you'll need to customize one thing :
In build-update-zip.sh, set DROID_HOME to the source code path for your local Android repository.
If you target another Galaxy S phone or another version of Android, you'll need to adjust ro.hardware and ro.build.id properties accordingly.
This template is done for Linux/Unixes/OSX.
If Linux cost too much for you or your employer, please contribute by sending a .bat equivalent to the .sh
Of course, you also need to put a valid zImage to replace the template's empty zImage
Feel free to adjust to your needs. License is BSD anyway.
Note : requirement are Java and Android source repo, already build.
I'll add some documentation later.
Click to expand...
Click to collapse
dseo80 said:
Thanks for the update script curio! this looks great.
One quick question - ive noticed several update.zip scripts for the galaxy S
have update-binary included.
Does anyone know what that does?? where did you get yours?
ive had success in using update.zips without that file at all.
Could anyone post information on what that binary is/does?
Click to expand...
Click to collapse
Thats for the updater-script i believe. In most cases, theres a update-script in the zip's as well and the recovery picks that up in which case it doesn't need the binary and hence works.
Okay !
Answers hour
ykk_five said:
quick question, the build-update-zip.sh is not a must if i only want to flash zImage, rite?
looks like that, I need to modify updater-script (if needed), as well as putting a zImage into ur zip file, and finally remove the build-update-zip.sh from ur zip attached
then, ur zip file can be used for flashing
Click to expand...
Click to collapse
When you run ./build-update-zip.sh,
- it produce a temp zip file containing appropriate files in it.
- then there'is the signature part, building another .zip, ready to be used.
- this "final" update.zip is put in the same current directory and you can use it as it is.
No further complication
Brantyr said:
So this will let people flash any rom from an update.zip (once the ROM makers take this into account) via RomManager without ever having to use Odin to get off stock?
Awesome!
Click to expand...
Click to collapse
Yes, to flash a complete ROM (several partitions) one more thing is needed.
On command line, redbend_ua accept only one command.
In order to run several commands successively (ie flash multiple partition like Odin does), you'll need to write them in a file.
The file /cache/ota/command should do the trick, but it's untested right now.
There may be other method to prevent rebooting after flashing (hacking the redbend_ua binary, finding the appropriate command line option or removing the reboot command temporary)
dseo80 said:
Thanks for the update script curio! this looks great.
One quick question - ive noticed several update.zip scripts for the galaxy S
have update-binary included.
Does anyone know what that does?? where did you get yours?
ive had success in using update.zips without that file at all.
Could anyone post information on what that binary is/does?
Click to expand...
Click to collapse
Right, many update.zip done today are made without knowing anything about how it really works
I studied a bit before creating mine, here is a walk-through this fairly undocumented process :
- recovery mounts /sdcard/
- recovery search for a default file named : META-INF/com/google/android/update-binary in the zip and runs it : see the source in bootable/recovery/install.c
- update-binary is actually updater in sources
- updater looks into the zip file to the script file named updater-script, update-script is obsolete
- updater then runs the commands listed in updater-script : here is the list of commands.
- then reboot
The only documentation I know for this command is the recovery/updater/install.c file itself
supercurio said:
When you run ./build-update-zip.sh,
- it produce a temp zip file containing appropriate files in it.
- then there'is the signature part, building another .zip, ready to be used.
- this "final" update.zip is put in the same current directory and you can use it as it is.
Click to expand...
Click to collapse
ok,thx
but one more thing i want to know is, u said the path must be changed to the android repo, so do u mean the source code for the kernel like linux-xxx-2.xxx dir?
Thx
@ykk_five
Content of build-update-zip.sh v1 :
Code:
#!/bin/sh
DROID_HOME="/home/curio/dev/mydroid"
zip -r /tmp/update.zip META-INF/ redbend_ua zImage
java -jar \
$DROID_HOME/out/host/linux-x86/framework/signapk.jar \
$DROID_HOME/build/target/product/security/testkey.x509.pem \
$DROID_HOME/build/target/product/security/testkey.pk8 \
/tmp/update.zip update.zip
rm /tmp/update.zip
adb push update.zip /sdcard/
DROID_HOME="/home/curio/dev/mydroid" : you set here the directory of your Android AOSP directory.
See : http://source.android.com/source/download.html
Create an empty directory to hold your working files:
$ mkdir mydroid
$ cd mydroid
Run "repo init" to bring down the latest version of Repo with all its most recent bug fixes. You must specify a URL for the manifest:
$ repo init -u git://android.git.kernel.org/platform/manifest.git
* If you would like to check out a branch other than "master", specify it with -b, like:
$ repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake
Click to expand...
Click to collapse
This is this mydroid directory
The one that contains Android git source home directory, and compiled files in the out/ subdir
many thx for ur detailed explanation, supercurio!
Thanks curio,
very helpful explanation!
Thanks supercurio for the template!
However, there is no need to spend many hours (depending on hardware and bandwidth) pulling down 100s of megabytes of source and compiling it all if all you want is to sign an update.zip with test keys (if you already have the zImage)!
Just google around for "signapk.jar test keys" and you will get there.
BTW: I know that koush, leshak and wesgamer have Samsung Galaxy S trees up at Github but are they fully merged with AOSP yet?
I'm planning to go build my own kernel for this beast to try to solve the mono FM radio mystery, but last time I checked around it was said that the SGS tree required the use of a custom toolchain to get it to work at all.
Any comments on this?
Hey miki4242 !
Good to know that signapk.jar doesn't require hundred of megs of dependencies
About toolchain, you can use the one indicated by Samsung (CodeSourcery) but you'll face the big and ugly WakeLag.
I recommend you crosstool-ng or buildroot to build toolchains, with gcc 4.3.x march=arm mcpu=cortex-a8 mtune=cortex-a8 (no 4.4.x with march=armv7-v)
The building tutorial will be a part of the documentation I'll publish with my lagfix opensource release
Right now these info are too hard to find.
PS : I send you a mail with attached .config for ct-ng !
supercurio said:
Hey miki4242 !
Good to know that signapk.jar doesn't require hundred of megs of dependencies
Click to expand...
Click to collapse
supercurio said:
PS : I send you a mail with attached .config for ct-ng !
Click to expand...
Click to collapse
Thanks for the info !
Sorry for my ignorance, but does this mean someone can package Froyo in an update.zip and we could update it directly on our phone without needing Samsung Kies or Odin?
@supercurio:
Thanks for this well working template.
In updater-script:
Code:
line 17: package_extract_dir("zImage", "zImage");
should be
Code:
package_extract_file("zImage", "zImage");
But it did work with package_extract_dir, for some reason, too.
Btw, could you send me the config for ct-ng ?
I'm also struggling with this wakelag.

[HOWTO] Modify stock kernels' initramfs / Repack it

1. Usage
./editor.sh [place where the kernel is] [ place where your ramdisk is]
### you must let editor.sh know where your cross compiler is.
open "editor.sh" and edit COMPILER
2. Example
./editor.sh /home/zero/Desktop/test/zImage /home/zero/Desktop/test/my_initramfs.cpio
3. Info
- can not use an initramfs which is bigger than the stock initramfs.cpio's size
>> for instance, stock JM8's got an "initramfs.cpio" which is 3.4MB.
you can use reasonably bigger initramfs by gzipping the initramfs.cpio ->> initramfs.cpio.gz
this process reduces the initramfs.cpio's size but still can't use if initramfs.cpio.gz is bigger than 3.4MB
(this means that if a kernel already has gzipped initramfs, it is difficult to make it. you may want to remove something in order to have more room.)
- you can choose either your_initramfs.cpio or your_initramfs.cpio.gz
(this script compresses the ***.cpio if this is bigger than the stock.)
4. how to extract an initramfs from a kernel?
go to here
http://forum.xda-developers.com/wiki/index.php?title=Extract_initramfs_from_zImage
Thanks gshklover!
Thanks for this! I really appreciate the work you are doing
Sent from my GT-I9000 using Tapatalk
Sweet! Awesome work.
Any reason you now have TWO threads about this subject ? (Or: why not edit / add to your other thread about this ?)
Also, I have a toolset to do all this on Windoze without Linux and compilers... I used it to build the JPH root, but haven't tested it on enough kernels yet to consider it stable and publicly release it.
Hi,
I have tried these scripts on i9000WXJPA and '070701' is found 60 times and 'TRAILER!!!' is found 2 times! I find it a bit risky to assume that the first match is the right one!! z4ziggy's script doesn't even contain the -m 1 so I guess he believes there will always just be one entry!! There must be a safer way to extract initramfs from a zImage. Doesn't the header contain the exact entries where to find the partitions?
Thanks
JKay
Great script, thanks.
I'm trying to port this for use with the Galaxy 3.. uses s5p6442 processor.
Any idea what the mcpu and other flags/values would be when it's rebuilding the image?
Thanks
The eclair kernel compilation comes up with
-D__LINUX_ARM_ARCH__=6 -march=armv6k -mtune=arm1136j-s
Click to expand...
Click to collapse
apparently s5p6442 is s5p6440's poorer cousin (the latter has at least a better CPU, arm1176jzf-s), but there's no information to be found on Samsung's website about it
good luck in making it boot and please share if you make it work, I didn't manage to get it working yet (I'm using z4mod and so far it's generating an invalid zImage)
Chainfire said:
Any reason you now have TWO threads about this subject ? (Or: why not edit / add to your other thread about this ?)
Also, I have a toolset to do all this on Windoze without Linux and compilers... I used it to build the JPH root, but haven't tested it on enough kernels yet to consider it stable and publicly release it.
Click to expand...
Click to collapse
Anyone mind to explain what the "compiling" is doing in a few words? It seems start and end are not changeable anyway.. checksums maybe? wild guess. Just curious. It works fine anyway.

[Q][Help] B5510 - Building Kernel/boot.img Problem

Hi there.
First: Im a noob, so unless i have fewer than 10 posts i can only post in general forum - otherwise i would post on an existing thread (i will mention later).
Last week i got a new phone: Samsung Galaxy Y Pro (GT-B5510).
Its a nice phone, but im missing a thing: a firewall.
I tried droidwall and other, but they arnt working. So there is something wrong with the netfilter/iptables modul and ive to rebuild the kernel.
After a quick search i found this thread and this post.
I already set up a Ubuntu (10.04.4), downloaded the source from samsung and the toolchain from Sourcery (like they mention inthe infofile from samsung).
I build the kernel, like irfanbagus in his post, but for my device.
I got lots of compilerwarnings, but in the end i have had my zImage without errors.
I split my boot.img, which i got from my device with Terminal Emulator, with split_bootimg.pl.
Now ive got a kernelimage and a initrd and ive to put them together.
Presumably with mkbootimg, but ive to know the baseadress.
I tried the offset from the thread mentiond above.
I made a tar and flashed it with Odin1.85 and half bricked it.
[I only can see a grey battery on the diplay and if i reboot it it stuck on bott/splashscreen]
Maybe somebody can help. (please)
Is the problem the compiled kernel, due to the warnings?
Or is it the wrong baseaddress? Well i could not find the address inside the sourcecode (like kconfig), like i read somewhere, thats why i tried the one from s5360.
There is no problem with odin or the cable, cause i can flash my backup with it to 'unbrick' it.
And why is the bootimg around 700kb smaller than the original?
Thanks a lot in advance.
havocinside said:
Hi there.
First: Im a noob, so unless i have fewer than 10 posts i can only post in general forum - otherwise i would post on an existing thread (i will mention later).
Last week i got a new phone: Samsung Galaxy Y Pro (GT-B5510).
Its a nice phone, but im missing a thing: a firewall.
I tried droidwall and other, but they arnt working. So there is something wrong with the netfilter/iptables modul and ive to rebuild the kernel.
After a quick search i found this thread and this post.
I already set up a Ubuntu (10.04.4), downloaded the source from samsung and the toolchain from Sourcery (like they mention inthe infofile from samsung).
I build the kernel, like irfanbagus in his post, but for my device.
I got lots of compilerwarnings, but in the end i have had my zImage without errors.
I split my boot.img, which i got from my device with Terminal Emulator, with split_bootimg.pl.
Now ive got a kernelimage and a initrd and ive to put them together.
Presumably with mkbootimg, but ive to know the baseadress.
I tried the offset from the thread mentiond above.
I made a tar and flashed it with Odin1.85 and half bricked it.
[I only can see a grey battery on the diplay and if i reboot it it stuck on bott/splashscreen]
Maybe somebody can help. (please)
Is the problem the compiled kernel, due to the warnings?
Or is it the wrong baseaddress? Well i could not find the address inside the sourcecode (like kconfig), like i read somewhere, thats why i tried the one from s5360.
There is no problem with odin or the cable, cause i can flash my backup with it to 'unbrick' it.
And why is the bootimg around 700kb smaller than the original?
Thanks a lot in advance.
Click to expand...
Click to collapse
upload your boot.img
boot.img
Here it is.
boot.tar = compiled
boot-stock.tar = original from my device
Size is not problem as long running well.
In my sgy always fail when size >
5.5mb
For boot-stock.tar u get from dd or pda stock-rom ??
Mmm i thing irfan has answer so ur save dude.
its dd.
i don't find any problem with boot.img. offset is equal (0x81600000). the problem maybe in your zImage. make sure you build with correct defconfig. mine is bcm21553_totoro_05_defconfig, i don't know yours, see in text info inside zip file from samsung. and make sure using the same compiler version with text info said. using different version make prebuild kernel module inside initramfs not working. start with default config from xxx_defconfig just to make sure your step is correct. and if still not working your best hope is build your module as loadable module (.ko), add init.d support in init.rc (inside initramfs), and load your module using init.d script.
about the size, it's nomal boot.img from dd command bigger than normal boot.img because it's copy whole partition and include unused bytes behind the original boot.img.
hm, ok.
thank you irfan.
i followed the instructions from the txt inside the archive:
"bcm21553_luisa_03_defconfig" with "g++ 2009q3-68 arm eabi"
ill try again.
my bad. i download wrong files, and end up with comparing the same original boot.img
your compiled boot.img don't have md5 checksum. i am not sure it have effect, i make that tutorial based post from harish2704 here. mkbootimg from harish2704 have --kernelMD5 param. try use that one.
savie said:
Size is not problem as long running well.
In my sgy always fail when size >
5.5mb
For boot-stock.tar u get from dd or pda stock-rom ??
Mmm i thing irfan has answer so ur save dude.
Click to expand...
Click to collapse
our kernel partition only 5 mb my friend...
Boot.img from dd not work with me so i pick from pda stock-rom
(i use from doky thread).
Mmm that why i fail when boot.img more than 5mb.
Trying other method to compile, irfan say merruk use lzma or someting like that.
I can only suggest the method irfanbagus described (loadable kernel modules) because the source code Samsung released probably isn't up to date. The benefits of compiling the needed modules into the kernel are too little compared with possible bugs which are in the released code but not in the stock kernel.
mikstev said:
I can only suggest the method irfanbagus described (loadable kernel modules) because the source code Samsung released probably isn't up to date. The benefits of compiling the needed modules into the kernel are too little compared with possible bugs which are in the released code but not in the stock kernel.
Click to expand...
Click to collapse
i find relative new kernel for sgy, but still cannot make running. it's from galaxy pocket source. there is small change related to power management, but still don't have time to studying.
After a weekend full of trouble, today i found time to continue the bootimg-thing.
I now compiled only the modules and load them now with initd, because i was unable to build a runnable kernel from source.
(Thank you irfan and mikstev)
irfanbagus said:
i find relative new kernel for sgy, but still cannot make running. it's from galaxy pocket source. there is small change related to power management, but still don't have time to studying.
Click to expand...
Click to collapse
are you sure that we can use that kernel for our sgy?

[SOLVED] concerning zlib and aromafm

@Hazou @ketut.kumajaya
okay so,
my first question is, after building philz and going through static_libraries folder i find libz.a .
is this zlib built static, and if so can i relocate it to aromafm source in place of building zlib?
there seems to be too many dependancies that i'm not sure how to locate/point to that largely
seem to be in my kernel source, [cpuset.c,cpuset.h,adler32.c[x86] ?
if so please explain completely as i am still fairly noobish
getting better though :victory:
aromafm is a must have !
thank you for reading
m
moonbutt74 said:
@Hazou @ketut.kumajaya
okay so,
my first question is, after building philz and going through static_libraries folder i find libz.a .
is this zlib built static, and if so can i relocate it to aromafm source in place of building zlib?
there seems to be too many dependancies that i'm not sure how to locate/point to that largely
seem to be in my kernel source, [cpuset.c,cpuset.h,adler32.c[x86] ?
if so please explain completely as i am still fairly noobish
getting better though :victory:
aromafm is a must have !
thank you for reading
m
Click to expand...
Click to collapse
Aromafm is new for me, i have used it, but never build it in any way.
The zlib u build when buildibng your recovery is static, so it is a static library.
I don't know if u can replace it for the source in aromafm. Aromafm (quick look) uses his own source. But u can alway try. Out comment every line about zlib:
Code:
## ZLIB SOURCE FILES
LOCAL_SRC_FILES := \
libs/zlib/adler32.c \
libs/zlib/crc32.c \
libs/zlib/infback.c \
libs/zlib/inffast.c \
libs/zlib/inflate.c \
libs/zlib/inftrees.c \
libs/zlib/zutil.c
## ZLIB NEON SOURCE
ifeq ($(AROMA_ARM_NEON),true)
LOCAL_SRC_FILES += libs/zlib/inflate_fast_copy_neon.s
endif
and add "libz" after "libc".
Code:
## INCLUDED LIBRARIES
LOCAL_STATIC_LIBRARIES := libm libc libz
I can't find your "dependencies" so quick. Where did u find them? Most off them will probably just work.
Hazou
okay, go !
hazou,
thanks for the speedy reply,
okay so, first, cpuset.c i located in my kernel source, in aroma it's refered to in libs/zlib at
320 # if defined(__i386__) || defined(__x86_64__)
321 # include "x86/cpuset.c" <==== typo in souce said cpudet.c
322 #endif
neither the directory or the file exist in the source as it is.
i mkdir x86 in libs/zlib for libs/zlib/x86 , then searched cm11 from top and located what i can only
assume was the correct file [cpuset.c] in my kernel source and cp > aromafm/libs/zlib/x86 and naturally
now i have to either cp everything jn that chain or, drag my kernel source into aromafm directory.
can i point to an 'off-world' source outside of build directory? if so what does that look like?
as to zlib libz.a, the down side of a static lib is it doesn't necessarily fit to a specific purpose/function right?
thanks for your help as always.
m
moonbutt74 said:
hazou,
thanks for the speedy reply,
okay so, first, cpuset.c i located in my kernel source, in aroma it's refered to in libs/zlib at
320 # if defined(__i386__) || defined(__x86_64__)
321 # include "x86/cpuset.c" <==== typo in souce said cpudet.c
322 #endif
neither the directory or the file exist in the source as it is.
i mkdir x86 in libs/zlib for libs/zlib/x86 , then searched cm11 from top and located what i can only
assume was the correct file [cpuset.c] in my kernel source and cp > aromafm/libs/zlib/x86 and naturally
now i have to either cp everything jn that chain or, drag my kernel source into aromafm directory.
can i point to an 'off-world' source outside of build directory? if so what does that look like?
as to zlib libz.a, the down side of a static lib is it doesn't necessarily fit to a specific purpose/function right?
thanks for your help as always.
m
Click to expand...
Click to collapse
About that zlib. I still don't know if it will work. There may be a call from other files to the zlib files. And if so, i dont think it will work.
As for the cpudet.c, its not a typo. It looks like they were present in the source of zlib. But put outside by the developer because of ARM. U need to find the cpudet.c, put it into the following folder inside the source of aromafm: include/x86/cpudet.c. The same thing goes with: include/x86/adler32.c. But maybe it only works when u have it at aromafm/x86/cpudet.c/aromafm/x86/adler32.c.
I found the zlib variant the developer uses (old one i think, but maybe nessecary) and it includes the missing files, here From Koush
Heee heeee heeee!
hazou,
cool, will check out,
okay so, this is what i did,
forced compile for non neon
replaced uncompiled source for both zlib and libpng and mmm
result aromafm-santos10wifi
flash in recovery and......it works! .......mostly [lag, can i pull libenc trick with this?]
i need to adjust for display and figure out a way to enable/facilitate scrollback in terminal
at terminal #whoami
returns #uid0 :good:
busybox :good:
m
moonbutt74 said:
hazou,
cool, will check out,
okay so, this is what i did,
forced compile for non neon
replaced uncompiled source for both zlib and libpng and mmm
result aromafm-santos10wifi
flash in recovery and......it works! .......mostly [lag, can i pull libenc trick with this?]
i need to adjust for display and figure out a way to enable/facilitate scrollback in terminal
at terminal #whoami
returns #uid0 :good:
busybox :good:
m
Click to expand...
Click to collapse
Nice that it works! The pixelflinger (libenc) trick wont work here. I think that aroma can be enhanced with the libenc trick, but it needs heavy modding on graphical (framebuffer) part. And i don't have the skills to get that sorted.
good deal
Hazou said:
Nice that it works! The pixelflinger (libenc) trick wont work here. I think that aroma can be enhanced with the libenc trick, but it needs heavy modding on graphical (framebuffer) part. And i don't have the skills to get that sorted.
Click to expand...
Click to collapse
hazou,
thanks for the pointer, i wasn't sure of which direction to look. I am starting to get the hang of this stuff. got philz done, getting aromafm done.
thanks so much.
m

4/19/2017 [] 7.1.1 UPDATE [] HTC 10 (msm 8996) [] CPU, VM, RAM, IO "Tune"

ORIGINAL THREAD HERE: https://forum.xda-developers.com/axon-7/development/2-15-2017-axon-7-msm-8996-cpu-vm-ram-t3557392
This mod was originally created for the Axon 7, but due to several requests, I've modified a version for the HTC 10, please see below, and post questions or comments in the original thread above. Please state you are a HTC 10 user if you have feedback in that thread, to consolidate user feedback and speed up response time.
Custom tuning for a device is always a necessity. "Canned" settings will get you by, but they are certainly never optimized for a specific device. In fact, Linux typically takes a general approach to find harmonic balance in default settings that will, for the most part, work in an acceptable manner for just about any device. There are a lot of resources available on this device, so we should utilize it in a manner appropriate to squeeze out as much battery life and performance as possible without sacrificing much of those outputs, don't you think? This is going to fix that for you.
Here is what is required of you before you begin:
1. Must be rooted
2. Must have the HTC 10 OR a device running the Snapdragon 820, as this modification is not so much device specific, but hardware specific. The important aspect being the snapdragon 820 and the RAM disk size.
3. Must have write protection disabled. If the HTC 10 requires write protection to be disabled, see the code and instruction below:
Using adb shell:
Code:
adb reboot disemmcwp
Using Linux terminal (from your phone, for example):
Code:
reboot disemmcwp
Let's begin.
Getting right to it, here's what I've done:
- modified parameters of the interactive governor, and quite extensively at that (search some of my threads if you want a little bit of a breakdown of the general approach I take)
- reconfigured input_boost parameters
- reconfigured vm parameters (again, the device has a lot of RAM resource, this will utilize it and give you a far better user experience. Basically, I've adjusted dirty_ratio, dirty_background_ratio, swappiness, and other parameters of the virtual machine.)
- disabled zRAM for 6 GB variants (RAM compression, again, not needed on this device really, this mod will save you CPU cycles and power) this will not apply to HTC 10 users, you will still have zRAM enabled.
- remapped minfree parameters for LMK (low memory killer) again only for 6 GB variants
- Tuned CFQ scheduler for flash storage devices
- Tuned "core_ctl" module (needs kernel support, I recommend freeza's latest version of BeastMode. For those wondering, yes, you can still use this mod with the stock kernel. It won't break anything.) again this will only apply to devices that support core_ctl at the kernel.
In a nutshell, that's what we're looking at here. I can guarantee you this will have a significantly positive impact on your device. Turbo time, homies.
How to install????
Easy. First, the file we are replacing is found in /system/etc... it is the "init.qcom.post_boot.sh" file - this file is basically shell scripts, which are applied at boot via this particular shell file.
All you have to do is download the file to your device, open up a file explorer (must have root capability), navigate to the /system/etc folder with said file explorer, mount your /system as RW (read write), delete your stock "init.qcom.post_boot.sh" file, and replace it with mine.
After you've successfully done this, change the new file's permissions to rw-r--r-- (0644), and then reboot!
Or, if you are brave, you can do it manually via a terminal app and get your fingers wet... if you choose to do that, see below:
Make sure the file is located on the root of your internal sdcard in /sdcard, open your terminal app (again, must have root) and type the following commands, hitting enter after each one (be careful to pay attention to the spacing).
Code:
su
Code:
cd /
Code:
mount -o remount,rw /system
Code:
cd /system/etc
Code:
rm init.qcom.post_boot.sh
Code:
cd /sdcard
Code:
mv init.qcom.post_boot.sh /system/etc
Code:
chmod 0644 /system/etc/init.qcom.post_boot.sh
I don't want credit, don't need you to give or offer donations, this is purely for the community in the spirit of Linux ideology. All I ask is for you to hit the thanks button :good:
That's pretty much it, guys. Enjoy!
DOWNLOAD
warBeard_actual said:
ORIGINAL THREAD HERE: https://forum.xda-developers.com/axon-7/development/2-15-2017-axon-7-msm-8996-cpu-vm-ram-t3557392
Hello everyone, I would like to provide this mod to the HTC 10. If somebody could grab me the STOCK file: init.qcom.post_boot.sh found in /system/etc I will modify it for you guys and post it here with instructions on how to install.
It will provide you a good boost in battery life without sacrificing performance.
Thanks!
Click to expand...
Click to collapse
Thanksss :angel:
I little bit more tuning can't be wrong I guess. Here you go. Just uploaded the respective file needed to do the trick.
5m4r7ph0n36uru said:
I little bit more tuning can't be wrong I guess. Here you go. Just uploaded the respective file needed to do the trick.
Click to expand...
Click to collapse
I'll have this done tomorrow night. Thanks for getting me the file
Hey guys, file is up, with instruction on how to install.
There were actually a lot of typos in the stock file from HTC
I cleaned up the file from redundancy, fixed a few things while adding my modifications to the file. For those wondering, YES the file is supposed to much smaller as a lot of unneeded code was removed that was specific for other SoC's.
Enjoy, feedback is welcome, but I can guarantee your experience will be postive results.
Phone booted, will be testing over the next few days
warBeard_actual said:
Hey guys, file is up, with instruction on how to install.
There were actually a lot of typos in the stock file from HTC
I cleaned up the file from redundancy, fixed a few things while adding my modifications to the file. For those wondering, YES the file is supposed to much smaller as a lot of unneeded code was removed that was specific for other SoC's.
Enjoy, feedback is welcome, but I can guarantee your experience will be postive results.
Click to expand...
Click to collapse
"The file we are replacing is found in /system/etc... it is the "init.qcom.post_boot.sh" file - this file is basically shell scripts, which are applied at boot via this particular shell file" - I could not find this file in /system/etc... Does the type of rom that I'm running matter. currently running ResurrectionRemix 5.8.3 (7.1.2) w/ tabp0le kernel
5m4r7ph0n36uru said:
I little bit more tuning can't be wrong I guess. Here you go. Just uploaded the respective file needed to do the trick.
Click to expand...
Click to collapse
Aloha,
Just to be clear.. So if I download this zip and flash through TWRP I will be on 7.1? I'm currently on stock with Majestic.
Mahalo
Sent from my HTC 10 using XDA-Developers Legacy app
devilman30 said:
Aloha,
Just to be clear.. So if I download this zip and flash through TWRP I will be on 7.1? I'm currently on stock with Majestic.
Mahalo
Sent from my HTC 10 using XDA-Developers Legacy app
Click to expand...
Click to collapse
No
Read the OP
Mike Grace said:
"The file we are replacing is found in /system/etc... it is the "init.qcom.post_boot.sh" file - this file is basically shell scripts, which are applied at boot via this particular shell file" - I could not find this file in /system/etc... Does the type of rom that I'm running matter. currently running ResurrectionRemix 5.8.3 (7.1.2) w/ tabp0le kernel
Click to expand...
Click to collapse
Well, I should have probably told you that CM-based ROMs don't have this file. Lol.
If you are an experienced user, you can add this to init.d
Using this without any problems, on top of ex kernel modifications and using PNP tweak v23. Do all of these play nicely together?
Sent from my HTC 10 using XDA-Developers Legacy app
warBeard_actual said:
Well, I should have probably told you that CM-based ROMs don't have this file. Lol.
If you are an experienced user, you can add this to init.d
Click to expand...
Click to collapse
I'm not an "experienced user" per-say but basically we take your edited init.qcom.post_boot.sh file and move into init.d (I'm on LOS ROM) folder and re-name and set permissions correctly?
I have re-named to 01init.qcom.post_boot
I'll upload a screenshot shortly to show what I have done.
Also, will it matter the kernel and write protection?
I'm assuming that I don't need to bother with it since I was able to move and edit this file?
MrRob0t said:
I'm not an "experienced user" per-say but basically we take your edited init.qcom.post_boot.sh file and move into init.d (I'm on LOS ROM) folder and re-name and set permissions correctly?
I have re-named to 01init.qcom.post_boot
I'll upload a screenshot shortly to show what I have done.
Also, will it matter the kernel and write protection?
I'm assuming that I don't need to bother with it since I was able to move and edit this file?
Click to expand...
Click to collapse
Yep, should be good. Make sure you leave your original stock file in /system/etc however... and line out any conflicting code in that stock file.
init.d loads during boot, as opposed to post boot, so any conflicting code with be overwritten after the .sh file executes (around the time you start seeing your lock screen)
warBeard_actual said:
Yep, should be good. Make sure you leave your original stock file in /system/etc however... and line out any conflicting code in that stock file.
init.d loads during boot, as opposed to post boot, so any conflicting code with be overwritten after the .sh file executes (around the time you start seeing your lock screen)
Click to expand...
Click to collapse
Original stock file. Does that mean the file that you edited or do i need to put the original file that was not edited. Using los based rom so original doesn't exist. Thank you
Mike Grace said:
Original stock file. Does that mean the file that you edited or do i need to put the original file that was not edited. Using los based rom so original doesn't exist. Thank you
Click to expand...
Click to collapse
Using LOS, you're good to go, as the file doesn't exist in /system/etc
Toss it in /system/etc/init.d and remove the .sh extension, good to go.
Delete

Categories

Resources