Video Tutorial on How to Compile Android and Modify Kernels

video

For those interested, I have just posted a video tutorial series on XDA for building Android Oreo, Nougat, Marshmallow, and Lollipop on 5 different phones, the emulator, and 5 different ROMs. Also included are custom kernel editing, adding apps, changing source code, backgrounds, and more. Here’s what I posted:

From XDA: https://forum.xda-developers.com/android/general/guide-how-to-build-custom-roms-kernel-t3814251

===========================================================================

Praise God! Finally a video tutorial of how to build Android and modify kernels!

I have created a video tutorial and guide for how to compile Android, from Lollipop through Marshmallow, Nougat, and Oreo. The video series covers several different phones, the emulator, kernel and rom editing, app source code editing, and much more!

Who is this video series for?
Well, this video tutorial is a step by step guide built primarily for the beginner. This is written for those who already know how to flash TWRP, CWM, or the like, and who have installed a custom rom before. This is designed to help those who are ready to move up from flashing and installing other peoples custom rom to actually start making their own custom roms. I recommend that a beginner watch the entire series in numerical/alphabetical order (the videos are marked).

That said, I believe that an intermediate developer may find a useful trick here and there, and they should just skip ahead to videos of interest. Perhaps kernel development, or something along those lines.

An advanced rom/kernel developer will probably far exceed my feeble abilities, and will not likely find much useful information here. Perhaps if you are an advanced developer, you would consider continuing the tutorial or making an advanced video series! (See further posts for recommendations on contributing videos.)

Why did you put this together?
Well, after building roms for several different devices, I started receiving requests from users who wanted to start building their own roms, but didn’t know how. I didn’t have enough time to answer everyones questions, so I wrote a few guides, pointed others to guides that were available, but there are some things that you just need to see to understand. Hence, the video tutorial. I just hope that someone finds it useful.

This course was written in order! While Lollipop and Marshmallow are old by today’s standards, there is still good learning value in building them, and there are topics covered there that really make them worth watching.

What’s in the videos?
During the series, we will be building for the emulator, as well as 5 different phones of various brands, and 5 different roms. I hope that this will give the viewer a good idea of how to build for their own specific phone as they see the differences and similarities across the phones and custom roms.

[CODE]
+ Ubuntu installation
+ Java installations
+ Using Git, GitHub, GitKraken, and the command line
+ Fastboot and ADB
+ Heimdall/Odin
+ QFIL, QPST, SALT, and other tools
+ AOSP, SlimRoms, PACrom, AOKP, AOSCP
+ Lollipop, Marshmallow, Nougat, Oreo
+ Errors
+ Overclocking CPU/GPU
+ Adding Governors and I/O Schedulers
+ Sound modifications
+ Changing app colors, text, and icons
+ Adding prebuilt apps
+ Adding source code
+ Converting device from one rom to another
+ AND MORE!
[/CODE]

**** This is an UNOFFICIAL TUTORIAL. Use at your own risk! ****
Download links:
Ogg Vorbis Video GitLab:
[url]https://gitlab.com/alaskalinuxuser/course_android_developer_guide[/url]
Clicking on a video in GitLab will allow you to watch it online.

Ogg Vorbis Video Downloads:
[url]https://gitlab.com/alaskalinuxuser/course_android_developer_guide/-/archive/master/course_android_developer_guide-master.zip[/url]
This download is rather large due to the multiple videos.

MP4 Video GitLab:
[url]https://gitlab.com/alaskalinuxuser/course_android_developer_guide_mp4[/url]
Clicking on a video in GitLab will allow you to watch it online.

MP4 Video Downloads:
[url]https://gitlab.com/alaskalinuxuser/course_android_developer_guide_mp4/-/archive/master/course_android_developer_guide_mp4-master.zip[/url]
This download is rather large due to the multiple videos.

I also have several written guides available on XDA, here are a few:

Building ROMs for the Galaxy Note Edge: [url]https://forum.xda-developers.com/note-edge/general/guide-build-aosp-roms-kernels-note-edge-t3488840[/url]
Building ROMs for the Galaxy S4: [url]https://forum.xda-developers.com/galaxy-s4-tmobile/general/guide-step-step-instructions-building-t3402637[/url]

===========================================================================

Be sure to check out the videos or the XDA thread! I hope that these will help some of the aspiring Android developers out there!

Linux – keep it simple.

Advertisements

Finding apps for a ZTE Z432 dumb phone!

My wife and I recently picked up a dumb phone for things like hunting/camping/fishing. You can get them pretty cheap, and the battery life is fantastic compared to most smart phones. Besides, if you loose it, you’re only out a few bucks.

While a dumb phone is, well, dumb, we were hoping to spruce it up with a few apps for some entertainment value. Especially if you use it while traveling, like taking a plane or boat to some remote spot.

After some web searching, all I could come up with was that AT&T, who sells the ZTE Z432 phone, said that this phone did not support any apps. I recalled the yester-years spent using apps on dumb phones, and I knew this just couldn’t be true. So, if this is your plight, and you also failed to find the answer through a web search, then here you go:

http://www.dertz.in/games/p/download-ZTE-Z432-free-games-9720.htm

I want to be clear that I am in no way endorsing “Dertz”, and I can’t say that all of their apps are safe. In fact, this may be a sure fire way to nuke your dumb phone. However, I did download and install this one:

http://www.dertz.in/games/download-Scrabble-Remix-free-java-mobile-game-10824.htm

and it worked great! How can you go wrong with Scrabble Remix?

The easiest way to install them, is to open the link in the phone browser. Once there, scroll down to the download button, and click it. A pop up will ask you if you really want to download that jar file, and if you say yes, a progress bar will appear. Once downloaded, it will be in your folders.

Find the app you downloaded in your folders, and click on it. It will pop up an install question, and if you say yes, it will ask where to install the app, in either Applications, or Games. In my case, I chose Games. After a minute or so, the app was installed and a pop up asked me if I wanted to open it. Scrabble Remix – game on!

I also experimented with the Bluetooth, which works well. Just download the app you want on a smartphone, or in my case, a Bluetooth capable computer, pair with your Z432, and send the file over that way, if you want to save yourself from painful dumb phone browser experience, or save bandwidth.

For the record, we can just insert our normal sim card from our smart phone into the dumb phone, and it works, however, we did need a sim card holder, because our smart phones use micro sims, and the dumb phone used standard sim cards, but they make a little micro to standard holder that your sim card can pop in and out of. If you need one, stop by just about any cell phone dealer, they should have one.

Linux – keep it simple.

CompTIA Mobility+ certificate to be retired on December 15th.

One of the many things that my work requires is various IT certificates. In particular, they require Network+ for the job I am currently filling, and A+, Security+, and Linux+, for various other simulators at my work. So, I make an effort to keep my certifications current, and to have as many as possible, in the event that a position opens up to which I want to apply.

Now, there are a lot of certificates out there, and while I’m not intending to talk about them all here, I would mention that there are other great programs out there, other than CompTIA. For instance, I do hold an LPIC certification, as well as a SLES, and a LFCS. Two of the great things about CompTIA, however, is the fact that they are an industry standard, and that they have a pyramid hierarchy, which allows you to make current and hold numerous “lower” tier certifications by only taking the top level test.

It was a surprise to me to learn that they are retiring the Mobility+ certificate before the close of this year. Here is their take on why they should retire this certificate:

CompTIA Mobility+ certification will officially retire on December 15, 2017. The main reason for this retirement is that the job role for Mobility+ continues to merge into the Network Administrator role, and much of the Mobility+ content is covered in CompTIA A+, Network+ and Security+.

What surprised me, though, was that this is the only certification from CompTIA, and one of the few certifications in general, that covered cellular data and infrastructure.

Sure, A+ does cover a lot of hardware, but it doesn’t seem to cover cellular towers, WiMAX, or even Satellite components, which are a part of Mobility+. Here in Alaska, with many wild and untamed areas of the state, various forms of wireless communications are utilized to get internet connectivity into remote locations.

Granted, Network+ does cover the majority of TCP/IP protocol stack, but cellular devices typically use odd protocols to control the transmission and reception of the TCP/IP data. The radio portions of Mobility+ helped differentiate between the various types of frequency shifting, hopping, and cells that are an integral part of the mobile world.

Of course, Security+ covers most aspects of authentication, authorization, and accounting, but in a more general sense. While it does cover wireless access, it only focuses on the typical 2.4 and 5 MHz bands and associated equipment, not covering the special needs of cellular devices. When it comes to MDM (Mobile Device Management), Security+ treats it as a footnote in section 4, in which all of section 4 is covered by less than 15% of the test. In Mobility+, however, Mobile Device Management alone is 28% of the exam!

It would seem to me that any cellular or satellite internet provider would make Mobility+ a mandatory requirement. Places like Verizon, T-Mobile, or AT&T would all be encouraging their technical employees to certify in this field in order to maintain their network.

What does that mean? I certainly think that the Mobility+ certificate is one worth keeping, but apparently CompTIA believes otherwise. Since it does not make logical sense to me, I can only believe that either too few people are taking the test to make it worthy of updating, or CompTIA is not earning enough revenue from Mobility+ sales to warrant it’s continued operation.

It could be that cellular technologies will be rolled into A+, Net+ and Sec+, negating the need for Mobility+, but I just renewed my Network+ and Linux+ certifications, and didn’t see any cellular references on the exam. They say that CompTIA certifications are led by the industry, and not the other way around. In a world that is becoming increasingly more mobile, I just can’t see getting rid of Mobility+.

Linux – keep it simple.

Does a mobile cell phone booster really work?

As may be evident by the name of the blog, as well as my username, I live in Alaska. Alaska is a really big state. Alaska also has relatively poor cell phone coverage, in my opinion. Often when driving around, I will loose signal, drop calls, or even have no connectivity, which can be a real problem if there were to be an emergency.

So, I decided to do something about it. I decided to buy a “mobile booster”. Of course, I was really concerned about gimmicky devices that actually wouldn’t help me, and I wanted to make sure that I was buying something worth having, without paying an arm and a leg for it. So, here is what I bought (no paybacks for me if you click on it, just a link showing what I bought) :

Car Mobile Booster 850/1900mhz Cellular Signal Repeater Cell Phone Amplifier For Truck,RV
by Protone Led
Link: https://www.amazon.com/gp/product/B06XCBQ87T/ref=oh_aui_detailpage_o01_s00?ie=UTF8&psc=1

Why did I choose this one? Well, there are many types out there, particularly of interest is what bands it supports. This model doesn’t help with LTE bands, but it does help with the 3g bands that are in use in my area. I figure that I need this to make phone calls or send texts, not to surf the web. Aside from that, it had good reviews and seemed to me that people who actually owned it thought that it helped their signal.

Of course, I wouldn’t be writing this post if I didn’t give it a good test, of which I did two.

The first test I tried to use it at my home, where there was already fair signal, to see if it would “boost” it up to great signal. I couldn’t tell the difference with the thing on or off. I decided that I needed a better test.

For my second test, I took the unit to my work. At my work is a steel enclosed room, like a Faraday cage, in which I receive almost no cellular signal. As you can see from the screen shots, while in that room, I have -118 dbm of signal. With the booster off, I tried a speed test, but it would not receive a return. I then tried a phone call, which told me I had no available network. Great! Perfect for my test.

Then I set up the booster by placing the receiving antenna outside of the room, with the cord pinched in the door weatherstripping to the inside. I hooked up the unit and broadcasting antenna inside, but didn’t plug it in. I tried several more tests to make sure that the antenna itself was not somehow a “conduit” from which my phone would receive signal. Nothing, still no usable signal.

Then I plugged the unit in.

Immediately my signal strength maxed, and SatStat showed -89 dbm of signal! I then proceeded to make a phone call: success! I was able to connect and talk to the weather station via phone. Great! I decided to get more information by running a speed test. I was able to pull 0.46 Mbps downloads, and 0.02 Mbps uploads. Latency was also pretty high, as the ping took 248 ms to complete the trip. However, compared to 0 connectivity before, I thought that was a bit of an improvement.

I also did several tests based on proximity of my cell phone to the inside repeater antenna. It didn’t seem to matter. I could walk around anywhere in the small room and still have signal. Signal would degrade a bit, however, when I put my cell phone into some of the server racks (that seems reasonable to me, though).

So, overall impression: it really does work! However, it seems best suited for a “near nothing” situation, rather than to boost signal to a decent connection. I guess now I’ll have to try it out on the road.

Linux – keep it simple.

Adding a wireless charger to my Galaxy Note Edge.

I have always been fascinated with wireless things. I keep waiting for the wireless, battery-less vacuum cleaner, too, but that is a story for another time. I really like my note edge, and I recently decided to do some upgrades, like a screen protector, a new battery, and now, a qi wireless charger.


Here’s what I bought: (Again, not a kickback add.)

IC ICLOVER Smart Phone Ultra Slim QI Wireless Charging Receiver Chip&Wireless Charging Pad For Samsung Galaxy Note Edge N9150-https://www.amazon.com/dp/B00S9IKNAC/ref=cm_sw_r_other_apap_mq4crIL8UNcSp

This kit allows you to install the wireless charging receiver into the back of your existing cell phone case, and for $15, came with the charging pad. It sounded to good to be true. So, I decided to be the lab ray for the rest of you and try it out. Bottom line, if you read no further in this post: buy it.


The qi receiver (literally “energy” receiver, which is what qi stands for) comes with a peel-and-stick strip that allows you to hook it up in about 30 seconds. A tip though: as you can see, I covered my Sim card with a piece of paper, so the qi wouldn’t stick to it, so I could remove my Sim card easier. I then added an extra piece of Scotch tape, to make sure it stayed in place. The connection for this charger was already there, just waiting to be used.


It’s hard to tell in the photo, but it does cause a slight “bulge” in the back of the case, but it is not noticeable when holding the phone.

Once the case is closed, plug in the base and simply set the phone on it to start charging. A green light tells you it is charging, a red light tells you there is power. You can place the phone on there sideways, upsidedown, etc, must make sure it is centered or the could will not line up and it will not charge.

Overall. It works great. Some statistics for the curious:

After several time tests, it averages a charge of 0.25% per minute, or 1% every 4 minutes. So it is not super fast. More of an all night charger.

100% = 400 minutes = 6 hours, 40 minutes.

It tends to get warm. After charging, it is consistently around 115 degrees Fahrenheit for both the phone and the base unit, measured with an infrared thermometer.

Just like with normal charging. My phone beeps to tell me it is charging when I set it on the base, and my LED light for charging comes on. So your phone thinks it is plugged in.

There really are only two downsides:

#1. You can’t really use the phone while charging it this way, as it needs to stay centered on the base.

#2. It charges so slowly, I suspect you could drain it faster than it could charge with heavy use.

But, for those times, you could always just use an old school cord. Overall, I think it is worth it for my nightstand, and I am thinking of getting a charging base for my desk at work.

Linux – keep it simple.

Battery trouble!

A friend of mine recently called me up with a battery problem. He had done some troubleshooting on his own, and already come to the right conclusion, but he wanted a second opinion.

His Galaxy S5 Active had a strange issue: if he unplugged his phone, it would reboot or die even though he had over 70% battery left. However, of he put his phone in power saving mode, it would work like it was supposed to. If the phone was plugged in, he could use it all day. So he figured that he needed a new battery, and he was right.

Lithium ion batteries have to meet a special safety standard, and from what I understand, that means that they have a special charging and discharging protection circuit. Here is a little except about it from http://batteryuniversity.com, where you can read all about it:

“Further layers of safeguards are solid-state switches that measure the current and voltage and disconnect the circuit if the values are too high. The protection circuits of Li-ion work on this on/off basis. (See BU-304b: Making Lithium-ion Safe.) All switching devices have a residual resistance that causes a slight increase in overall battery resistance and a subsequent voltage drop.”
In any event, of you have a cell phone battery that performs as normal, but once reaching a certain percentage above 0 it does suddenly or randomly reboots, then most likely this circuitry in the battery has failed. It is easy to think there may be another problem, say with the phone, because the battery still holds a charge. As for my friend, a new battery had him up and running in no time flat.

I recently purchased a new battery for my note edge, not because of this issue, but because the battery did not hold a charge for as long as I thought it should. Turns out I was correct. They say a cell phone battery is only good for 3 years, and that includes the time on the shelf before you started using it. It will last a long time, but performance will diminish over time.

Here what I bought (and no, this is not some sort of kickback add):

Samsung 3000mah Battery for Samsung Galaxy Note Edge – Non-Retail Packaging – https://www.amazon.com/dp/B00RYS9UIY/ref=cm_sw_r_other_apap_Yhn2fEg4qCmPC

It was only $12, and took about 3 minutes to replace because I stopped to take a picture (which takes a while when your usual camera is the phone you are working on). If you have had a phone for more than three years, I highly recommend a new battery. The difference was immediately noticeable!

Linux – keep it simple.

Note Edge Screen Protector

When it comes to screen protectors, I prefer glass. Recently, I decided that it was high time that I purchased one for my Galaxy note edge. Here’s what I bought (this is not one of those add kickback deals, just a link to what I bought):

Note Edge Screen Protector,ChYu@Full Coverage Premium Tempered Glass Film Protector for Samsung Galaxy Note Edge N9150  https://www.amazon.com/dp/B01DP4425G/ref=cm_sw_r_other_apa_YgzNybAKTJNPF

It works really well and looks great! But what I thought I would share was that it was a little harder to put on properly than other glass screen protectors that I have used in the past. Particularly the curved part for the “edge”. I kept getting it on there in such a fashion that the edge was not perfectly aligned, causing a small gap at the edge, which resulted in a ” clicking ” sound when I would press on it, as the glass would flex back to make good contact with the edge.

So, I’d you buy one, take my advice: start your application at the edge, and roll it onto the flat party of the device. That way your edge is aligned for the curved part of the screen and glass protector. Once I realized this, it went on in second and fit like a glove.


Here is a picture with it on my note edge, with a fresh install of RR nougat.

Linux – keep it simple.

BROM error s not enough memory 1012

What does that even mean? Well, if you are searching the internet for that message, then you are trying to use SPF flash tool to write something to your MediaTek phone. You probably were following a guide to the “T” – just like me. You are also considering things like using your phone as a hockey puck, or smashing your keyboard – just like me.

Fear not, however, after hours of searching, I found every OTHER SPF flash tool BROM error, EXCEPT this one. Until, finaly, there was this one guy, in some thread, somewhere who deserves a metal. His screen name is “hovatek” and he is being quoted by “Mcjona”. Here is the link:

https://forum.hovatek.com/thread-439-post-67395.html

And in this link, he explains what seems like hundreds of possible errors, including error #1012, to which he states:

[QUOTE]
Error 1012

Message: BROM ERROR: S_NOT_ENOUGH_MEMORY (1012)

Meaning: The version of SP flash tool you’re using doesn’t support the size(s) of the file(s) in the firmware / stock ROM.

Solution
* Use the latest version of SP flash tool
[/QUOTE]

So, I packed up my internet bags and surfed over to here:
http://spflashtool.com/

And downloaded the latest version. I love it when the solution is that simple. If only it didn’t take all day to get there….

Linux – keep it simple.

Porting Debian Linux to your cell phone part 3 of 3

If you are still with me, then you have already set up your phone to first boot Debian Linux, and then Linux will start Android in a chroot environment. Your phone is actually already running Debian Linux, just with Android being run and displayed on the screen. At any moment, you can actually stop or kill Android. At this point, you also have the power to mess Andriod up, so do be careful!

If you just tuned in, I recommend that you go back to the 1 of 3 for this post, as there is a lot of critical information you need.

Right now, you can SSH into your own Linux from the Android gui by using any ssh app to yourself as the local host, since our SSH deamon is running. What we want, though, is for your screen to display the Linux screen, instead of the Android that is running in a chroot environment.

A key part of all of this, is that Android, other than through services like SSH, does not know that Debian Linux exists and it does not have any control over the Linux system or functions. One problem with this is that Android may occaisionally crash due to memory problems, if your Linux environment is using too much RAM. Ironically, if you SSH into your Linux environment, you can use ps aux, or top to see all of Android’s running processes. Your Linux environment is now the ultimate root, because even Android doesn’t know it exists. You can log anything from Android and save it, you can stop any Android process. You have complete control over your Android system.

However, before making the “plunge” to a Linux only phone, you need a few details. The easiest way to get these is to do some research on your phone. Through SSH, run the ls command in your /dev folder, and look for “input”

[CODE]
$ cd /dev
$ ls |grep input

/dev/input
/dev/input/event7
/dev/input/event6
/dev/input/event5
/dev/input/event4
/dev/input/event3
/dev/input/event1
/dev/input/event0
/dev/input/event2
[/CODE]

On my Samsung Captivate Glide, these are all the available inputs. But what are they? Well, there are several tools to check this. The easiest way, however, is to SSH into Linux, start x11vnc in Linux, and use an app like bvncfree in Android to bring up a visual screen to work with. How you need to do this is a bit tough to describe, because it is so dependent upon your phone and setup. However, if you are using my files, the user trondroid should have a shell script in the home folder for starting jwm in this fashion.

Another way is to start the XserverXDSL app in Android, and then startx in Linux through SSH. That should get you to the same place.

Either way, you should see something similar to this (although this screenshot was taken when I was using Debian Squeeze, rather than the new files, which are Debian Jessie) :

phone

Once you have established a “visual” screen, you now should open up a terminal in your Linux screen. Remember, all input commands that you input right now are from the Android app you are using. That means the “mouse”, “click”, and “keyboard” are all virtual. You need to set up your real screen as a mouse, for motion and clicking. You also need to set up your physical buttons from your phone, and your keyboard if you have one. With your terminal open, use evtest, like so:

[CODE]
$ sudo evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: STMPE_keypad
/dev/input/event1: mpu-accel
/dev/input/event2: sec_key
/dev/input/event3: sec_touchscreen
/dev/input/event4: proximity_sensor
/dev/input/event5: light_sensor
/dev/input/event6: HALL
/dev/input/event7: sec_touchkey
/dev/input/event8: compass_sensor
[/CODE]

This even works on your home computer. For instance, here is my laptop:

[CODE]
$ sudo evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: Sleep Button
/dev/input/event1: Lid Switch
/dev/input/event2: Power Button
/dev/input/event3: AT Translated Set 2 keyboard
/dev/input/event4: Logitech USB Optical Mouse
/dev/input/event5: SynPS/2 Synaptics TouchPad
/dev/input/event6: Video Bus
/dev/input/event7: ST LIS3LV02DL Accelerometer
/dev/input/event8: HDA ATI SB Mic
/dev/input/event9: HDA ATI SB Line
/dev/input/event10: HDA ATI SB Headphone
/dev/input/event11: HP WMI hotkeys
Select the device event number [0-11]:
[/CODE]

But we will focus on the phone. Great! Now we know what event is what input! For instance, event3 is the touchscreen. Now we have something to work with. In my case, event0 is the physical keyboard, but those are rare these days.

You can also test those inputs, by choosing a number for the device, and then using that function. Here you can see me test the “menu key” on the keyboard:

[CODE]
Menu Key on keyboard
Event: time 25170.575766, type 4 (EV_MSC), code 4 (MSC_SCAN), value 8b
Event: time 25170.575844, type 1 (EV_KEY), code 139 (KEY_MENU), value 0
Event: time 25170.575854, ————– EV_SYN ————
[/CODE]

Another great tool is called xev, again, open up a terminal and use it like this:

[CODE]
$ xev

ButtonRelease event, serial 33, synthetic NO, window 0x1e00001,
root 0x26f, subw 0x0, time 156984900, (175,123), root:(228,195),
state 0x100, button 1, same_screen YES

MotionNotify event, serial 33, synthetic NO, window 0x1e00001,
root 0x26f, subw 0x0, time 156985076, (177,123), root:(230,195),
state 0x0, is_hint 0, same_screen YES
[/CODE]

There is also xinput, here is an output from my computer:

[CODE]
$ xinput test-xi2
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Logitech USB Optical Mouse id=9 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=11 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Sleep Button id=8 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=10 [slave keyboard (3)]
↳ HP WMI hotkeys id=12 [slave keyboard (3)]
EVENT type 13 (RawKeyPress)
device: 3 (10)
detail: 54
valuators:

cEVENT type 14 (RawKeyRelease)
device: 3 (10)
detail: 54
valuators:

EVENT type 13 (RawKeyPress)
device: 3 (10)
detail: 40
valuators:
[/CODE]

The overall idea, though, is that you need to open up an x session, so you can then see what x inputs are matched to which event. Once you have all of this information, you can edit the /etc/X11/xorg.conf file to match. Here is the one I made for the Samsung Captivate Glide:

[CODE]
Section “ServerLayout”
Identifier “Layout0”
Screen “Screen0”
InputDevice “touchscreen” “CorePointer”
InputDevice “keyboard”
InputDevice “mediakeys”
InputDevice “frontkeys”
EndSection

Section “Monitor”
Identifier “Monitor0”
ModelName “Monitor Model”
DisplaySize 800 480
EndSection

Section “InputDevice”
Identifier “touchscreen”
Driver “evdrv”
Option “Device” “/dev/input/event3”
Driver “multitouch”
EndSection

Section “InputDevice”
Identifier “keyboard”
Driver “evdev”
Option “Device” “/dev/input/event0”
Option “CoreKeyboard”
Option “XkbRules” “xorg”
Option “XkbModel” “pc105”
Option “XkbLayout” “us”
EndSection

Section “InputDevice”
Identifier “keyboard”
Driver “evdev”
Option “Device” “/dev/input/event8”
Option “XkbRules” “xorg”
Option “XkbModel” “pc105”
Option “XkbLayout” “us”
EndSection

Section “InputDevice”
Identifier “mediakeys”
Driver “evdev”
Option “Device” “/dev/input/event2”
EndSection

Section “InputDevice”
Identifier “frontkeys”
Driver “evdev”
Option “Device” “/dev/input/event7”
EndSection

Section “Device”
Identifier “Card0”
Driver “fbdev”
Option “fbdev” “/dev/graphics/fb0”
Option “Rotate” “left”
Option “VertRefresh” “60”
EndSection

Section “Screen”
Identifier “Screen0”
Device “Card0”
DefaultDepth 16
SubSection “Display”
Depth 16
EndSubSection
EndSection
[/CODE]

Notice how you must declare a screen, a monitor, and then the card that controls it. /dev/graphics/fb0 is the framebuffer that you got the other day, if you were following along with these posts. You will also notice, that for each section, a driver is declared. The drivers used here are generic drivers. You may have different hardware, and use different drivers. So, if one doesn’t work, google the xorg.conf section and the word drivers to see some of the different drivers available. You may even need proprietary drivers specific for your device. Like I said though, these generic drivers worked great for me. So I would try those first.

Once you have your drivers and xorg.conf file all set, it is time to take the plung. Be sure to back up your system first. Remember, TWRP or CWM are your freinds, as they work outside of all of the other work you are doing. So you can always start over or go back to something else.

Now, go back to your /etc/rc.local file. It should say:

[CODE]
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will “exit 0” on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Start the ssh client, in the event you need it.
/etc/init.d/hostname.sh start
/etc/init.d/ssh start

# Clean up bad crash before starting x server.
# /sbin/busybox mkdir -p /tmp/.X11-unix/remove
# /sbin/busybox rmdir /tmp/.X11-unix/remove
# /sbin/busybox rmdir /tmp/.X11-unix/

# Start the x server, warning, if the touchscreen or keypad doesn’t work
# then you cannot escape without killing power!
#/usr/bin/startx &
#export USER=root
#vncserver :5000

exit 0
[/CODE]

And change the last part to say this:

[CODE]
# Start the x server, warning, if the touchscreen or keypad doesn’t work
# then you cannot escape without killing power!
/usr/bin/startx &
#export USER=root
#vncserver :5000

exit 0
[/CODE]

Now you have told it to startx on the next startup. If all goes well, reboot your phone, and you should see the XFCE desktop. If not, then you need to figure out how to edit the xorg.conf file to make it work right. You may also need to uncomment the lines about rmdir /tmp/.X11-unix, and the other lines like it, if your xserver ever crashes.

I have noticed several variants, especially on Android 4.4 and newer, that it will startx, but also start Android. You will see one normally, and then a small, pink version of the other overlayed on part of the screen. Almost like a picture in picture TV, but very dificult to understand or use. In these cases, you may need to add a command to kill surfaceflinger, or stop zygote to get Android to “clear out”. You actually could just skip Android altogether, but having the chrooted Android is great for playing with making phone calls, etc, as I do not know how to do that from Linux yet.

If you made this work then you do have some pretty good Linux skills, if I may be so bold. This is not an easy task, and not for the faint of heart. So great job! Now it is up to you to improve upon this and make it useful. Who knows, you might be giving Ubuntu Touch a run for the money!

Linux – keep it simple.