Boot.img collection to set SELinux to Permissive and allow ADB to run as root

sorg

Senior Member
Sep 5, 2006
1,049
1,136
143
台灣
No, you are wrong.

Bootloaders released after MK8 don't accept unsigned kernels.

I tested it on new NEE NA4 and it bootloops constantly.

It's the end of permissive kernels.

A pitty.
You are the first one who tell this. While it's possible, i really doubt it's true. Usually it's true for operator-sponsored versions. May be you did something wrong.
Just quickly browsed topic names and didn't find any "Arrghhh, cannot flash custom kernel anymore!!!!". And i'm sure it would be a big news on many sites.
Nothing...
 
Last edited:

akshizzle

Senior Member
Feb 5, 2011
104
72
0
26
Auckland
facebook.com
You are the first one who tell this. While it's possible, i really doubt it's true. Usually it's true for operator-sponsored versions. May be you did something wrong.
Just quickly browsed topic names and didn't find any "Arrghhh, cannot flash custom kernel anymore!!!!". And i'm sure it would be a big news on many sites.
Nothing...
Well I'm on the KitKat leak... so if it works for me then I'm not sure whats wrong?
 

finnince

Senior Member
Feb 8, 2014
65
8
0
Sorry everyone for being so lazy and busy!!
I'm back after a very long holiday haha anyway here's my guide for converting stock kernel to SELinux Permissive

1. You'll need something like Android Kitchen or any other tool to unpack a boot.img

(http://forum.xda-developers.com/showthread.php?t=633246)

2. Extract the kernel and ramdisk from the boot.img, you should be left with a folder containing a zImage file and a boot.img-ramdisk folder. You do not need to touch the zImage file, this is the actual kernel - the ramdisk is just instructions it follows while booting.

3.These are the edits you need to make:

default.prop
Code:
ro.secure=1              -----------------> ro.secure=0
ro.adb.secure=1        -----------------> ro.adb.secure=0
init.rc
Code:
     setsebool debugfs 1   --------> setsebool debugfs 0
*ADD THIS LINE UNDERNEATH*
 setenforce 0

setprop selinux.reload_policy 1  ------->  setprop selinux.reload_policy 0
init.target.rc
Code:
     setprop selinux.reload_policy 1   ----->  setprop selinux.reload_policy 0

4.Repack and flash!
Will this work on SHV-E330S KitKat 4.4 ?
 

Mikekelso421

Senior Member
Mar 21, 2011
746
533
93
Port St Lucie,FL
if i send you my boot.img can you turn off SELinux?

Sorry everyone for being so lazy and busy!!
I'm back after a very long holiday haha anyway here's my guide for converting stock kernel to SELinux Permissive

1. You'll need something like Android Kitchen or any other tool to unpack a boot.img

(http://forum.xda-developers.com/showthread.php?t=633246)

2. Extract the kernel and ramdisk from the boot.img, you should be left with a folder containing a zImage file and a boot.img-ramdisk folder. You do not need to touch the zImage file, this is the actual kernel - the ramdisk is just instructions it follows while booting.

3.These are the edits you need to make:

default.prop
Code:
ro.secure=1              -----------------> ro.secure=0
ro.adb.secure=1        -----------------> ro.adb.secure=0
init.rc
Code:
     setsebool debugfs 1   --------> setsebool debugfs 0
*ADD THIS LINE UNDERNEATH*
 setenforce 0

setprop selinux.reload_policy 1  ------->  setprop selinux.reload_policy 0
init.target.rc
Code:
     setprop selinux.reload_policy 1   ----->  setprop selinux.reload_policy 0

4.Repack and flash!

ive tried this method with no luck. if i send you my boot.img can you turn off SELinux?? or maybe tell me what needs to be edited.

btw im using note 2 android 4.4 touchwiz. thanks
 

E:V:A

Inactive Recognized Developer
Dec 6, 2011
1,449
2,212
0
-∇ϕ
No, you are wrong. Bootloaders released after MK8 don't accept unsigned kernels. I tested it on new NEE NA4 and it bootloops constantly. It's the end of permissive kernels.
You are the first one who tell this. While it's possible, i really doubt it's true. Usually it's true for operator-sponsored versions. May be you did something wrong. Just quickly browsed topic names and didn't find any "Arrghhh, cannot flash custom kernel anymore!!!!". And i'm sure it would be a big news on many sites. Nothing...
I think you're as confused as everyone else. These are 3 different things.
1. Locked bootloaders = only allow signed code in the chain of trust.
2. Signed kernel = doesn't matter if not locked bootloader.
3. "Permissive" kernels refer to SEAndroid set to "Permissive" contrary to "Enforced" which makes any kind of root mods way more complicated.

Did I get that right?
 

ianwuk

Member
Sep 14, 2010
39
2
0
Sorry everyone for being so lazy and busy!!
I'm back after a very long holiday haha anyway here's my guide for converting stock kernel to SELinux Permissive

1. You'll need something like Android Kitchen or any other tool to unpack a boot.img

(http://forum.xda-developers.com/showthread.php?t=633246)

2. Extract the kernel and ramdisk from the boot.img, you should be left with a folder containing a zImage file and a boot.img-ramdisk folder. You do not need to touch the zImage file, this is the actual kernel - the ramdisk is just instructions it follows while booting.

3.These are the edits you need to make:

default.prop
Code:
ro.secure=1              -----------------> ro.secure=0
ro.adb.secure=1        -----------------> ro.adb.secure=0
init.rc
Code:
     setsebool debugfs 1   --------> setsebool debugfs 0
*ADD THIS LINE UNDERNEATH*
 setenforce 0

setprop selinux.reload_policy 1  ------->  setprop selinux.reload_policy 0
init.target.rc
Code:
     setprop selinux.reload_policy 1   ----->  setprop selinux.reload_policy 0

4.Repack and flash!
Hello.

I cannot find setsebool debugfs 1 in my init.rc file - what am I doing wrong? Can I manually add it? If so, where?

I also do not have 'init.target.rc' either.

I have attached a picture of the files I do have (Samsung Galaxy S4 - GT-I9500 - 4.2.2) - how can I follow your steps?

 
Last edited:

Geofferey

Senior Member
Jan 1, 2011
198
213
0
Long Beach, CA
Thanks for the guide man. I know this post is old but I am having trouble. I unpacked the boot.img and made all the necessary changes. I repacked, converted to tar.md5 and reflashed with Odin. When I start up and run getenforce it outputs "Enforcing". Idk what I'm doing wrong.

I'm using a Galaxy Tab3 on kitkat
 
Last edited:
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