LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Mobile
User Name
Password
Linux - Mobile This forum is for the discussion of all topics relating to Mobile Linux. This includes Android, Tizen, Firefox OS, Sailfish OS, Maemo, MeeGo, Ubuntu Mobile, WebOS, Open Mobile Alliance and other similar projects and products.
A reminder that LQ now has a dedicated Android sister site: AndroidQuestions.org

Notices

Reply
 
Search this Thread
Old 05-01-2013, 02:13 PM   #1
Ewais
LQ Newbie
 
Registered: Nov 2012
Posts: 9

Rep: Reputation: Disabled
Question can i build linux with android kernel ??


Basicly what I want to do is use my mobile phone the same way I use my laptop. Compile and test codes,install same programmes and use terminal ,etc.

So I thought about installing linux in my phone.but knowing that an android kernel might have device specific code or something. Can I build linux system on android kernel and be able to use it the same way as my laptop ??
Also without losing functionality as calls,GPS,WiFi and so ??
 
Old 05-01-2013, 04:11 PM   #2
business_kid
Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 6,608

Rep: Reputation: 583Reputation: 583Reputation: 583Reputation: 583Reputation: 583Reputation: 583
Hardly.

To get stuff compiled, you need
A libc (of which you probably have just the running bits, not the development bits)
kernel headers
a compiler like gcc or llvm
ram to spare
disk space to spare
some programs instead of tiny little busybox pretending to be those programs
root access
excellent eyesight and patience in bucketloads.

and you probably have none of them except disk space. If you want to do that sort of stuff, best to start with an arm based distro (debian, fedora and I think slackware do them - perhaps others as well). Loads of howtos up on the web on this stuff. You can even be root there, and dual boot a phone with an ordinary distro (which will have the requisite bits). Howtos on the web. Or you could buy a raspberry Pi in case anything happens to your phone!!
 
Old 05-02-2013, 11:54 AM   #3
ottavio
Member
 
Registered: Nov 2007
Posts: 312

Rep: Reputation: 46
You're better off developing on the Android Eclipse IDE but on PC. On your mobile you can indeed use a terminal and even install some programs without root.
 
Old 05-18-2013, 08:53 AM   #4
jordanGSU
Member
 
Registered: Sep 2004
Distribution: Debian, Slackware, Arch
Posts: 65

Rep: Reputation: 15
Even if there is a way, compiling and testing code on a phone would be difficult even with a big one like the Note2.

I have a stock ASUS Transformer Prime, which is an android tablet with optional keyboard. Occasionally I will use "Terminal IDE" which is a fantastic app for command line editing and compiling. It can handle Java very easily, but the instructions for getting C code to compile were fairly involved so I didnt bother. Another good one is AIDE where you can edit, compile, and deploy a full android app directly on the device without needing a computer.

Even those options arent anything like a full linux gcc though.
 
Old 05-31-2013, 11:21 AM   #5
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
Do your development on a system suited to software development, such as a PC running Linux. You can get cross toolchains for any architecture you're likely to find supporting Android.
--- rod.
 
Old 05-31-2013, 09:24 PM   #6
jefro
Guru
 
Registered: Mar 2008
Posts: 12,075

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
Good question, worth asking.
At one time, java was touted as a write once run everywhere product. You'd never have to recompile an app for a different OS. Android is sort of a java as I understand it so I am not sure why one couldn't reverse it so that your phone app is easily run under some java on the computer. It may be there but I haven't seen it.

http://www.zdnet.com/blog/burnette/h...ig-picture/515
 
Old 06-04-2013, 05:48 AM   #7
OctavioPang
LQ Newbie
 
Registered: Jun 2013
Posts: 11

Rep: Reputation: Disabled
Just look in for xda developers on the google in reference to your query..you might want to check them out for your requirement. They have a real simple method of doing that..but be cautious of any damage whatsoever..it is not a completely safe process..
 
Old 06-26-2013, 04:17 PM   #8
YellowApple
Member
 
Registered: Mar 2013
Location: Truckee, California, United States
Distribution: Slackware, openSUSE, Debian,Slackware, openSUSE, OpenBSD
Posts: 91

Rep: Reputation: 33
Yes, this is possible. In theory, at least.

In reality, it's very dependent on the kernel itself and the device's capabilities. The following suggestions assume you have already obtained root access to your device; if not, you will need to do so.

The easiest way to do this is probably via a chroot environment. There's an app on the Play Store that will do this, called Complete Linux Installer; it works by creating a disk image file on your SD card (or internal storage), mounting it as a loopback device, and running your non-Android Linux on it. However, it's somewhat limited; expanding storage space is a pain, and there are some performance implications if you use that approach (since it involves lots of tiny operations on one giant file). It also requires your kernel to be built with loopback support; I've found this is usually the case for Samsung devices, as well as for CyanogenMod in general, but it's something to keep in mind if something fails.

The harder way to do this is to format your SD card (or a partition thereof) with an ext2/3/4 filesystem (or another filesystem suitable for Unix-like systems, like ReiserFS or btrfs), then install an ARM Linux system to it. The exact details depend on your distro; for Debian, it involves using the debootstrap utility to create a basic "bootstrap" installation, then using that bootstrap to finish the installation and produce a complete chroot environment. This will have better performance and flexibility, but is much more involved to set up.

There's also the possibility of ripping out the Android kernel and shoving it into a custom-brewed ARM distro. This is much harder, and will require a very firm understanding of the Android boot process. However, this is the approach encouraged by the Firefox OS folks for porting Boot2Gecko to new devices - basically, finding a CyanogenMod port, ripping out the kernel, shoving it into B2G, and seeing if it crashes and burns when it tries to boot/run.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Setting Up An Android App Build Environment With Eclipse, Android SDK, PhoneGap (Debian Squeez LXer Syndicated Linux News 0 03-07-2011 11:50 PM
LXer: Android App Build Environment With Eclipse, Android SDK, PhoneGap (Fedora 14) LXer Syndicated Linux News 2 02-01-2011 12:11 PM
LXer: Setting Up An Android App Build Environment With Eclipse, Android SDK, PhoneGap (Ubuntu 10.10) LXer Syndicated Linux News 0 01-27-2011 12:30 PM
Which is the kernel build directory? I Can't find kernel build files crabsody Debian 7 01-09-2007 05:48 AM
LXer: Howto: build Linux kernel module against installed kernel w/o full kernel source tree LXer Syndicated Linux News 0 09-03-2006 09:21 PM


All times are GMT -5. The time now is 11:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration