gsstudios / Dorimanx-SG2-I9100-Kernel

JB/KK/LP/MM Kernel for Samsung Galaxy S2 I9100
https://gsstudios.github.io
Other
17 stars 7 forks source link

BLN doesn't work #26

Closed gsstudios closed 8 years ago

gsstudios commented 8 years ago

@kularny

BLN not been working on DorimanX kernel since CM12.1 was released.

A possible workaround is already available on the XDA developer forums, but a proper fix is needed.

Any ideas if this is ROM related or if something needs to be changed in the kernel?

Thanks.

arny24x7 commented 8 years ago

http://review.cyanogenmod.org/#/c/130043/

For CM il create a new commit bcoz prebuilt .so needs to reside on vendor_samsung from Muppets. But Iam using the above mentioned commit.

https://github.com/kularny/android_hardware_samsung/commit/01c8bc82ae4a8e5eb6907f2f8b4137931a98b772

https://github.com/kularny/android_device_samsung_galaxys2-common/commit/cc356678881f1190eb88ee817f21d861c16fe324

Or u can extract the lights.exynos4.so and bundle it with kernel. Create a system/lib/hw and place it inside that. Then under the updater script u can use package_extract_dir("system", "/system"); It will unload all the folders+files in the right place ie the .so file in system/lib/hw. Thats it.

arny24x7 commented 8 years ago

I had to compile the lights.c outside build and use the resultant ndk .so bcoz few codes in the bln supported code breaks build and even if i bypass them with pragma push..it doesnt work...so had to backport the old codes from the bln lights.c to the new lights.c from insignal and using a prebuilt c shared lib so that users might not face build issues.

gsstudios commented 8 years ago

OK, so what I get from this is that I can modify updater script to automatically replace the bln files.

gsstudios commented 8 years ago

So when I use package extract directory, will it replace the destination file or will I have to remove from original destination?

arny24x7 commented 8 years ago

run_program("/sbin/busybox", "mount", "/system"); delete("/system/lib/hw/lights.exynos4.so"); package_extract_dir("system", "/system"); run_program("/sbin/busybox", "unmount", "/system");

In the system folder, place lib/hw/lights.exynos4.so

Thats it.

gsstudios commented 8 years ago

Oh, I already got it working on my kernel :) Thanks anyway.

gsstudios commented 8 years ago

So I currently have it set so it copies it to the required destination. It will also change permission to 644. I didn't make it delete anything but it works.

arny24x7 commented 8 years ago

Plz make sure it deletes. thats the proper way. Dont do it directly. And I will be pushing a new commit for cm soon. Il just have to link hardware_samsung with prop_vendor_samsung with a conditional flag to be set in boardconfigcommon.mk in s2_common.

gsstudios commented 8 years ago

Ok. Will make sure.

arny24x7 commented 8 years ago

btw permission 644 is not required as the hw folder has itself the perms required and hence all the sub-files easily inherit that permission.

gsstudios commented 8 years ago

Ok, thanks. Will remove unnecessary line

gsstudios commented 8 years ago

I will close this issue unless there are problems that we may come across. Thanks kularny!

arny24x7 commented 8 years ago

ur wc

arny24x7 commented 8 years ago

What changes u made in kernel side to fix bln without tge the lights.c???

gsstudios commented 8 years ago

I think its better to ask realex-fire. BLN is still working on my side, so it could be something related to the post-init or init scripts that have now been updated to properly support cm12.1.

arny24x7 commented 8 years ago

Ya i asked him...in my kernel...without that..it wont work...there got to be some module built in for BLN by dorimanx himself.

gsstudios commented 8 years ago

There is another lights.exynos4.so file in the initramfs repo. I believe something in the post-init or install.sh triggers the kernel to do something similar. Not quite sure though.

arny24x7 commented 8 years ago

yup thats it. Thanks

gsstudios commented 8 years ago

I still need to confirm if BLN works on phones that haven't installed the build that changes the ROM BLN file. Will test soon on my other s2.

arny24x7 commented 8 years ago

the path has just been updated...I was also going crazy thinking as to how the lights get controlled by BLN without lights.c

arny24x7 commented 8 years ago

for CM I have to make the patch that I told u earlier for default support.

arny24x7 commented 8 years ago

Practically ur friend used the same lights.exynos4.so module that I made...Just from a different path. Btw hez doe a brilliant job.

gsstudios commented 8 years ago

Yep, he deserves a lot of credit on making DorimanX LP possible :)

arny24x7 commented 8 years ago

Ya say congrats to him from me and hello too.

Realex-fire commented 8 years ago

https://github.com/gsstudios/initramfs3/blob/master-lp/sbin/ext/install.sh#L191 - it is an installation of lights.exynos4.so https://github.com/gsstudios/initramfs3/blob/master-lp/sbin/ext/post-init.sh#L115 - this line install.sh script is caused. (it was commented out)

arny24x7 commented 8 years ago

Got it. Thanks.