[ROM][V500][5.1.x][CM12.1] Official CyanogenMod 12.1

Deltadroid

Recognized Contributor
Apr 19, 2013
3,764
9,879
263
finishing a sirius PA build and i'll start right away a CM v500 one with that commit.
I just realized an easy way to test if the patch I just submitted fixes the Bluetooth reconnect problem.

The problem is that the bluetooth address is changing every time the Bluetooth service is restarting.

So, first check the bluetooth address in about, then restart the Bluetooth service and check if the bluetooth address changes. If the bluetooth address changes after restarting Bluetooth service, then it's still not fixed.
 
Last edited:

infected_

Recognized Developer
Jul 12, 2008
5,830
14,118
263
Portugal
infectedbuilds.net

Deltadroid

Recognized Contributor
Apr 19, 2013
3,764
9,879
263
last build had the previous BT fix.. but i didnt test it... did you had reports to know if it was ok?
I didn't get any results of the first patch yet. Can you tell if the Bluetooth address changes when restarting the Bluetooth service? You don't even need any Bluetooth devices to determine if it's fixed or not.

Actually, the second patch might work better and have tighter control. Cm said the first patch requires more labels because allowing the Bluetooth loader access to all block devices was too general.
 

ukguy115

Senior Member
Jun 18, 2008
289
83
0
I just realized an easy way to test if the patch I just submitted fixes the Bluetooth reconnect problem.

The problem is that the bluetooth address is changing every time the Bluetooth service is restarting.

So, first check the bluetooth address in about, then restart the Bluetooth service and check if the bluetooth address changes. If the bluetooth address changes after restarting Bluetooth service, then it's still not fixed.
My address still changing and Bluetooth headphone having connection issues. On 6/1 cm12.1
 
  • Like
Reactions: Deltadroid

Deltadroid

Recognized Contributor
Apr 19, 2013
3,764
9,879
263
seems bluetooth is fixed. BT MAC address stays the same after turning on and off.
Great! Now we know what fixes the problem. But, cm won't accept that patch because I need to make labels. I'm really trying to figure out now how I can do that. How do I know which system_prop and which block_device is being used?

I need to fix the patch before it will be in official cm 12.1 nightly builds.
 

mackeev

Senior Member
Jan 3, 2014
434
124
0
I'm still using your patch that switches SELinux into "Permissive" mode. This is the only way to make my V500 remember passwords for bt devices.
 

Deltadroid

Recognized Contributor
Apr 19, 2013
3,764
9,879
263
I'm still using your patch that switches SELinux into "Permissive" mode. This is the only way to make my V500 remember passwords for bt devices.
Yes, I've just about fixed the sepolicy so we can use enforcing again. Soon to make it official. It's fixed now in infected builds.
 

Deltadroid

Recognized Contributor
Apr 19, 2013
3,764
9,879
263
Last edited:

Deltadroid

Recognized Contributor
Apr 19, 2013
3,764
9,879
263
Bluetooth sepolicy patch

I have created a flashable zip that fixes the sepolicy for the bluetooth loader instead of having to disable selinux and use permissive mode. This is a much better option than disabling selinux. After installing latest CM12.1 ROM and the bluetooth sepolicy patch, I rebooted to the system and I removed my bluetooth devices to pair them again. After pairing my bluetooth devices with the sepolicy patch applied, everything was fixed and I could restart the service and all the bluetooth devices still reconnect.

Requirement: This is only for bumped ROMS and kernels.

Note: There is no more need to use permissive mode to fix bluetooth. This bluetooth sepolicy patch needs to be reinstalled after flashing a new rom or kernel.

Instructions:
1) Flash Bumped ROM (and bumped custom kernel optionally)
2) Flash Bluetooth sepolicy patch
3) Reboot to system

v500-bluetooth-sepolicy-signed.zip

Code:
 #!/sbin/sh
+
+cd /tmp
+mkdir ramdisk
+cd ramdisk
+gunzip -c ../boot.img-ramdisk.gz | cpio -i
+sed -i '/seclabel u:r:bluetooth_loader:s0/d' init.awifi.rc
+find . | cpio -o  -H newc | gzip > ../boot.img-ramdisk-new.gz
+cd ..
+
 echo \#!/sbin/sh > /tmp/createnewboot.sh
-echo /tmp/mkbootimg --kernel /tmp/boot.img-zImage --ramdisk /tmp/boot.img-ramdisk.gz --cmdline \"$(cat /tmp/boot.img-cmdline) androidboot.selinux=permissive selinux=0\" --base 0x$(cat /tmp/boot.img-base) --pagesize 2048 --ramdiskaddr 0x82200000 --output /tmp/newboot.img >> /tmp/createnewboot.sh
+echo /tmp/mkbootimg --kernel /tmp/boot.img-zImage --ramdisk /tmp/boot.img-ramdisk-new.gz --cmdline \"$(cat /tmp/boot.img-cmdline)\" --base 0x$(cat /tmp/boot.img-base) --pagesize 2048 --ramdiskaddr 0x82200000 --output /tmp/newboot.img >> /tmp/createnewboot.sh
 chmod 777 /tmp/createnewboot.sh
 /tmp/createnewboot.sh
 return $?
Thanks @jsevi83 for providing sepolicy patches. That was a big help.
 
Last edited:

olbc

Member
Jan 26, 2013
21
1
0
Red Kernel #15 does indeed fix the "black screen" problem with the latest CM 12.1 nightly builds (thanks @Cal). I was having a BSOD every 10 minutes and then I installed Red Kernel #15 and its been fine since. I am also not having any trouble with my sdcard unmounting with Red Kernel #15. When I test the newer versions of Red Kernel, my sdcard becomes unmounted unexpectedly. I've noticed that Red Kernel #16 stopped working properly after the source code was rebased against CM12. Here are the steps I took to fix the problem:

1) Reboot to recovery
2) Flash V500-4.4.2-Base-KOT49I.V50020D_US-no-aboot-signed.zip
3) Flash twrp-2.8.6.0-v500.zip for 4.4.2 bootloader
4) Reboot to recovery (not system) to reload new bootloader.
5) Flash CM 12.1 Nightly ROM
6) Flash RedKernel-r015.zip
7) Flash Bump/Permissive kernel script v500-loki-kernel-to-bumped-permissive-kernel-signed.zip
8) Reboot to system
Thank you very much for the very good instructions. I was successful and have finally no more black screens.

Any questions I have. What ist to do, If I flash a new CM 12.1 Nightly? Do I need to repeat steps 6 and 7?

Can it be that the battery consumption is higher (with RedKernel)?
 
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone