[ROM]Samsung S3 Intl Sailfishos - Galaxy S III Original Android Development

Hi there!
Following the hadk pdf from jolla porting guide.
I've got the sailfishos working on terminal android running. Booting on top attempting since monday tonight.
I'll explain more and I'll give more shots on working.
My issue now is to build the boot, recovery image to flash and boot it. The jolla sailfishos as a GUI operating system on Galaxy S3 I9300 model.
FIY : filename = sfa-i9300-ea-1.0.8.19-my1.tar.bz2
Instructions for chroot co,pilation on ubuntu amd64 x86_64 bit:
Code:
sudo mkdir -p /srv/mer/
mkdir -p $HOME/mer/
nano .bashrc
export $MER_ROOT=/srv/mer/
export $MER_ROOT=$HOME/mer/
ctrl +x to save and y
but type sudo apt-get install -y curl
for do the downloading file.
next do the following commands on terminal:
export $MER_ROOT=/srv/mer/
cd $HOME; curl -k -O https://img.merproject.org/images/mer-sdk/mer-i486-latest-sdk-rolling-chroot-armv7hl-sb2.tar.bz2 ;
sudo mkdir -p $MER_ROOT/sdks/sdk ;
cd $MER_ROOT/sdks/sdk ;
sudo tar --numeric-owner -p -xjf $HOME/mer-i486-latest-sdk-rolling-chroot-armv7hl-sb2.tar.bz2 ;
echo "export MER_ROOT=$MER_ROOT" >> ~/.bashrc
echo 'alias sdk=$MER_ROOT/sdks/sdk/mer-sdk-chroot' >> ~/.bashrc ; exec bash ;
echo 'PS1="MerSDK $PS1"' >> ~/.mersdk.profile ;
sdk
Now, do the following instructions:
$HOST>
nano $HOME/.hadk.env
export MER_ROOT="[/home/$user]"
export ANDROID_ROOT="$MER_ROOT/android/droid"
export VENDOR="[samsung]"
export DEVICE="[i9300]"
ctrl +x and y for save it.
nano $HOME/.mersdkubu.profile
function hadk() { source $HOME/.hadk.env${1:+.$1}; echo "Env setup for $DEVICE"; }
export PS1="HABUILD_SDK [\${DEVICE}] $PS1"
hadk
save it again
nano $HOME/.mersdk.profile
function hadk() { source $HOME/.hadk.env${1:+.$1}; echo "Env setup for $DEVICE"; }
hadk
now save this file.
Now in ctrl + alt + x, it will show a terminal:
type this:
sdk
type your password
hadk
TARBALL=ubuntu-quantal-android-rootfs.tar.bz2
curl -O http://img.merproject.org/images/mer-hybris/ubu/$TARBALL
UBUNTU_CHROOT=/parentroot/$MER_ROOT/sdks/ubuntu
sudo mkdir -p $UBUNTU_CHROOT
sudo tar --numeric-owner -xvjf $TARBALL -C $UBUNTU_CHROOT
hadk
ubu-chroot -r /parentroot/$MER_ROOT/sdks/ubuntu
exit
git config --global user.name "Your Name"
git config --global user.email "Your email"
back again for
hadk
cd $HOME
mkdir -p $HOME/mer/android/droid
repo init -u git://github.com/mer-hybris/android.git -b hybris-10.1
repo sync
after this, you will have HABUILD_SDK
DEVICE=i9300
export $DEVICE
source build/envsetup.sh
breakfast $DEVICE
now type
make hybris-hal
But now as a ota file for flashing on i9300, in this last 2 days in my laptop core2Duo Extreme I'm facing overheating.
So, everyone can test it.
Code:
A little change on mount fixups.
Go to the directory hybris/hybris-boot
nano mount-fixups on i9305| encore)
put the "i9305" | "encore" | "i9300")
Script for booting sailfishingos on an android terminal. This script is to mount the binds folders and for fixing for preventing the /dev/null issue when we all boot the chroot sailfishos.
name of the script : sailfishos.sh - made it on the /extsdCard/ folder.
1) nano /extSdCard/sailfishos.sh and copy the following code
2) ctrl +x to save it
3) bash sailfishos.sh
Code:
su
mount -o bind /dev /data/.stowaways/sailfishos/dev
mount -o bind /proc /data/.stowaways/sailfishos/proc
mount -o bind /sys/ /data/.stowaways/sailfishos/sys
chroot /data/.stowaways/sailfishos/ /bin/su -
echo "nameserver 8.8.8.8" > /etc/resolv.conf
Code:
Procedures:
1) get cm 10.1 flash it.
2) recovery mode to flash it.
3) download my sailfish i9300 tar.bz2 from d-h.st
4) Copy it for your /extSdCard
Code:
Procedures inside adb:
1) sudo adb kill-server
2) sudo adb start-server
3) adb devices
4) adb shell
5) su
6) cd /extSdCard/
8) mkdir -p /data/.stowaways/sailfishos
8) tar --numeric-owner -xvf filename -C /data/.stowaways/sailfishos
9) mount -o bind /dev /data/.stowaways/sailfishos/dev
10) mount -o bind /proc /data/.stowaways/sailfishos/proc
11) mount -o bind /sys /data/.stowaways/sailfishos/sys
finally:
chroot /data/.stawaways/sailfishos/ /bin/su-
you'll see sailfish os version something 15
try this on it:
cd /
ls
[LINK] http://d-h.st/gX5 [/LINK]
See folders on it.
PS: I'll give more shots also more instructions very soon. Thanx.
Another PS: I'll give more news about Jolla sailfish os very soon.
But I need to tell this, I've got i9300 defconfig kernel for Jolla sailfishos very similar to defconfig i9305 kernel and I got it compiled with very success on hadk Ubuntu chroot on mine Ubuntu 14.04 LTS version.

astronfestmon said:
Hi there!
Following the hadk pdf from jolla porting guide.
I've got the sailfishos working on terminal android running. Booting on top attemptinh since yesterday tonight.
Code:
Procedures:
1) get cm 10.1 flash it.
2) recovery mode to flash it.
3) download my sailfish i9300 tar.bz2 from d-h.st
4) Copy it for your /extSdCard
Code:
Procedures inside adb:
1) sudo adb kill-server
2) sudo adb start-server
3) adb devices
4) adb shell
5) su
6) cd /extSdCard/
8) mkdir -p /data/.stowaways/sailfishos
8) tar --numeric-owner -xvf filename -C /data/.stowaways/sailfishos
9) mount -o bind /dev /data/.stowaways/sailfishos/dev
10) mount -o bind /proc /data/.stowaways/sailfishos/proc
11) mount -o bind /sys /data/.stowaways/sailfishos/sys
finally:
chroot /data/.stawaways/sailfishos/ /bin/su-
you'll see sailfish os version something 15
try this on it:
cd /
ls
[LINK] http://d-h.st/gX5 [/LINK]
sees folders on it.
Click to expand...
Click to collapse
Screenshots?
Sent from my SM-G900F using XDA Free mobile app

Fantastic... I'll give a try. Plz provide some more details, screenshots & new features from your currently running sailfish os. Thanx for sharing

i fed with adb commands & not able to flash

Uhm ... I gonna wait for this ...
Sent from my SM-G900F using XDA Free mobile app

how to install ?

When I had the rom for flashing in recovery. I'll explain it.
For now, it can be installed through the adb, to work it inside the android terminal.

astronfestmon said:
When I had the rom for flashing in recovery. I'll explain it.
For now, it can be installed through the adb, to work it inside the android terminal.
Click to expand...
Click to collapse
any update on this?
I followed the above procedure and I can see the Sailfish version and the files list from adb. What next?
EDIT: Just saw your PS in OP

In the end of the week probably I'll release the boot kernel working on.

astronfestmon said:
In the end of the week probably I'll release the boot kernel working on.
Click to expand...
Click to collapse
I've successfully built boot and recovery images, packed the zip for flashing in recovery but there is a problem with the boot.img.
I'm trying to find out why it doesn't boot (the phone stays at the galaxy logo)
The actual guide for porting misses some stuff and there are errors here and there. Besides, there is a problem with the trusty chroot, quantal is working.

Aye. I've notice that.
I'm fixing some issues in quantal chroot.
E.g. inside the sources.list I add the 12.04 lts mirrors. Made by a website with the sources.list for 12.04 lts mirrors.
Yeah. I've done the boot kernel image and it made the same as you.
But with meld diff I've compared the i9305 defconfig with mine i9300 defconfig.
I'm going to test it with the changes meld diff made with a comparison with i9305 defconfig.
Now I made a make systemtarball and I'll try a make bootimage or a make factory_image for it.

astronfestmon said:
Aye. I've notice that.
I'm fixing some issues in quantal chroot.
E.g. inside the sources.list I add the 12.04 lts mirrors. Made by a website with the sources.list for 12.04 lts mirrors.
Yeah. I've done the boot kernel image and it made the same as you.
But with meld diff I've compared the i9305 defconfig with mine i9300 defconfig.
I'm going to test it with the changes meld diff made with a comparison with i9305 defconfig.
Now I made a make systemtarball and I'll try a make bootimage or a make factory_image for it.
Click to expand...
Click to collapse
It would be great if you could make it to boot.
I will try to compile the kernel with CONFIG_CMDLINE="console=tty0" . I'm hoping that would direct kernel panic message to the screen so we could idenfity what the problem is with booting hybris-boot.img

So... Any development?
Sent from my Nexus 5 using XDA Premium 4 mobile app

Hi! All of you! I'm doing efforts between these days. In these vacation days. I'll report more when I got home back.

astronfestmon said:
Hi! All of you! I'm doing efforts between these days. In these vacation days. I'll report more when I got home back.
Click to expand...
Click to collapse
Hi, I've also been trying to port sailfish os to i9300. I've been successful in creating an image that works, i.e. got it to boot into sailfish but there are some issues that I haven't been able to fix, like for instances, the wlan is detected but fails to establish a connection with any network, GSM is also not working. A full list with details can be found here https://wiki.merproject.org/wiki/Adaptations/libhybris
Maybe we should try to work together to get a fully functional sailfish os image
Cheers
---------- Post added 19th August 2014 at 12:01 AM ---------- Previous post was 18th August 2014 at 11:12 PM ----------
redrum781 said:
I've successfully built boot and recovery images, packed the zip for flashing in recovery but there is a problem with the boot.img.
I'm trying to find out why it doesn't boot (the phone stays at the galaxy logo)
The actual guide for porting misses some stuff and there are errors here and there. Besides, there is a problem with the trusty chroot, quantal is working.
Click to expand...
Click to collapse
The phone may be stuck at the galaxy logo, but there's a way to debug to find out what's wrong, follow this steps (only tested on linux):
1) connect your phone with the computer, the initramfs in boot.img will create a network interface (phone's ip is: 192.168.2.15) and enable a telnet deamon (default port: 23) and also a udhcp server, so luckily the computer will ask for an ip that everything will be set up automatically. If not try configuring static ip (192.168.2.20 and adding a route to 192.168.2.0)
2) telnet 192.168.2.15
3) when you're in the telnet session, you can check /diagnostic.log (i think) it will show why the boot failed. It is possible to execute commands into the init, by writing to (/init-ctl/stdin)
When logged into the telnet session it will dump a bit of information, be sure to read it as is useful .
Also check HADK 9.2 Operating Blind on an Existing Device
PS: the files may contain mistakes as I wrote this post without checking for the correct names (I don't have sailfish flashed at the moment).
Also consider visiting the IRC channel (#sailfishos-porters), if you're not doing it already
Hope it helps

rusty88 said:
Hi, I've also been trying to port sailfish os to i9300. I've been successful in creating an image that works, i.e. got it to boot into sailfish but there are some issues that I haven't been able to fix, like for instances, the wlan is detected but fails to establish a connection with any network, GSM is also not working. A full list with details can be found here https://wiki.merproject.org/wiki/Adaptations/libhybris
Maybe we should try to work together to get a fully functional sailfish os image
Cheers
---------- Post added 19th August 2014 at 12:01 AM ---------- Previous post was 18th August 2014 at 11:12 PM ----------
The phone may be stuck at the galaxy logo, but there's a way to debug to find out what's wrong, follow this steps (only tested on linux):
1) connect your phone with the computer, the initramfs in boot.img will create a network interface (phone's ip is: 192.168.2.15) and enable a telnet deamon (default port: 23) and also a udhcp server, so luckily the computer will ask for an ip that everything will be set up automatically. If not try configuring static ip (192.168.2.20 and adding a route to 192.168.2.0)
2) telnet 192.168.2.15
3) when you're in the telnet session, you can check /diagnostic.log (i think) it will show why the boot failed. It is possible to execute commands into the init, by writing to (/init-ctl/stdin)
When logged into the telnet session it will dump a bit of information, be sure to read it as is useful .
Also check HADK 9.2 Operating Blind on an Existing Device
PS: the files may contain mistakes as I wrote this post without checking for the correct names (I don't have sailfish flashed at the moment).
Also consider visiting the IRC channel (#sailfishos-porters), if you're not doing it already
Hope it helps
Click to expand...
Click to collapse
Will this os improve our device? Whats the pro and the con for a change (if it works finaly)?[emoji4]

MaxAndroided said:
Will this os improve our device? Whats the pro and the con for a change (if it works finaly)?[emoji4]
Click to expand...
Click to collapse
well maxAndroided all I can say at the moment is that the OS looks very promising... the UI is very smooth. Is another approach to mobile interaction based on gestures. I'm really loving it, sadly I can used it for day to day activities yet.
The jolla phone at the moment is able to run android apps and hopefully soon that will be available for any image built for android phones. So what that means is that if you don't find a suitable native app for sailfish os, you can always run your favorite android app in sailfish os
Anyone that wants to help bring sailfish os to i9300 is welcome to help, so if you have any idea on how to debug and fix the issues let me know
PS: if any one would like to try it, take a look at my previous post here

rusty88 said:
well maxAndroided all I can say at the moment is that the OS looks very promising... the UI is very smooth. Is another approach to mobile interaction based on gestures. I'm really loving it, sadly I can used it for day to day activities yet.
The jolla phone at the moment is able to run android apps and hopefully soon that will be available for any image built for android phones. So what that means is that if you don't find a suitable native app for sailfish os, you can always run your favorite android app in sailfish os
Anyone that wants to help bring sailfish os to i9300 is welcome to help, so if you have any idea on how to debug and fix the issues let me know
PS: if any one would like to try it, take a look at my previous post here
Click to expand...
Click to collapse
@rusty88, I am no developer/expert, but is there any way we can try and use I9300 native libraries or binaries to make GSM (or some other functionality for that matter) work? maybe RIL libs/binaries for GSM?

msri3here said:
@rusty88, I am no developer/expert, but is there any way we can try and use I9300 native libraries or binaries to make GSM (or some other functionality for that matter) work? maybe RIL libs/binaries for GSM?
Click to expand...
Click to collapse
yes @msri3here technically that is what i'm doing, its using RIL lib based on cm10.1.3 that was working fine before I flash sailfish, but on sailfish the log that RIL daemon dumps is really a mess and haven't figure out why is failing. One thing that I've notice is that RILD (one of its child process) creates the socket at /dev/socket/rild but it's killed afterwards, the sockets disappear and the process restarts all over again
Stracing RILD is not helping either as it seems that everything is Ok.
I'm trying to buy a new smartphone for day to day use so I can dedicate more time to debug on my i9300.

rusty88 said:
well maxAndroided all I can say at the moment is that the OS looks very promising... the UI is very smooth. Is another approach to mobile interaction based on gestures. I'm really loving it, sadly I can used it for day to day activities yet.
The jolla phone at the moment is able to run android apps and hopefully soon that will be available for any image built for android phones. So what that means is that if you don't find a suitable native app for sailfish os, you can always run your favorite android app in sailfish os
Anyone that wants to help bring sailfish os to i9300 is welcome to help, so if you have any idea on how to debug and fix the issues let me know
PS: if any one would like to try it, take a look at my previous post here
Click to expand...
Click to collapse
tried your rom but stuck on "samsung galaxy s 3 gt-i9300" screen nothing is happening plus if i touch the screen i get a response from the capacitive buttons but thats all

Related

[TOOLS] [LINUX, MAC, WINDOWS] Knives & Forks - v. 12.02.04

Knives & Forks
WHAT IS IT?
Knives & Forks is a set of Android tools for everyone. Every operating system, every device.
This cross-platform Android toolkit, written in Python, that is designed to work in Linux, Mac OS X or Windows. I wanted to create something that was unique, and offered a consistent and feature-filled set of tools for Android devs no matter what operating system they use, and for as many Android devices as possible.
WHAT DOES IT DO?
I just started work on this project, so it doesn't do very much yet. Right now we are just focusing on getting drivers and adb installed for as many devices as we can on all three platforms. Once we have adb working for everyone, the real fun can begin as we start to add more device tools that will make use of adb, such as rooting. Eventually ROM customization tools will be added, but we are focusing on device tools and cross-platform compatibility at this time.
View the changelog to see a list of included drivers. The only device that I can confirm is compatible with this script in Linux, Mac OS X, and Windows is the Samsung Galaxy S II, Sprint Epic 4G Touch. This just so happens to be my personal phone, but as I gather feedback I will create an official list of supported devices.
WHERE DO I GET IT?
This project is now being hosted by the Android Creative Syndicate. An up to date link to the most current version of the script, installation instructions for Linux, Max OS , and Windows, and other information can be found HERE. Registration is not required at the ACS forum to download or view installation instructions. You are free to reply in the thread you are reading right now if you don't want to register for another forum.
I HAVE IT INSTALLED, NOW WHAT?
You should be able to open up your terminal application (or command prompt) and run some adb commands. In the future we will be automating adb commands for you, but for now you can try the following as a simple test:
Code:
adb reboot
If everything worked, your Android device should reboot. For further reading on what you can do with adb you can read THIS PAGE.
HOW TO SUPPORT THIS PROJECT
FEEDBACK
Download my script, test it, let me know what happens. Let me know what other features/tools I should add.
THANKS
Hit the thanks button if you like what I'm doing here.
DONATIONS - I don't currently have a link to send me money, but I could quickly set something up if somebody decides they want to help me feed my kid. I am recently unemployed, but I am not relying on my scripting skills to feed my family. Save your cash for a more worthy project, or tuck it away and wait until the project turns into something amazing.
INFORMATION
TELL ME ABOUT YOUR ANDROID DEVICES!
If my script isn't getting adb setup for your device, let me know where to download the correct Windows driver and/or what udev rules I need to add in Linux.
The next phase of this project will be automating the rooting process. If you know the process for rooting your device, please share the details.
HOW TO REPLY TO THIS THREAD
Please do not reply by saying something like "This looks awesome, I'm going to download it now!".
Just download it, test it out, and then tell me about it.
If my script works for you, please don't post something like "It worked for me, this is the best thing since sliced bread!".
At the moment all my script will do is install adb and drivers for your device. In order to test please uninstall any drivers you may have already installed, run my script, then reply with the following information:
Operating System (including version and 32-bit or 64-bit architecture)
Android Device
If you open up a terminal/command prompt window and enter the following command, does your device reboot? If not, do you receive any error messages (while running that command or at any phase of running the Kinves & Forks script)?
Code:
adb reboot
CHANGELOG
Code:
------------------------------------------------------------------------------------
Knives & Forks: Changelog
------------------------------------------------------------------------------------
The most current version is available for download from:
http://knivesandforks.info/releases/knives-and-forks-current.php
**** 12.02.04 ****
http://knivesandforks.info/releases/knives-and-forks-12.02.04.php
- LINUX CHANGES:
-- "python2" is now called by "Knives-and-Forks-Linux.sh" instead of "python" on Arch.
- This prevents starting the script with Python 3, which results in errors.
-- Changes to "scripts/linux/install-adb-linux.sh":
- "su" will be used if "sudo" is not installed, or user doesn't have permissions to use it.
- Added 32-bit libs for more 64-bit distros:
- Arch (new in this release)
- CentOS (new in this release)
- Debian
- Fedora (new in this release)
- Ubuntu, Kubuntu, Xubuntu
- Added Debian version of '/etc/udev/rules.d/99-android.rules'
- Added '/lib/udev/rules.d/92-permissions.rules' for Debian.
This should fix permissions, allowing adb to run without sudo or su.
- WINDOWS CHANGES:
-- Fixed a couple of missing quotes which were breaking things under Windows XP
- "%userprofile%" was coming back as "c:\documents" instead of "c:\documents and settings\username" in a couple of places
-- "c:\python27" is now the only directory where we look for python.exe
- It is faster to download and install Python to "c:\Python27" than it is to search for it elsewhere.
- This will also prevent issues where Python 3 was installed instead of Python 2, since the script currently gives errors under Python 3.
-- Updated amd64 and x86 versions of setx.exe for updating system PATH on XP/VISTA/7
-- PATH is updated with adb.exe location after Python is installed.
-- The computer will now reboot after updating the PATH, to make sure it will be updated before running the main program.
**** 12.01.27 ****
http://knivesandforks.info/releases/knives-and-forks-12.01.27.php
- GENERAL CHANGES:
-- After adb is installed, adb will reset the android device by running "adb reboot" instead of displaying a list of attached devices with "adb devices".
adb was occasionally reporting no devices were attached, when they infact were. When this happened "adb reboot" still worked, so it is a better test to see if adb is setup properly.
-- Friendlier messages during adb install and testing
-- Added a startup check to make sure the script is running from the correct directory
-- Removed empty Project directory, as it is not being used yet.
- LINUX CHANGES:
-- Added support for "lxterminal" and "urxvt" in "Knifes-and-Forks-Linux.sh"
-- Changed idVendors for Linux udev rules to lowercase instead of uppercase.
- WINDOWS CHANGES:
-- Startup script searches for python in "C:\Program Files (x86)" then "C:\Program Files" and "c:\" last.
-- Drivers should now install even if the language is not English
-- Added drivers for Casio C771 G'zOne Commando
-- Added LG drivers
-- Replaced setx.exe
**** 12.01.25 ****
http://knivesandforks.info/releases/knives-and-forks-12.01.25.php
- Replaced "Knives-and-Forks-Mac.sh" with "Knives-and-Forks-Mac.app".
Starting the script on a Mac should now be as simple as double-clicking the new .app file.
**** 12.01.24 ****
http://knivesandforks.info/releases/knives-and-forks-12.01.24.php
- Fixed a typo which caused the script to crash when viewing the credits screen.
- Smarter python fix for Windows users.
-- "C:\" and all sub-directories are searched for python.exe.
-- If python is not not found, it will be downloaded from python.org and installed to c:\python27.
-- If python is found (in "C:\python27", "c:\python", "c:\xyz123", "c:\program files\python27" or in any directory with any name anywhere on drive c:) the main menu script will launch.
- Added changelog.txt to the release .zip file.
**** 12.01.23 ****
http://knivesandforks.info/releases/knives-and-forks-12.01.23.php
- Minor update to fix Python installation for Windows users, which was causing the script not to launch.
**** 12.01.22 ****
(FIRST PUBLIC RELEASE)
http://knivesandforks.info/releases/knives-and-forks-12.01.22.php
- Added option to install adb & fastboot for Linux, Windows, Mac
- Added Linux drivers for:
-- ACER
-- ASUS
-- DELL
-- FOXCONN
-- GARMIN-ASUS
-- Google
-- Hisense
-- HTC
-- HUAWEI
-- K-TOUCH
-- KT Tech
-- KYOCERA
-- LENEVO
-- LG
-- MOTOROLA
-- NEC
-- NOOK
-- NVIDIA
-- OTGV
-- PANTECH
-- PEGATRON
-- PHILIPS
-- PMC-SIERRA
-- QUALCOMM
-- SK TELESYS
-- SAMSUNG
-- SHARP
-- SONY ERICSSON
-- TOSHIBA
-- ZTE
- Added Mac drivers for:
-- Nothing. According to Google, "It just works." Let me know if they are right.
- Added a custom Windows installer with drivers for:
-- GOOGLE
-- HTC
-- HUAWEI
-- SAMSUNG
WHERE DID THE OLD POSTS GO?
In an attempt to reduce unnecessary clutter in my original thread, I created supporting threads in each Android device forum. The whole reason behind posting so many times was to keep certain information in the Chef Central post, and certain information out of it in an effort to reduce clutter. Who wants to read through 50 pages of how this, that, and the other thing is or isn't working on devices that you don't own? That system appeared to work very well, but apparently I broke the rules by posting in every Android device forum.
Learn from my mistakes, don't post similarly worded posts all over the place!
ATTENTION PYTHON PROGRAMMERS:
Any idea on what I can do to make the Python files work in Python 2 and Python 3? I have only tested in Python 2.7.2, but I have received reports that Python 3 gives errors. I'm not really doing anything all that fancy, so I'm not sure if something is just a matter or new syntax or something else needs to be imported or what. Any help would be appreciated.
The next release will call "python2" for Arch Linux users since "python" will use python 3.
ATTENTION LINUX USERS:
I am currently testing my Knives & Forks script in some virtual machines using VirtualBox, as well as my local Xubuntu installation.
For distro specific things (installing 32-bit libs, udev changes, etc) in the next release I will be detecting the distro using the following code:
Code:
echo " -- DETECTING LINUX DISTRO --"
if [ "`cat /etc/issue | grep Arch | wc -l`" == "1" ]; then
DISTRO_NAME="Arch"
elif [ "`cat /etc/issue | grep Cent | wc -l`" == "1" ]; then
DISTRO_NAME="CentOS"
elif [ "`cat /etc/issue | grep Debian | wc -l`" == "1" ]; then
DISTRO_NAME="Debian"
elif [ "`cat /etc/issue | grep Fedora | wc -l`" == "1" ]; then
DISTRO_NAME="Fedora"
elif [ "`cat /etc/issue | grep Ubuntu | wc -l`" == "1" ]; then
# DETECTS UBUNTU, KUBUNTU, XUBUNTU, ETC
DISTRO_NAME="Ubuntu"
else
DISTRO_NAME="UNKNOWN"
fi
echo " - $DISTRO_NAME"
Please let me know what other distros your using and if you are able to find the name using the "/etc/issue" method I am using in the above if statements.
I wrote a bash function to check if sudo is installed, and then to see if the current user has permissions to use sudo. If sudo is not installed, or if the current user does not have permission to use it, su will be used instead. This will be included in my next update, but I wanted to post it here first:
Code:
echo " -- CHECKING TO SEE IF 'SUDO' IS INSTALLED --"
CURRENT_USER=$USER
USE_SUDO="NO"
if [ -f "/usr/bin/sudo" ]; then
echo " - 'sudo' is installed."
echo ""
echo " -- CHECKING FOR PERMISSION TO USE 'SUDO' --"
echo ""
echo " If prompted, enter the password for the user '$CURRENT_USER'."
echo ""
if [ "$(sudo whoami)" != "root" ]; then
echo ""
echo " - Sorry, '$CURRENT_USER' does not have permission to use 'sudo'."
echo " - 'su' will be uses instead of 'sudo'."
echo ""
else
echo " - '$CURRENT_USER' has permission to use 'sudo'."
USE_SUDO="YES"
echo ""
fi
else
echo " - 'sudo' is not installed."
echo " - 'su' will be used instead of 'sudo'."
echo ""
fi
DO_SU()
{
echo ""
if [ $USE_SUDO == "YES" ]; then
# echo " -- USING 'SUDO' TO RUN '$1' --"
echo ""
echo " If prompted, enter the password for the user '$CURRENT_USER'."
echo ""
sudo $1
else
# echo " -- USING 'SU' TO RUN '$1' --"
echo ""
echo " If prompted, enter the password for the user 'root'."
echo ""
su -c "$1"
fi
echo ""
}
# EXAMPLE USAGE OF THE DO_SU() FUNCTION:
# NOTE THAT THE COMMAND TO RUN WITH SU OR SUDO HAS TO BE IN QUOTES
DO_SU "whoami"
I also found out why debian users were being forced to use sudo or su in order to use adb. The next release will include this fix, but for those who might be interested in making this change manually:
Open "/lib/udev/rules.d/91-permissions.rules" as root (su or sudo) in your favorite text editor and find this line
Code:
usbfs-like devices SUBSYSTEM==”usb”, ENV{DEVTYPE}==”usb_device”, \ MODE=”0664″
Change MODE to "0666"
Code:
usbfs-like devices SUBSYSTEM==”usb”, ENV{DEVTYPE}==”usb_device”, \ [B]MODE=”0666“[/B]
Instead of replacing or modifying your "/lib/udev/rules.d/91-permissions.rules" file, the next version of my script will actually create a "/lib/udev/rules.d/92-permissions.rules" for Debian users that contains only the following:
Code:
# usbfs-like devices
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \
MODE="0666"
This file will load right after the 91-permissions.rules and replace just the usbfs-like devices settings. I'm just doing this with my script so I don't accidently break anything on your system. If you are making the changes manually, editing the 91-permissions.rules file should be all you need to do.
Save your changes and then restart udev as root (using sudo or su)
Code:
/etc/init.d/udev restart
-- or --
Code:
service udev restart
This assumes of course that you already have a working udev rule for your android device, and that adb is working only with su or sudo currently. Once this change is made you should be able to use adb without being forced to use su or sudo.
First post updated with latest release, version 12.02.04.
Lots of changes for XP and various Linux distros. See changelog for more information, but things should work better in Arch, CentOS, Debian, Fedora, and Ubuntu (including Kubuntu, Xubuntu, etc).
Hi, I just downloaded the latest file (12.02.04) but it's only 4 KB.
Could you check please?
Thank you!
Trying to unzip the file in Ubuntu 11.10 and this what I get:
Archive: knives-and-forks-12.02.04.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of knives-and-forks-12.02.04.zip or
knives-and-forks-12.02.04.zip.zip, and cannot find knives-and-forks-12.02.04.zip.ZIP, period.
Any help?
I had a typo in the .zip filename, so if you tried to download the file yesterday you basically just downloaded an error message that the .php counter script gave when it couldn't find the file. I will have to take a look at that later because it is supposed to display the message not make you download it.
The problem is now fixed, sorry about that.
Thanks for update.
Downloaded and installed.
Now I can adb from linux.
Have one more question. I hope you can help me with that as well.
I don't see my device (E4GT) as external hard drive or USB drive when debuging is on to copy files to it.
When debuging is off it shows 2 Android devices but when I click on them I'm getting this message:
Error initializing camera: -60: Could not lock the device
Any ideas?
My guess is maybe they didn't get unmounted properly that last time you had it plugged in, but I have no idea why you would get an error message about the camera. I have not seen that one.
Try installing Dropbox and backing up anything important, then formatting the sdcard and try mounting again.
Maybe somebody else has had that error and has a better idea,
I'll try to format sd card tonight when I get home.
But what would be the problem with internal storage?
And what should or could I try to proper mount it?
agat63 said:
I'll try to format sd card tonight when I get home.
But what would be the problem with internal storage?
And what should or could I try to proper mount it?
Click to expand...
Click to collapse
First thing to check is that it isn't ROM related. Boot into recovery and try to mount as a usb drive and see if it works or not. If it does, I would say wipe and flash another ROM. If it doesn't work from recovery, then it could be a result of not unmounting before unplugging from your computer.
Sometimes if you have your phone mounted as a USB drive, or even just a regular flash drive, and it you unplug it before it is done unmounting (or if you don't use the safely remove hardward feature of Windows) the filesystem can get trashed. It hasn't happened alot with me, and I have seen the problem happen mostly when a flash drive is unplugged before the OS can finish writing to it.
After you get all of your important stuff backed up somewhere like dropbox, reboot into your recovery and repartition the sd card and/or your internal storage, whatever is giving you the problem. When you reboot into android you should be able to use it as normal, and dropbox should automatically copy everything back that you backed up.
This problem isn't really related to my script, so I if you can't get the issue resolved make a new post in Android QA or somewhere else. PM me if you post elsewhere and I can see if I can help you out there.
I didn't mean to say that the problem is related to your script.
Your script works just fine and I'm able to adb.
I'm kinda new to linux and still learning it.
I needed help and advise for how to connect phone to pc in linux.
It works in windows for me.
When I get on my PC I'm gnats give this awhirl. Ad for your mounting disk drives if ur on any ics rom it wont and I don't know how to enlighten me someone but if its gingerb then make sure u mount with the phones option when u plug in on ur handset ther should be some kind of way to switch between teather, disk and charge only? Wat fone u got?
Does this knife and forks compile? What does it do? Sorry to sound like a knob.
Sent from my GT-I9100 using XDA Premium App
This worked for my att gs2.
Sent from my GT-I9100 using Tapatalk
By using the Android Font you are violating their copyright rules. But you are free to modify the Android Robot, as long as you refer to them and say that you have permission.
Bad-Wolf said:
By using the Android Font you are violating their copyright rules. But you are free to modify the Android Robot, as long as you refer to them and say that you have permission.
Click to expand...
Click to collapse
The post where I found the font said it was an Android logo inspired font, and not the actual android logo font.
I have changed the font I'm using, and have updated my logo graphic to fight off any further concerns.
Colliebudz said:
Does this knife and forks compile? What does it do? Sorry to sound like a knob.
Click to expand...
Click to collapse
At the moment it simply automates getting adb setup on Linux, Mac, and Linux.
I have plans to add support for device rooting next, followed by some other adb commands, then rom customization tools as the last stage of development.
Pushing files to the phone, running shell commands, etc, requires that adb is setup properly, so that is where the focus is at right now. Getting the adb & driver installation scripts setup to run on all three platforms is also helping take care of some general troubleshooting, which is good to get out of the way before the main script gets tons of extra features.
All of this info should be in the first post, I'll try to clarify things when I make the next update.
Waddle said:
This worked for my att gs2.
Sent from my GT-I9100 using Tapatalk
Click to expand...
Click to collapse
Thanks for the feedback. What OS?

[GUIDE] How To Compile TWRP Recovery for QVGA And Other Unsupported Devices.

How To Compile TWRP Recovery For QVGA And Other Unsupported Devices​
Guys a humble request don't spam this thread. If you face any error reply to this thread or PM me i will help and after you build it please don't post your bugs here this thread is only for compiling and not for resolving bugs in your build. I can only help with the errors you face during compilation because i faced a lot .
I thank XDA members cybojenix, kD as i got an idea of how to make guides from them
I would also thank Dees_troy for the sources.
I have worked hard in creating this guide so when you release your build please give proper credits .
Click to expand...
Click to collapse
Minimum Requirements:-
1. RAM:- 4GB
2. HDD Space:- More than 18GB required for CM7 source code (I am going to use CM7 for this guide as CM9 is not yet supported for many devices).
3. Processor:- Equal to Core 2 Duo or Anything above it.
4. Internet Speed:- Minimum of 2 Mbps as we will be downloading files of large size.
5. Patience:- A lots of it needed to get success
Click to expand...
Click to collapse
Ok Lets Start With Step 1:- Setting Up Your Computer For Development.
Getting Linux​
Please note your PC/Laptop must satisfy the minimum requirements to continue. If it doesn't contact any person who is developing for your device to develop this.
Click to expand...
Click to collapse
For compiling you need Linux the most common and free Linux available for development is Ubuntu. Go ahead choose your version and download it.
If you wish to use Ubuntu 10.04 64-Bit for Development use this link
http://releases.ubuntu.com/lucid/ubuntu-10.04.4-desktop-amd64.iso
Click to expand...
Click to collapse
If you wish to use Ubuntu 10.10 64-Bit for Development use this link
http://releases.ubuntu.com/maverick/ubuntu-10.10-desktop-amd64.iso
Click to expand...
Click to collapse
If you wish to use Ubuntu 11.04 64-Bit for Development use this link
http://releases.ubuntu.com/natty/ubuntu-11.04-desktop-amd64.iso
Click to expand...
Click to collapse
If you wish to use Ubuntu 11.10 64-Bit for Development use this link
http://releases.ubuntu.com/oneiric/ubuntu-11.10-desktop-amd64.iso
Click to expand...
Click to collapse
If you wish to use Ubuntu 12.04 64-Bit for Development use this link
http://releases.ubuntu.com/precise/ubuntu-12.04-desktop-amd64.iso
Click to expand...
Click to collapse
After downloading install it in a Virtual Machine or dual boot it alongside another OS you are using now. If you are using a Virtual Machine make sure you allocate more than 50GB of HDD space.
So far so good now that you have Linux installed :victory: you can proceed to the next step of setting up which is followed in the second post.
Setting Up Your Laptop/PC For Development.​
Note:- You may be asked for a password when using sudo command.
Click to expand...
Click to collapse
Installing Python-2.7.5:-
First and foremost is installing Python. For those who are wondering what Python is well here is the answer Python is a language like C,C++,Java which primarily centers around Linux.
1. Open Terminal by hitting Ctrl+Alt+T.
2. Type or copy paste these codes into terminal (I prefer typing though )
Code:
sudo apt-get install build-essential gcc
cd Downloads
wget http://www.python.org/ftp/python/2.7.5/Python-2.7.5.tgz
tar -xvzf Python-2.7.5.tgz
cd Python-2.7.5
./configure --prefix=/usr/local/python2.7
make
sudo make install
sudo ln -s /usr/local/python2.7/bin/python /usr/bin/python2.7
3. Python is now installed to make sure type this code in terminal
Code:
python
and it should produce an output like this
Code:
Python 2.7.2+ (default, Jul 20 2012, 22:15:08)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or " lincense" for more information.
>>>
4. If it shows something like that you are good to go.
5. Press Ctrl+D, close the terminal and proceed to install Java 6 JDK.
Installing Java 6 JDK:-
I have to thank cybojenix and kD for this part as it is theirs and i didn't write this part .
Click to expand...
Click to collapse
If you are using Ubuntu 12.04 follow these commands others skip this set of commands.
1. Download Java 6 JDK from here.
2. After Downloading copy that to the Downloads folder.
3. Open Terminal.
4. Type these commands one by one in the terminal
Code:
cd Downloads
chmod +x jdk-6u34-linux-x64.bin
sudo ./jdk-6u34-linux-x64.bin
sudo mv jdk1.6.0_34 /usr/lib/jvm/
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_34/bin/java 1
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_34/bin/javac 1
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_34/bin/javaws 1
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javaws
If you are not using Ubuntu 12.04 follow these commands:-
1. Open terminal
2. Type these commands one by one in the Terminal.
Code:
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-bin sun-java6-jdk
If you had done those steps correctly then you must now have Java installed.
To check and make sure it is installed type this command in terminal.
Code:
java -version
and the output should be
Code:
java version "1.6.0_34"
Java(TM) SE Runtime Environment (build 1.6.0_34-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.9-b04, mixed mode)
If the output was some thing similar you are now ready to install GNU Make.
Close the Terminal and proceed.
Installing GNU Make 3.81
Note:- Any other version of make either lower or higher won't work for compiling TWRP.
Click to expand...
Click to collapse
1. Open Terminal
2. Type these codes in terminal.
Code:
wget -o make.tar.gz http://ftp.gnu.org/gnu/make/make-3.81.tar.gz
tar -xvzf make-3.81.tar.gz
cd make-3.81
./configure
sudo make install
3. That's it now you got make installed.
To check and make sure that Make is installed type this command in Terminal.
Code:
make -v
and it shoud give the output
Code:
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This Program built for x86_64-unknown-linux-gnu
If it was something smiliar to that you can close the terminal and proceed to the next step.
Ok now we got the big guns rolling it's now time for small guns without whom we can't compile yes I mean't the dependencies.
Open Terminal and apply these commands:-
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc gedit git schedtool
export USE_CCACHE=1
If you are using Ubuntu 10.10 apply this:-
Code:
sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
If you are using Ubuntu 11.04 apply this:-
Code:
sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
sudo apt-get install libx11-dev:i386
If you are using Ubuntu 12.04 apply this:-
Code:
sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
sudo apt-get install libx11-dev:i386
sudo apt-get install libncurses5-dev:i386 libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 zlib1g-dev:i386
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Good now you will have dependencies installed.
It is now time for SDK and ADB which will be continued in the next post.
Installing SDK and ABD​
Installing SDK:-
1. Download Android SDK from here.
2. Extract it to your home folder.
3. Rename the folder to sdk.
4. Open the Terminal and type these commands
Code:
cd sdk/tools
./android sdk
5. A window should popup and there will will be a list of Packages.
6. Install Android SDK Tools and Android SDK Platform-Tools.
Checking ADB:-
Since you installed Android SDK Tools and Android SDK Platform-Tools ADB must now be checked and configured.
1. Enable USB Debugging in your device and connect your phone to computer.
2. Now execute these commands in Terminal
Code:
cd sdk/platform-tools
./adb devices
It should give the output as
Code:
List of devices attached 0123456789ABCDEF device-name (Note the number-letter combination may vary)
If it does give like that skip Adding Permissions.
Or if it gives the output as
Code:
List of devices attached ????????????????? no permissions
Don't worry we have add permission to your device that's it.
Adding Permissions:-
1. Open Terminal
2. Execute this command.
Code:
sudo gedit /etc/udev/rules.d/51-android.rules
3. It should open text editor
4. Paste this line
Code:
SUBSYSTEM=="usb", ATTR{idVendor}=="xxxx", MODE="0666"
5. Replace Vendor ID with your Vendor id given in the list.
For e.g if your vendor is Acer you will replace "xxxx" with "0502"
Here is a list of Vendor ID's
Code:
Acer - 0502
ASUS - 0b05
Dell - 413c
Foxconn - 0489
Fujitsu - 04c5
Fujitsu Toshiba - 04c5
Garmin-Asus - 091e
Google - 18d1
Hisense - 109b
HTC - 0bb4
Huawei - 12d1
K-Touch - 24e3
KT Tech - 2116
Kyocera - 0482
Lenovo -17ef
LG - 1004
Motorola - 22b8
MTK - 0e8d
NEC - 0409
Nook - 2080
Nvidia - 0955
OTGV - 2257
Pantech - 10a9
Pegatron - 1d4d
Philips - 0471
PMC-Sierra - 04da
Qualcomm - 05c6
SK Telesys - 1f53
Samsung - 04e8
Sharp - 04dd
Sony - 054c
Sony Ericsson - 0fce
Teleepoch - 2340
Toshiba - 0930
ZTE - 19d2
6. Save and close the editor.
7. Execute this command in Terminal.
Code:
sudo gedit /etc/udev/rules.d/99-android.rules
8. Again paste this line
Code:
SUBSYSTEM=="usb", ATTR{idVendor}=="xxxx", MODE="0666"
Replace "xxxx" with Vendor ID.
9. Save it and close the file.
10. Execute these commands one by one in the Terminal
Code:
sudo chmod a+r /etc/udev/rules.d/99-android.rules
sudo chmod a+r /etc/udev/rules.d/51-android.rules
Now RESTART your Ubuntu and type these codes in the Terminal.
Code:
cd sdk
./adb devices
You must not get the output with ???????????????? no permission still if you get it please reply below I will help.
Now we need to edit .bashrc so that we can access adb from anywhere
Execute these codes in the Terminal.
Code:
cd
sudo gedit .bashrc
It should open text editor copy paste this line at the end.
Code:
export PATH=${PATH}:~/sdk/tools
export PATH=${PATH}:~/sdk/platform-tools
Save it and close it.
Now in terminal type adb devices it should give output List of devices attached.
That's it you got Ubuntu, Python, Java 6 JDK, GNU Make-3.81, SDK and ADB ready.
Now you are ready to start development go on to the next step to download source code.
Intializing Repo And Download Source Code
Step 2:- Initializing Repository And Downloading Source Code​
Initializing Repository​
First step is to download the Repo which is essential to download the source code.
1. Open Terminal
2. Execute these commands one by one in Terminal
Code:
mkdir ~/bin
PATH=~/bin:$PATH
sudo apt-get install curl
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
Downloading Source Code​
After you have initialized the repo you are set to download the source code.
1. Open Terminal
2. Execute these commands one by one in Terminal
Code:
mkdir source
cd source
repo init -u git://github.com/Cyanogenmod/android.git -b gingerbread
sudo sysctl -w net.ipv4.tcp_window_scaling=0
repo sync -jx (Replace x with a number this number corresponds to number simultaneous download you want for e.g if you give 5 it will download 5 files at once so go on increase to whatever you like but be reasonable :D)
The Source Code is around 15GB - 17GB so have patience and more importantly HDD space.
Click to expand...
Click to collapse
.
The download will take hours if you are on slow connection like it will be a 2 days is 512kbps connection so if you are planning to develop please have a good internet connection with a reasonable fast speed. Every developer recommends more than 1Mbps and sometimes 4Mbps.
After downloading is finished go to source folder you must have many folders inside them. Also make a backup of the source folder just in case as we will modifying it so if something goes wrong you don't have to re-download it all again.
Go to the next step to start the actual development.
Modding Files And Stuff
Step 3:- Modding Files And Folders To Make Your Device Supportable.​
First up is to compile a build of ClockworkMod.
Building ClockworkMod:-
1. Open Terminal
2. Type these commands one by one in Terminal
Code:
. build/envsetup.sh
lunch (it should show you list of devices select your device with their serial number select your device by typing the serial number)
make clean
make -j4 recoveryimage
If you didn't receive an error you are ready to compile TWRP for your device.
If you do receive and error reply to the post I will help you.
Modifying Files And Folder:-
The original Dees_Troy's build folder isn't gonna work as your device resolution doesn't support it. So I have patched the build folder with some extra libs added to prelink map and patched recovery folder with gui changes for smooth compilation.
If you have experience with using git you can clone the repo or you can download it directly from github.
Click to expand...
Click to collapse
If you are going to clone execute these commands in terminal. (Thanks to cybojenix for this so that there will no manual copying).
Code:
cd source
rm -rf build/
rm -rf bootable/recovery/
git clone git://github.com/chainhacker/TWRP_Build -b 2.3 build
git clone git://github.com/chainhacker/TWRP_Recovery -b 2.3 bootable/recovery
If you are going to download directly use the following link make sure you are downloading 2.3 branch and extract it.
Here is the link for the patched build folder------>TWRP_Build
Here is the link for the patched recovery folder------>TWRP_Recovery
After you have done downloading from the above two files.
Replace the contents of source/build folder with the patched one.
Similarly replace the contents of source/bootable/recovery folder with the patched one.
I have 240x320 resolution already in the patched ones but if your device is not 240x320 and also not supported by TWRP download a theme made by other members which has your device's resolution or create a theme. I didn't create the theme though I resized the images and made changes in ui.xml. If you are interested in theming follow the official TWRP theming guide in their website.
If you did find a theme or created it rename the theme folder to your device resolution folder for e.g. If your device resolution is 320x240 you would rename the folder as 320x240.
Copy the theme folder into source/bootable/recovery/gui/devices.
That's it finished the basic requirements next up is configuring BoardConfig.mk.
Editing BoardConfig.mk:-
1. Navigate to source/device/your_vendor/your_device.
your_vendor:- Vendor of your device e.g for me it is lge.
your_device:- Your device name.
Click to expand...
Click to collapse
2. Find BoardConfig.mk and open it in a text editor.
3. Come to the last and add these line
Code:
#twrp
DEVICE_RESOLUTION:= [I]your_device_resolution[/I] (e.g If your resolution is 240x320 type it)
RECOVERY_GRAPHICS_USE_LINELENGTH := true
2. Save it and close it.
Yay you have finished everything only thing left out is compiling which is carried out in the next post.
Psssst.......
After you have compiled your first successful build here are few other things that you could add to BoardConfig.mk
Note:- You can add this after finishing first successful build of recovery till then avoid these.
Click to expand...
Click to collapse
Code:
RECOVERY_SDCARD_ON_DATA := true -- this enables proper handling of /data/media on devices that have this folder for storage (most Honeycomb and devices that originally shipped with ICS like Galaxy Nexus)
BOARD_HAS_NO_REAL_SDCARD := true -- disables things like sdcard partitioning
TW_INCLUDE_DUMLOCK := true -- includes HTC Dumlock for devices that need it
TARGET_RECOVERY_GUI := true -- uses gui format instead of ui.xml
TARGET_RECOVERY_PIXEL_FORMAT := "RGB_565" -- to change the colour
TARGET_USE_CUSTOM_LUN_FILE_PATH :=/sys/devices/platform/usb_mass_storage/lun0/file
TW_CUSTOM_POWER_BUTTON := 107 -- to get a power button on the home screen of recovery
TW_EXTERNAL_STORAGE_PATH := "/sdcard" -- default external storage path
TW_EXTERNAL_STORAGE_MOUNT_POINT := "sdcard" -- default external mount point
TW_FLASH_FROM_STORAGE := true -- enables you to flash zips form the sdcard (You don't neeed o add this it is activated by default)
TW_HAS_DOWNLOAD_MODE := false -- to enable download or more precisely enabling usb mass storage
TW_HAS_NO_RECOVERY_PARTITION := true -- do this only if you device has no partion to recovery
TW_INCLUDE_CRYPTO := false
TW_INCLUDE_JB_CRYPTO := false
TW_NEVER_UNMOUNT_SYSTEM := true -- always keeps the system mounted
TW_NO_BATT_PERCENT := false -- shows battery percentage
TW_NO_REBOOT_BOOTLOADER := true --- disables rebooting into bootloader
TW_NO_USB_STORAGE := false -- disabled usb storage
TW_SDEXT_NO_EXT4 := false
Compiling Recovery
Step 4:- Compiling Recovery​
Finally you have come to the final part of the guide which is compiling recovery.
1. Open Terminal.
2. Execute these commands in Terminal
Code:
. build/envsetup.sh
lunch (Again select your device)
make -j4 recoveryimage
.
That's it when it is finished grab recovery.img from:
out/target/product/your_product_name/recovery.img
Flash it in your device test it fix the bugs and release it.
Wait if you don't want flash and just see how it looks so that you can flash another recovery if it is not working do these
I am not resposible if your device gets bricked in fastboot mode but mostly it won't happen though
Click to expand...
Click to collapse
1. Copy the recovery.img to sdk/platform-tools
2. Boot your device into fastboot mode.
3. Open Terminal
4. Execute these commands one by one in Terminal
Code:
fastboot devices (wait for your device to show up int terminal)
fastboot boot recovery.img
You can test out all the features except flash zip, backup and restore.
Victory :victory: you have successfully compiled TWRP recovery for your device go ahead have fun and enjoy.
If you really like my work express your gratitude by pressing the Thanks button. See you soon in another thread :victory: :laugh: :fingers-crossed:
Click to expand...
Click to collapse
Reserved
reserved just in case :fingers-crossed:
Contributions
You can Contribute to this guide by suggesting improvements and stuff are welcome PM about the contribution and i will add by giving credits to the person contributed
Does it make any difference if I want to compile it for an ARMV6 device?
Gesendet von meinem Skate mit Tapatalk 4 Beta
Joe4899 said:
Does it make any difference if I want to compile it for an ARMV6 device?
Gesendet von meinem Skate mit Tapatalk 4 Beta
Click to expand...
Click to collapse
Nope it won't make any difference it is just the same even if your device is ARMv6 or ARMv7. Make sure your device is supported by CM
Chain Hacker said:
Nope it won't make any difference it is just the same even if your device is ARMv6 or ARMv7. Make sure your device is supported by CM
Click to expand...
Click to collapse
i'm wondering if it will work for Tegra's device
666satyr666 said:
i'm wondering if it will work for Tegra's device
Click to expand...
Click to collapse
Yes it will work go ahead give it a shot :good:
So that's me again :laugh: Wanted to compile TWRP 2.6.0.0 for cm10.1 so I have set up everything so far but get an error when I try to compile
build/core/base_rules.mk:130: *** external/fuse/lib: MODULE.TARGET.STATIC_LIBRARIES.libfuse already defined by bootable/recovery/fuse.
Click to expand...
Click to collapse
Seems to be really stupid, so far I understand is the libfuse defined twice in recovery and base_rules.mk so think (thought ) it's an easy part - just to remove this libfuse from one of them... But I can't find something with "libfuse", "static libraries" or anything like that in base_rules.mk
Joe4899 said:
So that's me again :laugh: Wanted to compile TWRP 2.6.0.0 for cm10.1 so I have set up everything so far but get an error when I try to compile
Seems to be really stupid, so far I understand is the libfuse defined twice in recovery and base_rules.mk so think (thought ) it's an easy part - just to remove this libfuse from one of them... But I can't find something with "libfuse", "static libraries" or anything like that in base_rules.mk
Click to expand...
Click to collapse
I have never tried compiling 2.6.0.0 because Dees_Troy is evaluating my theme for my device such that it gets official support so if you are ready to use CM7 and TWRP 2.3.3.0 you can follow my guide and i can help you with the errors but any other version please ask Dees_Troy for the solution.
How I compile twrp if my phone is not officially/unofficially supported?is it possible?
Sended from my ascend g330 using tapatalk 4 [VIP]
andrea210701 said:
How I compile twrp if my phone is not officially/unofficially supported?is it possible?
Sended from my ascend g330 using tapatalk 4 [VIP]
Click to expand...
Click to collapse
It is possible after successful build with no bugs you can contact Dees_Troy for evaluation and get official support.
Sent from my LG-P350 using Tapatalk 2
Error detected
Hi, Chain Hacker.
Does it matter how to write address after "git://"?
I mean this:
Code:
[B]repo init -u git://github.com/Cyanogenmod/android.git -b gingerbread[/B]
Should it be like this:
Code:
[B]repo init -u git://github.com/Cyanogen[COLOR="Red"]M[/COLOR]od/android.git -b gingerbread[/B]
By the way, it's a very good manual for those who are just starting to understand how to compile
maximik1980 said:
Hi, Chain Hacker.
Does it matter how to write address after "git://"?
I mean this:
Code:
[B]repo init -u git://github.com/Cyanogenmod/android.git -b gingerbread[/B]
Should it be like this:
Code:
[B]repo init -u git://github.com/Cyanogen[COLOR="Red"]M[/COLOR]od/android.git -b gingerbread[/B]
By the way, it's a very good manual for those who are just starting to understand how to compile
Click to expand...
Click to collapse
No i doesnt matter at all the only thing that is case sensitive are the words after cyanogenmod as they must be written as it is so it is your wish whether you are gonna write Cyanogenmod or CyanogenMod and by the way thanks for the complement
Sent from my LG-P350 using Tapatalk 2
TWRP Recovery size...
Hi again...
I've managed to compile a TWRP-Recovery 2.6.0.1 based on CM9 for my Huawei Ascend Y101 (8186).
But I had to change recovery partition size in BoardConfig.mk (originally it was BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x00500000, I changed it to 0x00600000), because without these changes it wasn't possible to build a recovery.img ("recovery.img is too large... etc.")
When I flashed it on my device, the TWRP recovery started and worked perfectly, but I wasn't able to boot my device. But it's not a problem for me, I understand why it wasn't able to boot very good.
The question is the following: is it possible to decrease somehow the source files' sizes of TWRP recovery (maybe images, don't know...) in order to compile the recovery.img that would be less than 4.85 MB (actually it's size is 5*095*424, it's more than my recovery partition....... )
By the way, the size of a CWM-recovery (cm9) that I've compiled is 4*489*216, so it fits like a glove :good: and works fine...
Thanks in advance. I understand that you compiled a TWPR recovery based on CM7, but I don't see much differences...
maximik1980 said:
Hi again...
I've managed to compile a TWRP-Recovery 2.6.0.1 based on CM9 for my Huawei Ascend Y101 (8186).
But I had to change recovery partition size in BoardConfig.mk (originally it was BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x00500000, I changed it to 0x00600000), because without these changes it wasn't possible to build a recovery.img ("recovery.img is too large... etc.")
When I flashed it on my device, the TWRP recovery started and worked perfectly, but I wasn't able to boot my device. But it's not a problem for me, I understand why it wasn't able to boot very good.
The question is the following: is it possible to decrease somehow the source files' sizes of TWRP recovery (maybe images, don't know...) in order to compile the recovery.img that would be less than 4.85 MB (actually it's size is 5*095*424, it's more than my recovery partition....... )
By the way, the size of a CWM-recovery (cm9) that I've compiled is 4*489*216, so it fits like a glove :good: and works fine...
Thanks in advance. I understand that you compiled a TWPR recovery based on CM7, but I don't see much differences...
Click to expand...
Click to collapse
The difference is no on the source dude so relax. You have to modify your kernel and change the compression method to lzma. Contact Dees_Troy for this because i dont know how to change it. You can chat with him through IRC.

[HOW-TO] extract kernel from source, compile, and insert on GPE (510)

How to extract the boot image from your tablet, set up adb, compile a new kernel with cool options, and put it back on your device!
UPDATED for Lolipop 12-4-14
This is a complete guide from start to finish, copy and paste style. If you own a gpe510, or any other AOSP device and a computer running Debian Linux, you can do all of this.
If all you want is the modified kernel, download from here:
Sleekai Kernel For The LG GPad 8.3 V510(GPE)
​
I am hoping people will add to this with new ideas and patches in order to make the GPE a better device. I see the potential for all sorts of neat stuff.
This guide assumes a basic knowledge of linux operating systems. I am using a Debian 64 bit (wheezy stable) to compile my kernel. I have used many, many hours of the day to figure this out properly, with specific thanks going to Pete of Pete's Blog for his image tools.
But first, lets keep this simple. As usual, you are on your own if you brick your device, though I don't see how you could if you are paying attention!
There are dependencies for building your own kernel, and you will definitely want to use a 64 bit system as a 32 bit will not work properly for kitkat.
Here are all of the packages you will need, and they will draw in further dependencies when you install, but these are it! So, here we go:
Open a terminal, su to root and:
Code:
dpkg --add-architecture i386
##This will allow for the use of some 32 bit librarys that we will need for both adb and the kernel compile. Then:
Code:
apt-get update ; apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 libc6-i686:i386 lzop liblzo2-dev libgpm2:i386 git-core git gnupg flex bison gperf libsdl1.2-dev libesd0-dev build-essential zip curl gedit libncurses5-dev zlib1g-dev fakeroot lib32z1-dev lib32ncurses5-dev gcc-multilib g++-multilib
Next, you will need to install adb and have your permissions set up.
In order to do this you will need to go into the developer options on your device to enable debugging on your tablet. Go to settings/about tablet/build number, and tap on build number several times to unlock the developer options.
then:
You will need to create new udev rules for your device in/etc/udev/rules.d on your computer.
Use "lsusb" in your terminal to find the manufactures code of your device. it will show up as a nexus 4, or Google device.
You will need to create a file in your computer in /etc/udev/rules.d/99-android.rules.
You can use gedit if you like:
Code:
gedit /etc/udev/rules.d/99-android.rules
Put the following inside and save, changing the manufactures code as necessary to fit your device, and change “your-login” to your login name on your computer.
Code:
# Google Nexus devices
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", OWNER="your-login" # Google Nexus devices
18d1 is the manufacturers code.
You will then want to restart udev on your computer:
Code:
service udev restart
you will now have permissions to access your android device from user space.
Now to download adb and get started. You should probably not use adb from the Debian repositories, as it may be an older version. the V510 is using kitkat android and needs the latest build of adb to work properly. It is a good idea to get rid of any old adb files on your computer first. The code below will do just that.
Code:
apt-get purge android-tools-adb android-tools-fastboot
Now download the latest adb bundle from here:
http://developer.android.com/sdk/index.html
Move it into a new directory,
*note -the version number may be different.
Code:
mkdir ~/adb
Code:
cd ~/adb
Code:
unzip adt-bundle-linux-x86_64-20131030.zip
su to root and Move the bundle to /opt:
Code:
mv adt-bundle-linux-x86_64-20131030 /opt/android-sdk-linux-x86_64-20131030
Other google products reside in /opt, this should too. This takes a minute or so on slow machines.
Next we need to link adb to /usr/bin
Code:
ln -s /opt/android-sdk-linux-x86_64-20131030/sdk/platform-tools/adb /usr/bin
Code:
ln -s /opt/android-sdk-linux-x86_64-20131030/sdk/platform-tools/fastboot /usr/bin
We are ready to begin working on the device! first start the adb server and look for your device.
Code:
adb start-server
Code:
adb devices
You will then need to confirm the connection on your tablet screen to allow access from your computer.
Okay, wev'e got this first part set up. it's time to begin working on a kernel!
Lets get started.
I want to extract and build my zimage in $userspace, so open a terminal from /home and:
Code:
mkdir ~/android
Download the source package LG-V510(G-Pad 8.3 Google Play Edition)_Android_KK_V510_11c from here :
https://www.lg.com/global/support/opensource/opensourceList?types=ALL&search=lgv510
and open it to find three folders, including a kernel folder. Move the kernel folder to ~/android and then:
Code:
cd ~/android
Download the current eabi-4.6 Google tool chain to ~/android to cross compile your android kernel:
Code:
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8
When it completes, enter ~/android/kernel and get ready to compile a new kernel from the source code.
Code:
cd ~/android/kernel
Do the following each time you compile another kernel. This insures the correct path.
Code:
export PATH=$PATH:~/android/arm-eabi-4.8/bin
Code:
arm-eabi-gcc --version
you should get:
Code:
arm-eabi-gcc (GCC) 4.6.x-google 20120106 (prerelease)
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Continue on! we are not done yet!
Code:
export ARCH=arm
Code:
export SUBARCH=arm
Code:
export CROSS_COMPILE=arm-eabi-
Code:
export KERNEL_DEFCONFIG=palman_defconfig
Code:
make clean
Code:
make palman_defconfig
Doing the above prepares your kernel build environment, while the following code opens a interface to configure the kernel. You can simplify this later however you wish.
But for now,
Code:
make menuconfig
At this point make whatever changes you wish to the config file. for a list of the changes I have made, and that are in the kernel available to download, look in the sleekai kernel thread. (At start of thread, or in my signature).
After saving your changes,
Code:
make
Or conversely
Code:
make -o2
which will optimize the make. I recommend using simply "make" first, as the other may not properly show errors should any occur.
and go make a pot of coffee, and probably drink the whole pot! This will take a while.
At the end you will see that the "zimage is ready"
If you have errors, then you probably have dependency problems. If not, Yay! You compiled your first kernel, but we are not done yet!
The zimage you just produced is stored in /kernel/arch/arm/boot/zImage
To put both the zimage and any modules into a separate folder inside of ~/android so as to make extracting them easier:
Code:
mkdir ~/android/kernel_output
Code:
cp ~/android/kernel/arch/arm/boot/zImage ~/android/kernel_output/zImage
Code:
find ~/android/kernel -name "*.ko" -exec cp {} ~/android/kernel_output/ \;
The above code will find all the modules for your kernel. We don't need them for this tutorial, but it still is mighty handy!
Extract your boot image (boot.emmc.win) for the ramdisk You may also download the stock.zip from the sleekai kernel thread
Now make a backup to transfer to your computer.
Reboot to recovery on your tablet. I'm using TWRP. If you are using something else it should be just as easy.
Code:
adb reboot recovery
Only tick the boot
make a backup to your sd card. I changed the name to boot.bac to keep it simple
reboot
make sure the backup of boot is present using a file explorer. I am using ES File explorer.
On your computer, pull the file using adb
Code:
adb start-server
Code:
adb devices
Code:
adb pull /storage/sdcard1/TWRP/BACKUPS/LG0000606708987/boot.bac /home/sleek
sleek is my user name, replace with yours or use tilde.
What we are after is the "boot.emmc.win" file. We will only need this and the zImage to compile a new boot image and run it on your tablet.
The tools to extract the kernel and ramdisk from the boot.emmc.win you will need the following boot image tools installed on your computer.
So, again, lets keep this simple. All the tools are forked to my github for ease of use.
So lets install the tools! Ready?
As Root:
Code:
mkdir /usr/src/android
Code:
mkdir /usr/src/android/boot
Code:
cd /usr/src/android/
Code:
git clone https://github.com/sleekmason/bootimg-tools.git
Code:
cd bootimg-tools/libmincrypt/
Code:
gcc -c *.c -I../include
Code:
ar rcs libmincrypt.a *.o
Code:
cd ../mkbootimg
Code:
gcc mkbootimg.c -o mkbootimg -I../include ../libmincrypt/libmincrypt.a
Code:
cp mkbootimg /usr/local/bin/
Code:
cd ../cpio
Code:
gcc mkbootfs.c -o mkbootfs -I../include
Code:
cp mkbootfs /usr/local/bin/
Code:
cd /usr/src/android/bootimg-tools/mkbootimg/
Code:
wget https://raw.github.com/sleekmason/bootimg-tools/master/mkbootimg/unmkbootimg.c
Code:
gcc -o unmkbootimg unmkbootimg.c
Code:
cp unmkbootimg /usr/local/bin/
Now everything is in place to make a new boot image for your tablet!
Finishing this up is easy.
As root, we made a directory in /usr/src/android/boot for your boot.emmc.win file to be torn apart:
Code:
cd /usr/src/android/boot
Copy your new zImage and the boot.emmc.win file you extracted from your device.
Note* "/home/sleek" is the path on my computer, and should be changed to reflect yours!
Code:
cp /home/sleek/android/kernel_output/zImage /usr/src/android/boot
Code:
cp /home/sleek/boot.emmc.win /usr/src/android/boot
Now unpack the boot.emmc.win file to get the ram disk
Code:
unmkbootimg -i boot.emmc.win
Now you may remove the current boot.emmc.win file, and the resultant kernel file as we will be making new ones, and rename the zImage file you moved here to "kernel".
Code:
rm boot.emmc.win kernel && mv zImage kernel
Now repack using the command given to you during the unpack:
Code:
mkbootimg --base 0 --pagesize 2048 --kernel_offset 0x80208000 --ramdisk_offset 0x82200000 --second_offset 0x81100000 --tags_offset 0x80200100 --cmdline 'console=ttyHSL0,115200,n8 androidboot.hardware=palman lpj=67677 vmalloc=300M' --kernel kernel --ramdisk ramdisk.cpio.gz -o boot.emmc.win
Note* For 500 users this may be different. Simply use the command from the prompt.
You should now have a brand new boot.emmc.win image in /usr/src/android/boot!!
To push back on your device to test
Code:
adb reboot bootloader
Code:
fastboot boot boot.emmc.win
USING the above will only put your kernel build into memory and should not hurt your device if something goes wrong. Use the command below to make it permanent.
If everything works well, you should see the change you made to the /general/perf-localversion/ in your settings under kernel. from there it's up to you to hack away! make new and unique kernels!
If you want your kernel to survive reboot do;
Code:
fastboot flash boot boot.emmc.win
then:
Code:
fastboot reboot
You can expect a slow bootup on the first go around as your new kernel populates the widgets, etc..
NOTE*For the use of the latest eabi-4.7 google toolchain, you will need the libglibc libraries from the "testing" branch as gcc 4.7 is in testing. I advise completing the guide with eabi 4.6 first before trying 4.7.
The gamma correction though enabled in 4.6, isn't near as good as the native compile using 4.7. If you want the screen to look like it does in my kernels, you will need 4.7
For the eabi-4.7:
Code:
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7
That's it! Good luck! Remember, If you post a kernel you have made, you will need to show your kernel source, etc . . . Git hub is a good choice to keep track of changes you make. Best regards, Sleekmason
If you are a v500 user and want to build your own kernel!
First, read the above post as you will be following the steps listed there.​
There are just a couple of changes that you will need to do, and maybe a riddle to figure out as well. Read on.
You will need to download the v500 source from here: https://www.lg.com/global/support/opensource/opensourceList?superOsCategoryId=CAT00000001&osCategoryId=
Look for the LGV500 kernel source.
Where it says "palman" for the defconfig items, you will want to replace that with the defconfig for the 500, so replace palman with awifi-perf,
like this:
Code:
export KERNEL_DEFCONFIG=awifi-perf_defconfig
Code:
make awifi-perf_defconfig
Important
Follow the guide and build with the Google Toolchain eabi4.6 first
LG compiled for the 500 and 510 using the eabi4.6. It works, and will give you a feel for the process, and allow you to use your kernel.
Note*
I use the google toolchain eabi-4.7 for the sleekai kernels as it changes the gamma to reasonable defaults on the 510 without further tweaking. After compiling a kernel or two to get a feel for it, you should try using the 4.7 toolchain. To do so, you will probably need the libglibc libraries from the "testing" branch. Look it up.
caveat: I recieved a compile error for the v500 when I used the eabi-4.7 . . . . . yeah. You'll have to work that out.
There is a modified anykernel script for emmc devices out there (Search Google or here in xda). You will have to use the anykernel script after making your boot.emmc.win image as fastboot won't work on the 500. There may be another way .... But I don't know what it is.
Edit* There are now two different kernels for the LG GPad 8.3 V500(awifi) located in the development section of the forum.
Best of luck! -sleekmason
Can this be used to create a kernel for the non Google Play Edition Gpad to be able to allow us to install the Google Play edition ROM on it
Sent from my SM-N900W8 using Tapatalk
Canadoc said:
Can this be used to create a kernel for the non Google Play Edition Gpad to be able to allow us to install the Google Play edition ROM on it
Sent from my SM-N900W8 using Tapatalk
Click to expand...
Click to collapse
I would think so. I edited the above to show how to put the image back on your device. You should be able to use any source you wish to compile with. My thoughts are that you might wish to examine the differences in the ram disk if any.
sleekmason said:
Howdy, I would like to share how to download the kernel source for the gpe, compile a new custom kernel, and insert into your LG gpad GPE 510.
...
Click to expand...
Click to collapse
Thanks for the guide. Making GPE kernel was my next step in trying to get the GPE ROM to work on v510.
I just made guide for getting your Android build environment going if you want to use it on your blog or where ever.
http://forum.xda-developers.com/showthread.php?t=2629008
The problem with v500 is that it does not have fastboot so we can not flash kernel like how you can on v510.
@ AndroidUser00110001 Hi! I know that somebody tweaked the Any kernel to work on emmc devices... Maybe it could be adapted? Actually getting the menuconfig and make should be the same process as well as repacking the image. I take it just getting it back on the 500 device is the problem?
I will add your link to this post for setting up a build environment if that is okay.
sleekmason said:
@ AndroidUser00110001 Hi! I know that somebody tweaked the Any kernel to work on emmc devices... Maybe it could be adapted? Actually getting the menuconfig and make should be the same process as well as repacking the image. I take it just getting it back on the 500 device is the problem?
I will add your link to this post for setting up a build environment if that is okay.
Click to expand...
Click to collapse
Is that the koush any kernel? I was going to mess with that too. I just need a small break now. Took a few days to get new system exactly how I want it.
Go ahead and use guide...mo problem at all.
AndroidUser00110001 said:
Is that the koush any kernel? I was going to mess with that too. I just need a small break now. Took a few days to get new system exactly how I want it.
Go ahead and use guide...mo problem at all.
Click to expand...
Click to collapse
Yes, from here: http://forum.xda-developers.com/showthread.php?t=847265
I noted that boot was on block nncblk0p21 on our device, and not 22? better double check that. I tried it Anykernel as well to no avail when getting this set up. Fastboot is Awesome!
It's taxing to get it set up right. Seems like things change very often for the dependencies based on other package changes. I ussually go with testing but redid two partitions with stable. The 32 bit is just going to sit there, which seems kinda silly due to the need for extra packages in 64 to compile for 32 but whatever. Yeah.
AndroidUser00110001 said:
Thanks for the guide. Making GPE kernel was my next step in trying to get the GPE ROM to work on v510.
I just made guide for getting your Android build environment going if you want to use it on your blog or where ever.
http://forum.xda-developers.com/showthread.php?t=2629008
The problem with v500 is that it does not have fastboot so we can not flash kernel like how you can on v510.
Click to expand...
Click to collapse
I don't understand, what are the differences bettween the v500 and v510? they both have the same hardware, but not the same boot partition or something like that?
ayziaa said:
I don't understand, what are the differences bettween the v500 and v510? they both have the same hardware, but not the same boot partition or something like that?
Click to expand...
Click to collapse
The boot on the 500 cannot be fully unlocked.
This is not the appropriate place to ask that kind of question should be asked in general or in troubleshooting. Also, there are already many threads about this same question please use the search utility to find them. Thank you.
i was thinking of writing a tutorial about this as well for the v500 but this better than i would have done Well done...
sleekmason said:
Yes, from here: http://forum.xda-developers.com/showthread.php?t=847265
I noted that boot was on block nncblk0p21 on our device, and not 22? better double check that. I tried it Anykernel as well to no avail when getting this set up. Fastboot is Awesome!
It's taxing to get it set up right. Seems like things change very often for the dependencies based on other package changes. I ussually go with testing but redid two partitions with stable. The 32 bit is just going to sit there, which seems kinda silly due to the need for extra packages in 64 to compile for 32 but whatever. Yeah.
Click to expand...
Click to collapse
Another tool that i ported to the lg g pad a bit back along with loki-doki...
Quick hint, dont bother with direct mmc naming as qcom (i dont know if the other chip makers do the same thing, as i have only had qcom devices) has given us a simple naming scheme...
should only be used by people who know how to use this,
darkassain said:
i was thinking of writing a tutorial about this as well for the v500 but this better than i would have done Well done...
Another tool that i ported to the lg g pad a bit back along with loki-doki...
Quick hint, dont bother with direct mmc naming as qcom (i dont know if the other chip makers do the same thing, as i have only had qcom devices) has given us a simple naming scheme...
should only be used by people who know how to use this,
Click to expand...
Click to collapse
Thank you! Have you successfully used your script to push a kernel onto the 500 Or 510?
I would think this could be very handy for sharing a custom kernel for the 510, but would like to see somebody report a positive test result. Very cool!
sleekmason said:
Thank you! Have you successfully used your script to push a kernel onto the 500 Or 510?
I would think this could be very handy for sharing a custom kernel for the 510, but would like to see somebody report a positive test result. Very cool!
Click to expand...
Click to collapse
yes back before when there wasnt a overclocked kernel i basically used this to push it when i would compile just the kernel (didnt maintain so i now use dyn's)...
yes this is only for the v500 as this has the extra loki step, but it shouldnt be hard to modify so it does not do that extra step
darkassain said:
i was thinking of writing a tutorial about this as well for the v500 but this better than i would have done Well done...
Another tool that i ported to the lg g pad a bit back along with loki-doki...
Quick hint, dont bother with direct mmc naming as qcom (i dont know if the other chip makers do the same thing, as i have only had qcom devices) has given us a simple naming scheme...
should only be used by people who know how to use this,
Click to expand...
Click to collapse
Hi, can you just use a generic anykernel updater script too?
For example to flash a packed boot.img
Code:
run_program("/tmp/busybox", "dd", "if=/dev/block/platform/msm_sdcc.1/by-name/boot", "of=/tmp/boot.img");
run_program("/tmp/unpackbootimg", "-i", "/tmp/boot.img", "-o", "/tmp/");
run_program("/tmp/repack-ramdisk.sh");
run_program("/tmp/mkbootimg.sh");
run_program("/tmp/busybox", "dd", "if=/tmp/newboot.img", "of=/dev/block/platform/msm_sdcc.1/by-name/boot");
mako and flo can do like this.. I think HTC One as well, since they are all similar qcom chipsets maybe this device can too
poondog said:
Hi, can you just use a generic anykernel updater script too?
For example to flash a packed boot.img
Code:
run_program("/tmp/busybox", "dd", "if=/dev/block/platform/msm_sdcc.1/by-name/boot", "of=/tmp/boot.img");
run_program("/tmp/unpackbootimg", "-i", "/tmp/boot.img", "-o", "/tmp/");
run_program("/tmp/repack-ramdisk.sh");
run_program("/tmp/mkbootimg.sh");
run_program("/tmp/busybox", "dd", "if=/tmp/newboot.img", "of=/dev/block/platform/msm_sdcc.1/by-name/boot");
mako and flo can do like this.. I think HTC One as well, since they are all similar qcom chipsets maybe this device can too
Click to expand...
Click to collapse
thanks for reminding me the any kernel uploaded by me won't work as it doesn't parse Loki images xorrectly, I'll upload the correct one once I have access to my pc
darkassain said:
thanks for reminding me the any kernel uploaded by me won't work as it doesn't parse Loki images xorrectly, I'll upload the correct one once I have access to my pc
Click to expand...
Click to collapse
could you please re-post to a different thread rather than hijacking this thread, as your script does not work with the 510 currently and I do not want to go to get confused with my kernel how to. what started out to maybe become relevant apparently will not and so shouldn't be confused with what I'm doing here. I will be happy to try working with your script if you would open up an appropriate thread. Thank you.
Installed kenel and booted. Now to install trickster mod and fix the dang gamma.
gunnyman said:
Installed kenel and booted. Now to install trickster mod and fix the dang gamma.
Click to expand...
Click to collapse
Excellent!! Pleased to know that you are able to use it. Have you changed your gamma settings?
I did on mine and am pleased with the result. I'm using 248, 252, 255 using trickster mod What are you going with?
sleekmason said:
Excellent!! Pleased to know that you are able to use it. Have you changed your gamma settings?
I did on mine and am pleased with the result. I'm using 248, 252, 255 using trickster mod What are you going with?
Click to expand...
Click to collapse
havent messed around too much.
I had a thought about this and I think it would be awesome if we could incorporate faux123's bits for gamma and color control. His fauxcontrol offers much more granular control than trickster.
I'm thankful to have what we have, and THANK YOU for sharing it, but like any good geek I WANTS MOAR!!!!!
gunnyman said:
havent messed around too much.
I had a thought about this and I think it would be awesome if we could incorporate faux123's bits for gamma and color control. His fauxcontrol offers much more granular control than trickster.
I'm thankful to have what we have, and THANK YOU for sharing it, but like any good geek I WANTS MOAR!!!!!
Click to expand...
Click to collapse
me too! I'll look into it. There are other apps besides trickster to give you more control. I think at the kernel level everything we need is unlocked. And yeah, he knows his business like nobody else eh? I'm just persistent.

Noob's guide to building AOSP from scratch.

So, I have been an Android developer since 2009 (HTC dream), and have been actively "consuming" XDA, custom ROMs and other tweaks. Surprisingly, never tried to build my own ROM from scratch.
Recently, something made me want to build the ROM, so that I can make some changes to the way SystemUI behaves (specifically putting some app shortcuts to my Pixel phone(s), like camera etc. which are now removed in Android 10). So, after a week's struggle I got to where I wanted to reach. (90% time spent in getting the first successful flash. 1% feature development. 9% feature polishing).
Here is my guide to all beginners. (It is pretty simple, if you know the steps).
System setup
I have always been a Windows user (and I love my Surface(s)), but you cannot build Android on Windows machines (as clearly called out in source.android.com). I still tried to install Ubuntu shell from Microsoft store, and build (Spoiler alert: Does not work).
Next is Mac. Android can be built in Mac, I got it build in Mac. But, it is not easy. Especially with setting up the environment, having the right version of MacOS (doesn't work on Catalina yet). And also, challenges with filesystem format (Android building only works on case sensitive file system, so you have to create such a partition). Android building needs at least 160GB of disk space (so unless you are super rich and have 512GB+ Macbook with top specs, it is going to be hard).
My choice machine hence became, my two desktops (i7 4 core, 16GB, 1TB SSD, Ubuntu 18.04 and Xeon 12 core, 32GB, 512GB disk, with Ubuntu 18.04).
There is a reason why I specifically talk about these two machines. To build Android fast (cold clean build in less than 4 hours), you need
Fast processors, and more cores
Lots of RAM
A SSD disk (with 200GB space)
If you are missing any of the above 3, you will build times will go up. I have found for hot build, both machines did a decent job (2-3 mins if you are working on single module), but SSD was more important than cores, and RAM.
Setting up your Ubuntu machine. {ETA 30 mins}
Android has official (and clearly laid out) steps here.
But for Ubuntu these are pretty much the steps.
Code:
$sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev libgl1-mesa-dev libxml2-utils xsltproc unzip
And the guide doesn't mention this, but you need Python2.7, so get this.
Code:
# refreshing the repositories
sudo apt update
# its wise to keep the system up to date!
# you can skip the following line if you not
# want to update all your software
sudo apt upgrade
# installing python 2.7 and pip for it
sudo apt install python2.7 python-pip
# installing python-pip for 3.6
sudo apt install python3-pip
Also install adb.
Code:
sudo apt install android-tools-adb android-tools-fastboot
If you have come till here, you're ready to build for different devices.
Getting the code ready to build {ETA 5 hours - 1 day}
Most of this is also mentioned in the AOSP official website, but some stuff are tricky, I will try to highlight those steps here.
We are going to build the ROM for Pixel 3 (Android 10 - QP1A.191105.003 )
Download and explode the code {ETA 2-3 hours, depending on internet speed}
Here we are talking about downloading at least 20GB of code (text heavy content) over the internet. Going to be excruciatingly slow.
Also, we will be downloading code for specific device model, so if you want to do it for a newer model, you will have to go through the grind again.
Although, technically it might be possible to have the same folder contain code for multiple devices, it is too risky IMO, something goes wrong, you lose everything.
Recommended folder structure would be
aosp --> device 1
aosp --> device 2
......
aosp --> device n
Click to expand...
Click to collapse
With each folder containing over 150GB of contents (after downloading, building etc), so in practical sense, n could be only 3-4 at max.
Setting up repo.
Repo is a tool that Google uses to checkout and manage the AOSP code in your local machine. Once you download the codebase, you can use the command to resync, update, code base.
Code:
mkdir ~/bin
PATH=~/bin:$PATH
You should persist this folder in your PATH variable all the times.
Code:
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
This sets up repo in your machine.
One final step before you actually start the long download, setup your git details.
Code:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
Now download the code. Like I previously suggested I would do this.
Code:
mkdir ~/aosp
cd ~/aosp
mkdir pixel3
cd pixel3
Now, let's start getting the code home.
Code:
repo init -u https://android.googlesource.com/platform/manifest -b android-10.0.0_r10 --depth=1
Here we have done a bunch of things.
We have chosen a particular Android build tag to download (branch). You can follow the link to choose which branch you want to checkout, based on your test phone and Android version you want to build.
We have asked to only download the latest version of the branch and not all of the branch (--depth), this considerably reduces our download time.
Now that we have decided what to download, let's download the code with this command.
Code:
repo sync -qc -j4
This command is going to take a while to download over 20GB of code. In the meanwhile, let's see what we did here.
-q Asks the download to be silent (which means it will show just overall progress)
-c Makes sure we are only downloading current branch
-j[x] This the tricky one. Let's talk about this.
With -j we are asking repo to spawn multiple downloads (parallelly), to speed up the process. We will see this flag going forward in other places also. We should keep the value of x to number of cores we have in our machine. To find how many cores you have run
Code:
nproc --all
. Note that I have had situations where I put a very high value for n (higher than my cores as well), and eventually ran my JVM out of RAM to run the command (in parallel). So, the trade off here is to restrict it to the core number.
***Key step: Download radio drivers.***
Most tutorials miss this or mention it very subtly. But, without this step the ROM you flash won't boot to the home screen (you will be in the boot loop).
Go to the driver binaries page, and download the right zip files for the Android build version (android-10.0.0_r10) and device (Pixel 3) you chose earlier in the repo command.
You will be downloading two zip files (one vendor image zip and one radio drivers zip), both zips will have on shell script file each (.sh), just put those two files in your repo folder (~aosp/pixel3) and run the scripts. It will download the required proprietary files (after asking you to accept the terms). Do not miss this step.. I lost 3 days trying to find the reason for my ROM not booting up, this was it.
Let's build our code
Now things are more definitive.
Code:
source build/envsetup.sh
This command basically sets up your environment, adding necessary commands to path etc.
Code:
lunch aosp_blueline-userdebug
You can read more about this command here.
Basically this sets up the right parameters to build for your specific model. The param can derived based on aosp_[device code]-[userdebug | eng | user].
Once you have run the above two commands, you can *finally* build your codebase.
Code:
m droid -j4
m basically makes and builds the whole codebase.
Code:
droid
refers to the defaults target configuration (optional). -jN is to specify parallelism (equal to number of cores you have).
This command could take anywhere between 4-12 hours for the first run. But, if you followed all steps above, you should have a green message in the end saying this
Code:
[COLOR="SeaGreen"]#### build completed successfully (2:03:04 (hh:mm:ss)) ####[/COLOR]
Flashing your phone
Now, you're 50% safe when your build has finished successfully. Now, next 50% depends if you're able to flash it and get the phone booting.
This part most of you should know, so I am keeping it brief.
Enter fastboot
Code:
adb reboot bootloader
Unlock your bootloader
Code:
fastboot flashing unlock
Flash your Build
From the root folder of your repository (~/aosp/pixel3)
Code:
fastboot flashall -w
In a few minutes your device should be booting to the freshing baked ROM that you made.
What next?
You can just repeat
Code:
m droid -j4
to repeat builds
You can also go to a specific module folder and execute
Code:
mm
to only build that module
You can use adb sync to update specific modules without flashing again (this never worked for me, always bricked my device)
Use *fastboot flashall* without [-w] flag to flash over existing ROM without losing user data.
You can clean up the whole builds and rebuild everything from scratch. Run
Code:
make clobber
to clean your build, and use
Code:
m
to build again
You could face adb issues (device not detected) in Ubuntu. I am not going into details of how to fix that
This has been pretty much my journey so far with AOSP. I am comfortable making changes to modules and building them again.
Aw man, thanks for posting this. Never thought building rom itself would take this much effort & resources. Rom devs are serioulsy awesome ppl. :good:
Thx a lot ,I just want to learn it,it is vevy clear and help me a lot
Thanks very much for creating this. I didn't try flashing the result yet, but the build finished without any problems.
thank you very much for your post, I also want to modify little bit in code aosp and test this changes. Could you plaese provide advice about how I can open code (Android studio?), do some changes and test it by emulator?
thanks for the great guide
but following it gapps will not be included in the build, correct?
do you guys know how to include open gapps?
tia!
hi everything worked in this guide in terms of the build. While flashing the device all steps succeed but during boot the pixel is stuck at the google loading screen. Any suggestions. I have been stuck on the screen for > 30 minutes.
rorlig said:
hi everything worked in this guide in terms of the build. While flashing the device all steps succeed but during boot the pixel is stuck at the google loading screen. Any suggestions. I have been stuck on the screen for > 30 minutes.
Click to expand...
Click to collapse
Maybe you did not download appropriate .sh scripts for your device or didn't run them successfully before building the code. These scripts additionally download files and without them you could have these problems which you mentioned.
I built and loaded AOSP Andorid 9 for PIxel 2 using the eng build vs the userdebug and its works however, when I start installing and granting Google services and such it works but i get a lot of crashes. do you have Google working and not crashing all the time?
```
$ adb root
$ adb remount
$ adb shell
$ cd /system/priv-app
$ mkdir GoogleServicesFramework
$ mkdir Phonesky
$ mkdir PrebuiltGmsCorePi
$ cp /sdcard/GoogleServicesFramework.apk GoogleServicesFramework/GoogleServicesFramework.apk
$ cp /sdcard/Phonesky.apk Phonesky/Phonesky.apk
$ cp /sdcard/PrebuiltGmsCorePi.apk PrebuiltGmsCorePi/PrebuiltGmsCorePi.apk
$ chmod 755 GoogleServicesFramework
$ chmod 755 Phonesky
$ chmod 755 PrebuiltGmsCorePi
$ chmod 644 GoogleServicesFramework/GoogleServicesFramework.apk
$ chmod 644 Phonesky/Phonesky.apk
$ chmod 644 PrebuiltGmsCorePi/PrebuiltGmsCorePi.apk
:: Need to add permissions for the three apps above
::If a device fails to boot, you need to logcat and grep for " - not in privapp-permissions whitelist" and add any missing items in the xml
$ adb push C:\Users\username\Desktop\PIxel2_9.0.0_eng_build\privapp-permissions-platform.xml /etc/permissions/privapp-permissions-platform.xml
```
Hello, I'm interested on the Mac os part. I've been building pixel experience on Ubuntu form am external HDD but because it's a 2011 iMac I have USB 2.0 and r/w speeds are really low slowering the whole process. On the internal drive I have a 500gb SSD that I'd like to use for compiling but partitioning is not an option, could you help me setting up enviroment?
PD: I tried setting it up with brew but I am missing dependencies I can't (don't know how) install them with brew, all guides are for Ubuntu or for Mac is but old.
Thank you in advance!
This guide inspired me to setup a Dockerized build and flash environment for the Pixel 5.
Leaving it here as Pixel 3 owners might find it useful: https://github.com/nvllsvm/pixel5-aosp-builder
Draje0 said:
This guide inspired me to setup a Dockerized build and flash environment for the Pixel 5.
Leaving it here as Pixel 3 owners might find it useful: https://github.com/nvllsvm/pixel5-aosp-builder
Click to expand...
Click to collapse
Thanks, this is very helpful! Have you tested the built image on a pixel 5?
ammarr said:
Thanks, this is very helpful! Have you tested the built image on a pixel 5?
Click to expand...
Click to collapse
Yup - it boots and seems to work except for phone call audio (T-Mobile US).
I am having issue, I did this and got:
#### build completed successfully (17:26:44 (hh:mm:ss)) ####
Click to expand...
Click to collapse
flashing claims to have succeeded but when the phone reboots it just goes back to fastboot mode and says "no valid slot too boot to"
The last few lines of output when doing "fastboot flashall -w" are:
Erase successful, but not automatically formatting.
File system type raw not supported.
Erasing 'metadata' OKAY [ 0.007s]
Erase successful, but not automatically formatting.
File system type raw not supported.
Rebooting OKAY [ 0.000s]
Finished. Total time: 82.933s
Click to expand...
Click to collapse
Is the filesystem raw not supported normal? Other than that I am really not sure why this isn't working.
very very handy post, appreciate it, even though i would probably be not building on my own. 20GB smh.. phew!
Anyone know or figure out how to get gapps on this once built (or built-in) without having to have TWRP?
Great guide. I am working on creating a custom rom myself. I've been wondering if it's possible to prevent system apps from being included in the build. There are a few apps that I use f-droid apps in their place (example K9 mail for stock email app) and don't want to see them re-appear when the ROM is updated. If this is not possible, can they be removed from the build before flashing?
Edit ..
Figured it out.
Hi.. I'm Building AOSP 10 for POCO F1(beryllium). i dont know which command should i choose in lunch cause my device isnt listed.. They have only for Pixel Devices.. Pls guide through it
***Key step: Download radio drivers.***
Most tutorials miss this or mention it very subtly. But, without this step the ROM you flash won't boot to the home screen (you will be in the boot loop).
Go to the driver binaries page, and download the right zip files for the Android build version (android-10.0.0_r10) and device (Pixel 3) you chose earlier in the repo command.
You will be downloading two zip files (one vendor image zip and one radio drivers zip), both zips will have on shell script file each (.sh), just put those two files in your repo folder (~aosp/pixel3) and run the scripts. It will download the required proprietary files (after asking you to accept the terms). Do not miss this step.. I lost 3 days trying to find the reason for my ROM not booting up, this was it.***
How can I get this 2 zip files for my Samsung device (SM-A715F). Thank you

Ubuntu Touch for Moto G5

--- This is not made by me. This is an repost to XDA. ---
This is 32-bit, so you can use offical TWRP.
Made by hacker12455 and Lukapanio
Bugs:
Camera and minor bugs
Installation:
(Requires ADB + Fastboot, Linux on the PC and Git)
1. Format the data partition with ext4 (Format != Wipe)
2. Download the latest halium-boot.img from https://sourceforge.net/projects/ubports-cedric/files
3. Run
Code:
fastboot flash boot halium-boot.img
4. Download the latest ubports-touch.rootfs-xenial-armhf.tar.gz from https://ci.ubports.com/job/xenial-rootfs-armhf/
5. Download the latest system.img from https://sourceforge.net/projects/ubports-cedric/files
6. Clone https://gitlab.com/JBBgameich/halium-install git repository and go into that folder
7. Run
Code:
./halium-install -v -p ut path/to/ubports-touch.rootfs-xenial-armhf.tar.gz path/to/system.img
8. Reboot your phone.
9. Run
Code:
dmesg -w
and look for an GNU/Linux device.
10. Connect your computer to the RNDIS network that appeared when you rebooted your phone. (If not already happened.)
11. SSH onto the device:
Code:
ssh [email protected]
12. Follow that guide: http://docs.ubports.com/en/latest/porting/running-ut.html
You made it!
Source: https://github.com/ubports-on-cedric
Download: http://ubports-cedric.sf.net
Fail, ignore
Screenshots!
Note: Visual glitch already fixed, old screenshots.
About this device is coming soon.
Nice, i will try it tomorrow
[censored because imei leak, looking for new screenshot]
@nift4 the broken things are fixable?
lucki1000 said:
@nift4 the broken things are fixable?
Click to expand...
Click to collapse
Sound yes
Why authors are redacted?
nift4 said:
Why authors are redacted?
Click to expand...
Click to collapse
Follow the xda rules - telegram is not allowed on xda nor is the promotion of any other social media
XDA is a place for discussion and building of android projects - if everyone went to telegram the forums would be empty
I'd advise you remove all references to telegram
Done
EDIT: I did not want to break the rules I simply did not made it
Ok, I:
- Flashed the boot image from fastboot mode
- Booted into TWRP because the halium-install script tried to use ADB (there's no ADB in fastboot mode!)
- image flashed, i rebooted and the RNDIS appeared with
Code:
sudo dmesg -w
but ssh connection is refused on port 22, and when I connected with telnet the commands from the last guide (had to use the Wayback Machine, since the actual page doesn't exist anymore) but
Code:
/ # cat /var/lib/lxc/android/rootfs/ueventd*.rc|grep ^/dev|sed -e 's/^\/dev\///'|awk '{
printf "ACTION==\"add\", KERNEL==\"%s\", OWNER=\"%s\", GROUP=\"%s\", MODE=\"%s\"\n",$1,
$3,$4,$2}' | sed -e 's/\r//' >/usr/lib/lxc-android-config/70-cedric.rules
cat: can't open '/var/lib/lxc/android/rootfs/ueventd*.rc': No such file or directory
/bin/sh: can't create /usr/lib/lxc-android-config/70-cedric.rules: nonexistent directory
/ #
So, what am I doing wrong? Is there a more recent version?

Categories

Resources