Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,809,359 Members 39,134 Now Online
XDA Developers Android and Mobile Development Forum

My setup with Ubuntu and a custom permissive Kernel

Tip us?
 
Graeme H
Old
#1  
Junior Member - OP
Thanks Meter 8
Posts: 19
Join Date: Jan 2010
Default My setup with Ubuntu and a custom permissive Kernel

Hey everyone. I bought this device specifically because I do a lot of work on linux in command line world and I though it would be the perfect device when combined with the Logitech Pro keyboard and Complete Linux Installer (it's an app on Google Play). It turned out to be quite a bit of work getting everything working because of Knox and SELinux. Eventually I got a custom kernel working that allows me to toggle SELinux between permissive and enforcing.

I attached an Odin flashable tar that works on the SM-P900 (wifi version). I am on the North American version, so I have no idea whether it will work in other regions. If you flash this kernel then there are a few things you need to know:
  • I'm assuming you already have root on your device.
  • When you boot it will still be in "Enforcing" mode. This change simply allows you to use the "setenforce" terminal command or any of the apps on Google Play that do this for you.
  • You might experience some wifi weirdness after you flash the kernel. You just need to open up /system/build.prop and change ro.securestorage.support from true to false and then reboot to resolve the issue.

If you have a different version of the device or want to compile it yourself for any reason I wrote an article describing how I compiled it here:
http://graemehill.ca/compiling-permi...ndroid-kernel/

I also did a few other things to fix the keyboard and get linux running properly, so if you're interested in that I described my setup in more detail here:
http://graemehill.ca/turning-a-galax...-linux-laptop/
The Following 5 Users Say Thank You to Graeme H For This Useful Post: [ Click to Expand ]
 
Serinety
Old
#2  
Serinety's Avatar
Senior Member
Thanks Meter 330
Posts: 742
Join Date: Aug 2010
Location: Davis, CA

 
DONATE TO ME
Thank you for this!

Sent from my SM-P900 using Tapatalk
 
dodo99x
Old
#3  
dodo99x's Avatar
Senior Member
Thanks Meter 60
Posts: 280
Join Date: Apr 2011
Location: Ottawa
Default trying to build kernel

I'm trying to follow your guide to compile a kernel from source. I have installed (on my Win 8.1_64 PC) Android SDK/NDK. GnuWin32, JavaJRE, and downloaded SM-P900 kernel source.

I'm getting errors at "Apply Kernel Config" step.

here's the output: http://pastebin.com/yFqDrNY8

Thanks for your help
Don
 
Graeme H
Old
#4  
Junior Member - OP
Thanks Meter 8
Posts: 19
Join Date: Jan 2010
Quote:
Originally Posted by dodo99x View Post
I'm trying to follow your guide to compile a kernel from source. I have installed (on my Win 8.1_64 PC) Android SDK/NDK. GnuWin32, JavaJRE, and downloaded SM-P900 kernel source.

I'm getting errors at "Apply Kernel Config" step.

here's the output: http://pastebin.com/yFqDrNY8

Thanks for your help
Don
It looks like you're in Windows. To my knowledge it is not possible to compile a Linux kernel in windows. I would recommend downloading virtual box and installing some Linux distro in there. This is what I was talking about in the "environment" section at the top of the article.

For android development I find that you need access to a lot of tools where some are only available on Windows and others are only available on Linux so a Windows PC with a Linux VM is ideal in my opinion.
 
dodo99x
Old
#5  
dodo99x's Avatar
Senior Member
Thanks Meter 60
Posts: 280
Join Date: Apr 2011
Location: Ottawa
Oh ok, no problem. I just misread the guide. I've setup a build environment in a vm before to compile aosp for my Nexus 10. Shouldn't be too hard to do it again. I recently rebuilt my pc so the vm I had got nuked.

Sent from my SM-P900 using Tapatalk
 
dodo99x
Old
(Last edited by dodo99x; 20th May 2014 at 02:20 AM.)
#6  
dodo99x's Avatar
Senior Member
Thanks Meter 60
Posts: 280
Join Date: Apr 2011
Location: Ottawa
ok I got my Ubuntu VM up and running using this guide

http://forum.xda-developers.com/show...6&postcount=25

installed android NDK to ~android/NDK, and unzipped the kernel source to ~android/kernel

followed your guide to build a SELinux permissive kernel but i'm getting some errors when trying to compile. here's the output:

http://pastebin.com/Npdu7J5h

EDIT: retried doing the EXPORT command and now it seems to be compiling
 
Graeme H
Old
#7  
Junior Member - OP
Thanks Meter 8
Posts: 19
Join Date: Jan 2010
Quote:
Originally Posted by dodo99x View Post
EDIT: retried doing the EXPORT command and now it seems to be compiling
When you export a variable in the terminal it only exists for that one session, so if you open a new terminal instance you need to run the command again. If you want to set it permanently normally you can just put the export command into ~/.bashrc
 
dodo99x
Old
#8  
dodo99x's Avatar
Senior Member
Thanks Meter 60
Posts: 280
Join Date: Apr 2011
Location: Ottawa
Oh I see. I'll give that a try. I was able to create a new boot.img following the rest of your guide. I have yet to try flashing it though. Will have to find some info about all the kernel options that can be set. Hopefully be able to integrate HMP to get all eight cores running at the same time.

Sent from my SM-P900 using Tapatalk
 
Graeme H
Old
#9  
Junior Member - OP
Thanks Meter 8
Posts: 19
Join Date: Jan 2010
Cool, let us know how that goes. I wonder how much it would affect battery life.
 
canezila
Old
#10  
canezila's Avatar
Senior Member
Thanks Meter 21
Posts: 144
Join Date: Nov 2010
Location: Orlando
Quote:
Originally Posted by Graeme H View Post
Hey everyone. I bought this device specifically because I do a lot of work on linux in command line world and I though it would be the perfect device when combined with the Logitech Pro keyboard and Complete Linux Installer (it's an app on Google Play). It turned out to be quite a bit of work getting everything working because of Knox and SELinux. Eventually I got a custom kernel working that allows me to toggle SELinux between permissive and enforcing.

I attached an Odin flashable tar that works on the SM-P900 (wifi version). I am on the North American version, so I have no idea whether it will work in other regions. If you flash this kernel then there are a few things you need to know:
  • I'm assuming you already have root on your device.
  • When you boot it will still be in "Enforcing" mode. This change simply allows you to use the "setenforce" terminal command or any of the apps on Google Play that do this for you.
  • You might experience some wifi weirdness after you flash the kernel. You just need to open up /system/build.prop and change ro.securestorage.support from true to false and then reboot to resolve the issue.

If you have a different version of the device or want to compile it yourself for any reason I wrote an article describing how I compiled it here:
http://graemehill.ca/compiling-permi...ndroid-kernel/

I also did a few other things to fix the keyboard and get linux running properly, so if you're interested in that I described my setup in more detail here:
http://graemehill.ca/turning-a-galax...-linux-laptop/
I tried to install this using VBox Odin and I couldnt get it to work. Tried using BOOTLOADER and also PDA. Not sure the correct one but neither worked for me. Also, Moblie ODin hasnt yet worked but when it does, things will be much easier for me at least.

I have a newly rooted SM-900. I will have to find time someday to compile the kernel against what I have. Must be a slightly newer version than the one you posted. That is only thing I can think since I just got my 12.2. Thanks for the detailed info.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes