General Guide for building TWRP - Samsung Galaxy A02s

TWRP for a12s
=============
Mod Edit: TG link removed.
git config --global user.email "your email"
git config --global user.name "your name"
Basic Device Tree
==================
mkdir TWRP
cd TWRP
git init
git clone https://github.com/twrpdtgen/twrpdtgen
pip3 install twrpdtgen
sudo apt install cpio
copy stock recovery.img to ~/TWRP/twrpdtgen
cd twrpdtgen
python3 -m twrpdtgen recovery.img
rename ~/TWRP/twrpdtgen/output/samsung/a12s/omni_a12s.mk to twrp_a12s.mk
delete vendorsetup.sh
Make a copy of recovery.fstab and rename to twrp.flags
Move both files recovery.fstab and twrp.flags to recovery/root/system/etc
(create these folders)
open twrp_a12s.mk and
1. delete the 3 lines below # Inherit from those products, Most specific first.
replace those 3 lines with this
$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk)
2. delete $(call inherit-product, vendor/omni/config/gsm.mk)
3. change omni to twrp (2 places)
open AndroidProducts.mk
change omni to twrp (4 spots)
Optional Extras
==================
To add extra options to recovery you can add theses lines to
boardconfig.mk
• # remove TrueType fonts
• TW_DISABLE_TTF:= true
• # exclude mtp from twrp (disable if you are not able to fix it device/kernel side, saves some space)
• TW_EXCLUDE_MTP := true
• # screen will stay awake
• TW_NO_SCREEN_TIMEOUT := true
• # needed on devices without a recovery partition (some devices have recovery included in boot.img)
• TW_HAS_NO_RECOVERY_PARTITION := true
• # removes the reboot option to boot into bootloader, needed e.g. on samsung devices which use Download mode instead
• TW_NO_REBOOT_BOOTLOADER := true
• # add an option in reboot menu to reboot into Download Mode
• TW_HAS_DOWNLOAD_MODE := true
• # some devices don't have a temp sensor, disable in such case to stop spamming recovery.log
• TW_NO_CPU_TEMP := true
• # recursive delete by default instead fotmatting (available optional inside recovery settings too)
• TW_ALWAYS_RMRF := true
• # system won't be unmounted,
• TW_NEVER_UNMOUNT_SYSTEM := true
• # don't blank screen (available optional inside recovery settings too)
• TW_NO_SCREEN_BLANK := true
• # ToyBox (disables busybox?)
• TW_USE_TOOLBOX := true
• # include f2fs support (make sure your kernel supports f2fs!)
• TARGET_USERIMAGES_USE_F2FS := true
• TW_DEVICE_VERSION : = Your Nikname or else
Establish Android Building Environment
=======================================
cd ~
sudo apt install git aria2 -y
git clone https://gitlab.com/OrangeFox/misc/scripts
cd scripts
sudo bash setup/android_build_env.sh
sudo bash setup/install_android_sdk.sh
• Make a directory called ~/a12s-twrp
cd ~/a12s-twrp
repo init --depth=1 -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git -b twrp-11
repo sync -c --no-clone-bundle --no-tags --optimized-fetch --prune --force-sync -j4
copy ~/TWRP/twrpdtgen/output/samsung to /a12s-twrp/device
Building
========
. build/envsetup.sh
lunch twrp_a12s-eng
mka recoveryimage –j4
Recovery.img at out/Samsung/a12s/...img
Note: This LastPart Failed For Me For Lack Of RAM In My VB
To Add Things To Your Twrp, You Can Find Them On Experienced Dev's Githubs.
For Example
topser9 - Overview
Kernels for Exynos 7884B | 7904 | 9610 | 9611. topser9 has 16 repositories available. Follow their code on GitHub.
github.com
mohammad92 - Overview
mohammad92 has 172 repositories available. Follow their code on GitHub.
github.com
crazo7924 - Overview
Android developer. crazo7924 has 47 repositories available. Follow their code on GitHub.
github.com

Hello! Even though this tutorial is for a specific device (I think, please correct me if i"m wrong), will this work for basically any device? And will this work for devices running Android 11 and 12?

SM-A032F / DS

Related

Build your own Android kernel for Venue?

Hi all,
You know your device configuration!
You can get the source code for Android 2.3.3 from Google: http://source.android.com/source/initializing.html
You have the manuals out there: http://forums.androidcentral.com/ht...how-build-your-own-kernel-package-source.html, http://linuxclues.blogspot.com/2010/05/build-compile-linux-kernel-android.html, and so on...
So, I wonder why there were never been a person here who think about building his own Android 2.3.3 kernel?
With some knowledge about using Linux development tools, I think it's quite feasible for us to do that! Why can't we do that?
Noone's been interested enough to bother, the venue kernel source has been out as long as the device itself
TheManii: thank you for your information. Now with the rooted 4.06 provided by liuhui for backing up(another thread here), I think I am well-encouraged to have a try building a kernel myself.
What might be missed in my build, I think, will be the firmware updates (that are better provided in a formal update.pkg). Am I right?
Hi men,
I read this guide from Dell's guide to build the source:
-------------------------------------------------------------------------------
kernel
1) download source tree of android froyo from Qualcomm.
2) replace kernel
3) build kernel by
. build/envsetup.sh
choosecombo
Does anyone know how to do step 1: "1) download source tree of android froyo from Qualcomm."?
If you dont understand that how to do that I doubt you'd be able to build it sucessfully.
The qualcomm tree is located at code aurora forum's site, I believe the text file also has the specific build fingerprint of the exact version they used at the moment
I found it here, TheManii: https://www.codeaurora.org/xwiki/bin/QAEP/.
Although it might be a tough task, I think it's worth a try. At least I hope I can check whether things on Dell's guide to build Venue works!
I found it here, TheManii: https://www.codeaurora.org/xwiki/bin/QAEP/.
Although it might be a tough task, I think it's worth a try. At least I hope I can check whether things on Dell's guide to build Venue works!
[GUIDE] To build dell venue kernel (& ROM) from source
I faced hard ware problem in my PC when execute make command, the RAM is screaming and PC died before the build complete look like my RAM have big problem. I do best to write a brief guide by expecting someone willing to try to build kernel for this device and probably complete rom. More people involve will create opportunity to have customs kernel and rom for dell venue
Brief Guide to Build DELL VENUE kernel Noob Proof
I. Preparing development Tools
A PC (Desktop or Laptop) with 2 GB Ram (4 GMB or more Ram is preferred), Pentium 4 class Processor or Higher. 40 GB Hard Disk Space. Internet Connection
II. Linux Ubuntu 10.04 i386 (32 bit Platform) is suggested, but other linux distribution and/or amd64 (64 bit Platform) also welcome. Other operating system is not covered by this guide.
III. Reference / links
http://source.android.com/source/initializing.html To set up build environment.
https://www.codeaurora.org/xwiki/bin/QAEP/ everything about build process
http://opensource.dell.com/releases/venue/v4.06/ available source for dell venue.
http://forum.xda-developers.com/forumdisplay.php?f=1013 for discussion forum
Special Preparation on the PC with Ubuntu 10.04 i386 installed.
A.1. Dell venue available kernel source have to be build with Froyo Source Tree (Instructed by build instruction) sun-java5-jdk is mandatory requirement.
Install sun-java5-jdk :
Modified file sources.list repository > open gnome terminal >
$ sudo gedit /etc/apt/sources.list > a text editor (gedit) will opened, add the following line on the file
deb http://archive.ubuntu.com/ ubuntu/ hardy main multiverse
deb http://archive.ubuntu.com/ ubuntu/ hardy-updates main muiltiverse
save and close the text editor.
standard ubuntu repository
Code:
###Repository /etc/apt/sources.list This file
deb http://kambing.ui.ac.id/ubuntu/ lucid main restricted universe multiverse
deb http://kambing.ui.ac.id/ubuntu/ lucid-updates main restricted universe multiverse
deb http://kambing.ui.ac.id/ubuntu/ lucid-backports main restricted universe multiverse
### Sources Repository
deb-src http://kambing.ui.ac.id/ubuntu/ lucid main restricted universe multiverse
deb-src http://kambing.ui.ac.id/ubuntu/ lucid-updates main restricted universe multiverse
deb-src http://kambing.ui.ac.id/ubuntu/ lucid-backports main restricted universe multiverse
## Canonical Partner
deb http://archive.canonical.com/ubuntu lucid partner
deb-src http://archive.canonical.com/ubuntu lucid partner
##Security
deb http://security.ubuntu.com/ubuntu lucid-security main restricted
deb-src http://security.ubuntu.com/ubuntu lucid-security main restricted
deb http://security.ubuntu.com/ubuntu lucid-security universe
deb-src http://security.ubuntu.com/ubuntu lucid-security universe
deb http://security.ubuntu.com/ubuntu lucid-security multiverse
ubuntu 10.04 repository with enbale to install sun-java5-jdk
Code:
###Repository /etc/apt/sources.list This file
deb http://kambing.ui.ac.id/ubuntu/ lucid main restricted universe multiverse
deb http://kambing.ui.ac.id/ubuntu/ lucid-updates main restricted universe multiverse
deb http://kambing.ui.ac.id/ubuntu/ lucid-backports main restricted universe multiverse
### Sources Repository
deb-src http://kambing.ui.ac.id/ubuntu/ lucid main restricted universe multiverse
deb-src http://kambing.ui.ac.id/ubuntu/ lucid-updates main restricted universe multiverse
deb-src http://kambing.ui.ac.id/ubuntu/ lucid-backports main restricted universe multiverse
## Canonical Partner
deb http://archive.canonical.com/ubuntu lucid partner
deb-src http://archive.canonical.com/ubuntu lucid partner
##Security
deb http://security.ubuntu.com/ubuntu lucid-security main restricted
deb-src http://security.ubuntu.com/ubuntu lucid-security main restricted
deb http://security.ubuntu.com/ubuntu lucid-security universe
deb-src http://security.ubuntu.com/ubuntu lucid-security universe
deb http://security.ubuntu.com/ubuntu lucid-security multiverse
deb-src http://security.ubuntu.com/ubuntu lucid-security multiverse
## To Get Java 1.5 on ubuntu 10.04
deb http://archive.ubuntu.com/ubuntu hardy main multiverse
deb http://archive.ubuntu.com/ubuntu hardy-updates main multiverse
undertanding of ubuntu repository, please read THIS GUIDE
On gnome terminal > execute command
$ sudo apt-get update and wait then >
$ sudo apt-get install sun-java5-jdk > and wait.
if you have other java version installed (I.e sun-java6-jdk) > remove sun-java6-jdk by executing command on terminal >
$ sudo apt-get remove sun-java6-jdk
Note – this action is NOT necessary if you know how to handle multiple java version.
A.2. Install additional development tools in your ubuntu :
open gnome terminal
execute a command >
Code:
$ sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev libncurses5-dev x11proto-core-dev libx11-dev libreadline6-dev libgl1-mesa-dev tofrodos python-markdown libxml2-utils xsltproc
execute >
$ sudo apt-get install file-roller p7zip-full p7zip-rar
A.3. Install appropriate Android USB Driver.
You need to do either automatic way or manual way (No need to do both)
I) “Automatic” way Android USD Driver installation > in this situation you will get also adb (android development bridge). This is a suggested and easiest way.
A xda forum member create a script to install ADB and Android USD Driver almost all today available brands.
Download Knives & Forks installation scripts in this links > http://www.bsus.co.id/android/knives-and-forks-12.01.25.zip
[Note : I uploaded knives-and-fork file due to I can not find original download links]
Instruction to set up Android USD Driver along with ADB and fastboot is in the file, just unpack somewhere in your home folder,. Read instruction.txt file
II)Manual way Android USD Driver installation : open gnome terminal > execute command on terminal >
$ sudo gedit /etc/udev/rules.d/99-android-rules >
a BLANK gedit text editor will be opened > copy paste the following items on the blank text editor :
Code:
# ACER
SUBSYSTEM=="usb", SYSFS{idVendor}=="0502", MODE="0666", USER=x, GROUP=x
# ASUS
SUBSYSTEM=="usb", SYSFS{idVendor}=="0b05", MODE="0666", USER=x, GROUP=x
# DELL
SUBSYSTEM=="usb", SYSFS{idVendor}=="413c", MODE="0666", USER=x, GROUP=x
# FOXCONN
SUBSYSTEM=="usb", SYSFS{idVendor}=="0489", MODE="0666", USER=x, GROUP=x
# GARMIN-ASUS
SUBSYSTEM=="usb", SYSFS{idVendor}=="091e", MODE="0666", USER=x, GROUP=x
# Google
SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666", USER=x, GROUP=x
# Hisense
SUBSYSTEM=="usb", SYSFS{idVendor}=="109b", MODE="0666", USER=x, GROUP=x
# HTC
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666", USER=x, GROUP=x
# HUAWEI
SUBSYSTEM=="usb", SYSFS{idVendor}=="12d1", MODE="0666", USER=x, GROUP=x
# K-TOUCH
SUBSYSTEM=="usb", SYSFS{idVendor}=="24e3", MODE="0666", USER=x, GROUP=x
# KT Tech
SUBSYSTEM=="usb", SYSFS{idVendor}=="2116", MODE="0666", USER=x, GROUP=x
# KYOCERA
SUBSYSTEM=="usb", SYSFS{idVendor}=="0482", MODE="0666", USER=x, GROUP=x
# LENEVO
SUBSYSTEM=="usb", SYSFS{idVendor}=="17ef", MODE="0666", USER=x, GROUP=x
# LG
SUBSYSTEM=="usb", SYSFS{idVendor}=="1004", MODE="0666", USER=x, GROUP=x
# MOTOROLA
SUBSYSTEM=="usb", SYSFS{idVendor}=="22b8", MODE="0666", USER=x, GROUP=x
# NEC
SUBSYSTEM=="usb", SYSFS{idVendor}=="0409", MODE="0666", USER=x, GROUP=x
# NOOK
SUBSYSTEM=="usb", SYSFS{idVendor}=="2080", MODE="0666", USER=x, GROUP=x
# NVIDIA
SUBSYSTEM=="usb", SYSFS{idVendor}=="0955", MODE="0666", USER=x, GROUP=x
# OTGV
SUBSYSTEM=="usb", SYSFS{idVendor}=="2257", MODE="0666", USER=x, GROUP=x
# PANTECH
SUBSYSTEM=="usb", SYSFS{idVendor}=="10a9", MODE="0666", USER=x, GROUP=x
# PEGATRON
SUBSYSTEM=="usb", SYSFS{idVendor}=="1d4d", MODE="0666", USER=x, GROUP=x
# PHILIPS
SUBSYSTEM=="usb", SYSFS{idVendor}=="0471", MODE="0666", USER=x, GROUP=x
# PMC-SIERRA
SUBSYSTEM=="usb", SYSFS{idVendor}=="04da", MODE="0666", USER=x, GROUP=x
# QUALCOMM
SUBSYSTEM=="usb", SYSFS{idVendor}=="05c6", MODE="0666", USER=x, GROUP=x
# SK TELESYS
SUBSYSTEM=="usb", SYSFS{idVendor}=="1f53", MODE="0666", USER=x, GROUP=x
# SAMSUNG
SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", MODE="0666", USER=x, GROUP=x
# SHARP
SUBSYSTEM=="usb", SYSFS{idVendor}=="04dd", MODE="0666", USER=x, GROUP=x
# SONY ERICSSON
SUBSYSTEM=="usb", SYSFS{idVendor}=="0fce", MODE="0666", USER=x, GROUP=x
# TOSHIBA
SUBSYSTEM=="usb", SYSFS{idVendor}=="0930", MODE="0666", USER=x, GROUP=x
# ZTE
SUBSYSTEM=="usb", SYSFS{idVendor}=="19d2", MODE="0666", USER=x, GROUP=x
Note : Please make change to USER=x to USER=Your UserName in ubuntu and GROUP=x with GROUP=Your UserName in ubuntu.
save the file and close.
In this state, since you install Android USB Driver Manually, you need an adb which can be found easily by googling. Or you can download the file from this links >
http://www.bsus.co.id/android/adb+fastboot.zip
Unpack adb+fastboot.zip you will have a folder named adb+fastboot with 2 file inside adb and fastboot > open gnome terminal > go into adb+fastboot folder $ cd adb+fastboot.
At gnome terminal [in folder adb+fastboot] execute command >
$ sudo cp adb /usr/bin
$ sudo chmod 755 /usr/bin/adb
$ sudo cp fastboot /usr/bin/
$ sudo chmod 755 /usr/bin/fastboot
by executing above commands adb and fastboot will be available globally in your ubuntu system.
Now you have a PC ready to use as development tools to build dell-venue android kernel. Let's build “special environment” for Dell Venue development :
Downloading Source : Please visit and read : http://source.android.com/source/downloading.html since this guide is refers to the site.
open gnome terminal
in your home/user folder execute command >
$ mkdir dell-venue > create a folder named dell-venue
$ mkdir bin > create a folder named bin
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
after completing all download > execute command >
$ chmod a+x ~/bin/repo
$ PATH=~/bin:$PATH > to make application in folder /home/user/bin available globally.
To avoid every time you want to work with repo command have to execute in terminal > $PATH=~/bin:$PATH will be better to put repo file in ~/bin to available globally by modifying a file named .bashrc [DOTbashrc] in your home/user/ folder. If you dont have the file just copying from /etc folder > in gnome terminal execute command >
$ cp /etc/bash.bashrc /home/user/.bashrc > then execute >
$ gedit .bashrc > a gedit text editor will appear > in the line after last line at opened gedit text editor > type export PATH=~/bin:$PATH
.bashrc file before modified
Code:
...
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi
.bashrc file with modification
Code:
...
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi
export PATH=~/bin:$PATH
Now you have executable application named repo appoint to googlesource git repository.
We need to download all source code special for dell venue with froyo platform from codeaurora website. In the gnome terminal execute command >
$cd ~/dell-venue
$repo init -u git://codeaurora.org/platform/manifest.git -b froyo_almond -m M76XXTSNCJNLYA60401001.xml –repo-url=git://codeaurora.org/tools/repo.git
wait until the downloading complete > and execute command >
$repo sync
wait until the synchronization with server complete. It's depending on your internet connection speed with take about 2-5 hours … LOL
Once the sync completing, your development environment for building dell venue kernel and rom is ready.
Download dell venue source code from links >
http://opensource.dell.com/releases/venue/v4.06/
download all file and save in your dell-venue folder [Just for easy remembering].
open gnome terminal > go to dell-venue folder >
$cd ~/dell-venue
there is a folder named kernel, you can delete this folder or rename the folder due to we will replace this folder with source from dell website. In terminal execute asf :
if you want to delete forever folder named kernel, execute >
$ rm -rf kernel
if you want to rename kernel folder with other name to keep the file available [just in case], execute >
$ mv kernel kernel-old.
Extract dell venue kernel you downloaded in the dell-venue folder
in this stage we have ready environment to build dell venue kernel, the next is to follow build instruction :
1) download source tree of android froyo from Qualcomm (done)
2) replace kernel (done)
3) build kernel by > Please execute
$ . build/envsetup.sh or
$ source build/envstup.sh
$ choosecombo 1 1 msm7201a_surf eng
$ make -j4
-j4 is optional you can try with -j3 if you have 2 processor in the PC (i.e dual core), the clue is processor +1 > core 2 duo = 4 processor thus can use make -j5 and so on..
Code:
ONCE THE BUILD SUCESS in folder working forlder in this example ~/dell-venue/out/target/product/msm7201a_surf will available :
* system.img
* userdata.img
* boot.img
* recovery.img
* ramdisk.img
AND
* update.zip
Flash above file via fastboot with command
$ sudo fastboot -i 0x413c flashall -w OR [flash one by one]
$ sudo fastboot -i 0x413c flash system system.img
$ sudo fastboot -i 0x413c flash userdata userdata.img
$ sudo fastboot -i 0x413c flash boot boot.img
optional
$ sudo fastboot -i 0x413c flash recovery recovery.img
build instruction for other module is in the kernel-build_readme.txt from this link > http://opensource.dell.com/releases/venue/v4.06/ as we see the instruction need to download various "source tree"
kernel > as above
-------------------------------------------------------------------------------
wpa_supplicant
1) download source tree of android froyo from Google.
2) build android by
. build/envsetup.sh
choosecombo (all default option, Product choices are: 2. generic)
make -j4
3) replace external/wpa_supplicant_6
4) mmm external/wpa_supplicant_6/wpa_supplicant
-------------------------------------------------------------------------------
jpeg
1) download source tree of android donut from Google.
2) build android by
. build/envsetup.sh
choosecombo (all default option, Product choices are: 2. generic)
make -j4
3) replace external/jpeg
4) mmm external/jpeg
-------------------------------------------------------------------------------
e2fsprogs
1) download source tree of android donut from Google.
2) build android by
. build/envsetup.sh
choosecombo (all default option, Product choices are: 2. generic)
make -j4
3) replace external/e2fsprogs
4) mmm external/e2fsprogs
-------------------------------------------------------------------------------
webkit
1) download source tree of android donut from Google.
2) build android by
. build/envsetup.sh
choosecombo (all default option, Product choices are: 2. generic)
make -j4
3) replace external/webkit
4) mmm external/webkit
-------------------------------------------------------------------------------
bluez
1) download source tree of android gingerbread from Google.
2) build android by
. build/envsetup.sh
choosecombo (all default option, Product choices are: 2. generic)
make -j4
3) replace external/bluez, and 'export BOARD_HAVE_BLUETOOTH=true'
4) mmm external/bluetooth/glib
mmm external/bluetooth/bluez
-------------------------------------------------------------------------------
Note : to build from gingerbread source tree, we need sun-java6-jdk or higher, then we need to manage the available java in our PC.
my suggestion we build what required sun-java5-jdk first [donut and froyo] after everything running well then install sun-java6-jdk > download source tree for gingerbread and build.
wpa_supplicant > to enable wifi well function to connect access point
bluez > to enable bluetooth well function
jpeg > related to image
webkit > for browser and other component need webkit library
suggestion [for time saving in experiment] build kernel first and test if the kernel alive in the device, then we build other module (wpa_supplicant, bluez, jpeg, webkit for full functionality of device)
I personally need to check my PC with New RAM and will post the build result.
LET'S HAVE FUN
Hey ! Do you have yahoo !///// Can you help me to build kernel step by step "?
MINE IS :
trainhaque_dideple_dayemphe_7593
nguyen_vh said:
Hey ! Do you have yahoo !///// Can you help me to build kernel step by step "?
MINE IS :
trainhaque_dideple_dayemphe_7593
Click to expand...
Click to collapse
my Yahoo : [email protected] but I'm not always online.
I'm New on android kernel compiling matters and also learning how to build rom from source. above guid is step by step. Just follow the step and little googling, you will have complete build. I did, but my pc screaming 4-5 minutes after execute make ... due to RAM damage. I success in building system and have ramdisk.img system.img and userdata.img file. But I need to upload into a server and post here to have help from other user who interesting.
Do you know other ways to build android kernel using android toolchain????
Your guide is possible for me to do because of my slow network speed.
nguyen_vh said:
Do you know other ways to build android kernel using android toolchain????
Your guide is possible for me to do because of my slow network speed.
Click to expand...
Click to collapse
If you wanna to build kernel only and need toolchain for arm-eabi download this ARM EABI TOOLCHAIN extract and install, thus you can use this toolchain to build android kernel or other embeded on arm architecture.
x1123 said:
If you wanna to build kernel only and need toolchain for arm-eabi download this ARM EABI TOOLCHAIN extract and install, thus you can use this toolchain to build android kernel or other embeded on arm architecture.
Click to expand...
Click to collapse
Can you guide me once again?:d
nguyen_vh said:
Can you guide me once again?:d
Click to expand...
Click to collapse
To build kernel only and easy way to get toolchain, better use google prebuilt toolchain which is more reliabe :
download prebuilt > presumed using PC with ubuntu/linux installed. Open terminal and excute :
Code:
- $ git clone https://android.googlesource.com/platform/prebuilt AND press enter
...
after downloading complete. You will have a folder named prebuilt with arm toolchain inside.
- To check the availability of toolchain > on terminal navigate at your home folder (presumed you donwload the prebuilt file at /home/user/prebuilt). toolchain folder located at /home/user/prebuilt/linux-x86/
Code:
$ ls ~/prebuilt/linux-x86/
output is
ccache emulator flex icu-4.4 icu-4.6 sdl swt toolchain
Your toolchain is there
Note :
My suggestion is create a file named armmake at /usr/bin/ to make armmake applicable globally
Code:
$ sudo gedit /usr/bin/armmake
an empty window text editor gedit will come up
copy paste following text to the empty space of text editor
Code:
###
#!/bin/bash
PATH=$PATH:~/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin
make ARCH=arm SUBARCH=arm CROSS_COMPILE=arm-eabi- $1
##
##
save and closed
still on terminal > execute the following command
Code:
$ sudo chmod a+x /usr/bin/armmake
$ sudo chown YOUR-USERNAME /usr/bin/armmake
$ sudo chmod 755 /usr/bin/armmake
anytime anywhere you wish to build arm arch kernel just execute >
Code:
$ armmake menuconfig
$ armmake -j5
$ armmake distclean
... and much more
have nice compiling ...
Hi x1123,
I tried to build Venue kernel from v4.06 source (from Dell OpenSource). What I did was:
Unpack the kernel source code, of course, and Initialize properly a build environment
Grab config.gz from /proc/config.gz (on Olleh 408, to make sure it is a valid .config file)
Build
However, I met the following problem:
Code:
drivers/misc/reset/reset.c:4:71: error: ../../../../../android/kernel/arch/arm/mach-msm/proc_comm.h: No such file or directory
drivers/misc/reset/reset.c: In function 'reset_init':
drivers/misc/reset/reset.c:12: error: implicit declaration of function 'msm_proc_comm'
drivers/misc/reset/reset.c:12: error: 'PCOM_RESET_CHIP' undeclared (first use in this function)
drivers/misc/reset/reset.c:12: error: (Each undeclared identifier is reported only once
drivers/misc/reset/reset.c:12: error: for each function it appears in.)
Okay, it seems that there is something wrong with this file of code. I edited it and correct reset.c with this line:
Code:
#include "../../../arch/arm/mach-msm/proc_comm.h"
Now, the build worked like a charm. I created an update.zip with dhd.ko for /system/lib/modules and boot.img, flashed that file to Venue using TheManii's ported CWM recovery, then reboot with the hope everything will be OK
However, when booting the Dell logo is there, and off, and on just like the phone is continuously reboot. I have no chance to know what is actually happening, and just restored my backed up kernel.
Could you please check whether I missed some point there? Here are the code for splitting ramdisk from Olleh 408:
Code:
# ----- unpack_bootimg.sh
#!/bin/bash
perl ./split_bootimg.pl input/boot.img
# move the two extracted files back to ./input/
mv boot.img-kernel input/boot.img-kernel
mv boot.img-ramdisk.gz input/boot.img-ramdisk.gz
# extract RAM disk and everything to this folder
add-ons/7z x -y input/boot.img-ramdisk.gz -o"input/"
add-ons/7z x -y input/boot.img-ramdisk -o"input/boot.img-ramdisk-details/"
# ----- repack_bootimg.sh
#!/bin/bash
add-ons/mkbootfs input/boot.img-ramdisk-details/ | add-ons/gzip > input/boot.img-ramdisk-new.gz
add-ons/mkbootimg --pagesize 2048 --board venue --cmdline "no_console_suspend=1 console=null androidboot.hardware=venue" --kernel input/zImage --ramdisk input/boot.img-ramdisk-new.gz --base 0x20000000 -o output/boot.img
Regards,
Chacona
chacona said:
Hi x1123,
# move the two extracted files back to ./input/
mv boot.img-kernel input/boot.img-kernel
mv boot.img-ramdisk.gz input/boot.img-ramdisk.gz
# extract RAM disk and everything to this folder
add-ons/7z x -y input/boot.img-ramdisk.gz -o"input/"
add-ons/7z x -y input/boot.img-ramdisk -o"input/boot.img-ramdisk-details/"
# ----- repack_bootimg.sh
#!/bin/bash
add-ons/mkbootfs input/boot.img-ramdisk-details/ | add-ons/gzip > input/boot.img-ramdisk-new.gz
add-ons/mkbootimg --pagesize 2048 --board venue --cmdline "no_console_suspend=1 console=null androidboot.hardware=venue" --kernel input/zImage --ramdisk input/boot.img-ramdisk-new.gz --base 0x20000000 -o output/boot.img
[/CODE]
Regards,
Chacona
Click to expand...
Click to collapse
I have been long time did not log in into XDA. I documented kernel compilation for Venue HERE

Add su and busybox to my aosp 4.0.3

Hello
i've built AOSP from source with no issues for my Maguro. bumped all the proprietary binaries for GPS, BlueTooth, Camera. Everything is working but i am having trouble to add su and busybox.
this is what i am doing in order to add su and busybox
1. git cloned SuperUser in $TOP
Code:
git clone git://github.com/ChainsDD/Superuser.git packages/apps/Superuser
2. copied su and busybox binaries from apex ROM and put them in $TOP/device/samsung/maguro/prebuilt/xbin
3. edited $TOP/device/samsung/maguro/full_maguro.mk
Code:
[email protected]:~$ cat $TOP/device/samsung/maguro/full_maguro.mk
# Copyright (C) 2011 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This file is the build configuration for a full Android
# build for maguro hardware. This cleanly combines a set of
# device-specific aspects (drivers) with a device-agnostic
# product configuration (apps). Except for a few implementation
# details, it only fundamentally contains two inherit-product
# lines, full and maguro, hence its name.
#
# Get the long list of APNs
PRODUCT_COPY_FILES := device/sample/etc/apns-full-conf.xml:system/etc/apns-conf.xml
# Camera
PRODUCT_PACKAGES := \
Camera
# Tell compiler where our prebuilt folder is
DEVICE_PREBUILT := device/samsung/maguro/prebuilt
# Tell compiler to build Superuser.apk
PRODUCT_PACKAGES := \
Superuser
# Include busybox and su binaries
PRODUCT_COPY_FILES += \
$(DEVICE_PREBUILT)/xbin/busybox:system/xbin/busybox \
$(DEVICE_PREBUILT)/xbin/su:system/xbin/su
# This is a script to automatically symlink busybox and su binaries on boot (the code for 91-busybox_linkage.sh is below)
PRODUCT_COPY_FILES += \
$(DEVICE_PREBUILT)/etc/init.d/91-busybox_linkage.sh:system/etc/inti.d/91-busybox_linkage.sh
# Inherit from those products. Most specific first.
$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk)
# This is where we'd set a backup provider if we had one
#$(call inherit-product, device/sample/products/backup_overlay.mk)
# Inherit from maguro device
$(call inherit-product, device/samsung/maguro/device.mk)
# Set those variables here to overwrite the inherited values.
PRODUCT_NAME := full_maguro
PRODUCT_DEVICE := maguro
PRODUCT_BRAND := Android
PRODUCT_MODEL := Full AOSP on Maguro
4. created 91-busybox_linkage.sh in $TOP/device/samsung/maguro/prebuilt/etc/init.d
Code:
[email protected]:~$ cat $TOP/device/samsung/maguro/prebuilt/etc/init.d/91-busybox_linkage.sh
for cmd in $(busybox --list);do ln -s /system/xbin/$cmd $cmd; done; ln -s /system/xbin/su su;
5. set permissions for 91-busybix_linkage.sh
Code:
[email protected]:~/myAOSP/device/samsung/maguro/prebuilt/etc/init.d$ ls -l
total 4 -rwxrwxrwx 1 rascarlo rascarlo 94 2012-02-14 13:52 91-busybox_linkage.sh
6. added https://github.com/C...eruser.x509.pem and https://github.com/C...y/superuser.pk8 in $TOP/build/target/product/security
then i make installclean, make clean, make clobber and then i run make otapackage -j8
but it won't build. i get this as last line in terminal:
Code:
'out/target/common/obj/APPS/Settings_intermediates/classes.dex' as 'classes.dex'...
[email protected]:~/myAOSP$
and scrolling up in terminal i see this error :
Code:
make: *** [out/target/product/maguro/obj/APPS/Superuser_intermediates/package.apk] Error 1
where am i wrong?
can anybody help?
thank you
quite interested in this, as I have a maguro also
Greets!
Maybe you should compile the build first.....then use dsixda's Android Kitchen to add root
Herpderp Defy.
EmoBoiix3 said:
Maybe you should compile the build first.....then use dsixda's Android Kitchen to add root
Herpderp Defy.
Click to expand...
Click to collapse
i compiled the buiild just fine and i would like to not use the kitchen
You need to add the source to packages/apps, then add it to either build/target/product/core.mk or device/*/*/device.mk
would be device/samsung/tuna/device_base.mk for u (yes i know u r building for maguro)
You also need to add the su binary sources to system/su
And for busybox, you might add busybox to external and the compile it
thank you for your reply. let me see i am getting this right.
cdesai said:
You need to add the source to packages/apps....
Click to expand...
Click to collapse
that is
Code:
cd $TOP
git clone git://github.com/ChainsDD/Superuser.git packages/apps/Superuser
... then add it to either build/target/product/core.mk or device/*/*/device.mk
Click to expand...
Click to collapse
that for me would mean add to device/samsung/maguro/device.mk this text?
Code:
# Tell compiler to build Superuser.apk
PRODUCT_PACKAGES := \
Superuser
would be device/samsung/tuna/device_base.mk for u (yes i know u r building for maguro)
Click to expand...
Click to collapse
i have not such file in device/samsung/tuna. and why if i am compiling for maguro?
You also need to add the su binary sources to system/su
Click to expand...
Click to collapse
that is
Code:
cd $TOP
git clone https://github.com/ChainsDD/su-binary.git system/su
And for busybox, you might add busybox to external and the compile it
Click to expand...
Click to collapse
Ok. The su in system/extras gives compile errors so I had to delete it. Superuser.apk compiled without any problems but su isn't in the xbin folder. I think this is giving it errors
LOCAL_MODULE_TAGS := debug, eng
Can anyone help me out?
unstable. Forced Close on a lot of apps.

[Guide] Unsquash and resquash images

Since our the G Watch uses the SquashFS for it's system image, I thought it would be helpful to know, how to modify it (Tested on Ubuntu 16.04).
Download and build googles squashfs tools:
Important: Yes, squashfs-tools/squashfs-tools is correct.
Code:
git clone https://android.googlesource.com/platform/external/squashfs-tools/
cd squashfs-tools/squashfs-tools/
make
Unsquash the image
Important: Use 'sudo' to preserve ownership of files
Code:
sudo unsquashfs -d path/to/unpacked/dir path/to/image
Modify the contents
Resquash
Code:
mksquashfs path/to/unpacked/dir path/to/final/image.img -comp gzip -b 131072 -no-exports
Final things:
There is a difference in blocks if you only unsquash and resquash the image (2869 for the original to 2873 for the resquashed one).
The links are not perfectly recreated, some permissions are lost, and times are modified.
The options for resquasing (-comp gzip -b 131072 -no-exports) are from the output of
Code:
unsquashfs -s path/to/image
You can preview the image and the permissions with
Code:
unsquashfs -ll path/to/image

Help with compiling / porting MultiRom / TWRP for Aquaris E5?

I would like to have a dual boot (Android / Ubuntu Touch) on an Aquaris E5 HD phone ( the Ubuntu Touch variant can be flashed with stock Android and vice versa, see mibqyyo.com/en-articles/2015/09/16/ubuntu-android-installation-process-for-bq-aquaris-e4-5-and-e5 ). ((sorry for the links, new user))
Unfortunately, the instructions from wiki.ubuntu.com/Touch/DualBootInstallation do not work with this phone anymore: it seems that the software in those instructions relies on the device having custom ClockworkMod (CWM) recovery -- and, it seems ClockworkMod does not support this device anymore, if it ever did ( see askubuntu.com/questions/666070/cant-install-ubuntu-touch-dual-boot-on-mobile-stuck-in-waiting-for-device/776357 ).
The only other option I could see for dual boot is MultiROM Manager, unfortunately it fails with "This is unsupported device (Aquaris_E5_HD)!"
However, it is possible to root this phone using a TeamWin Recovery Project (TWRP) custom recovery image ( v3.0.2-0, see mibqyyo.com/comunidad/discussion/77467/how-to-root-a-bq-aquaris-e5-hd-phone ), which seemingly does support this phone. Furthermore, from twrp.me/devices/bqaquarise5hd.html there is a reference to:
Device Tree / files: github.com/TeamWin/android_device_bq_vegetahd - and from there:
Kernel source available on: github.com/bq/aquaris-E5
So, I thought - maybe it would be possible to port / build MultiROM from source, with support for this device? I tried something, and maybe I even got part of the way - unfortunately I cannot get the build to complete, so I hope I can get some assistance here. I will outline the steps I did below. First of all, I use this as my PC:
Code:
$ uname -a
Linux MYPC 4.2.0-38-generic #45~14.04.1-Ubuntu SMP Thu Jun 9 09:27:51 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/issue
Ubuntu 14.04.4 LTS \n \l
Then I looked at github.com/Tasssadar/multirom/wiki/Porting-MultiROM:
Prerequisites
* Android 4.1+ tree
* TWRP ported to your device. There are guides on the internet on how to do that.
* Kernel sources
Downloading sources
Just clone TWRP, MultiROM and libbootimg repos into your Android Tree, the commands would look something like this: [...]
Click to expand...
Click to collapse
I was somewhat puzzled about what this "Android Tree" is, but eventually I guessed it is the Android Open Source Project (AOSP) source code. So, I looked and did this:
source.android.com/source/initializing.html
(Note: http removed from links in code below, because I'm a new user and cannot post links):
Code:
cd /tmp
wget archive.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jre-headless_8u45-b14-1_amd64.deb
wget archive.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jre_8u45-b14-1_amd64.deb
wget archive.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jdk_8u45-b14-1_amd64.deb
sudo dpkg -i openjdk-8-jre-headless_8u45-b14-1_amd64.deb
sudo dpkg -i openjdk-8-jre_8u45-b14-1_amd64.deb
sudo dpkg -i openjdk-8-jdk_8u45-b14-1_amd64.deb
sudo apt-get -f install
# already have libgl1-mesa-dev-lts-wily mesa-common-dev-lts-wily
# so removed libgl1-mesa-dev from list below:
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 ccache \
libxml2-utils xsltproc unzip
sudo apt-get autoremove --purge
wget -S -O - source.android.com/source/51-android.rules | sed "s/<username>/$USER/" | sudo tee >/dev/null /etc/udev/rules.d/51-android.rules
# for the aquaris:
echo "SUBSYSTEM==\"usb\", ATTRidVendor==\"2a47\", ATTRidProduct==\"201d\", MODE=\"0600\", OWNER=\"$USER\"" \
| sudo tee -a /etc/udev/rules.d/51-android.rules
sudo udevadm control --reload-rules
then
source.android.com/source/downloading.html
Code:
mkdir ~/bin
PATH=~/bin:$PATH
curl storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
cd /path/to/src
mkdir AOSP
cd AOSP
repo init -u android.googlesource.com/platform/manifest -b android-4.1.2_r2.1 2>&1 | tee repo.log
repo sync
Note that here, I took the `4.1+` requirement quite literally, so just chose to checkout the last 4.1 branch, `4.1.2_r2.1`.
Also, repo sync took 14+ hours to complete, for my PC+Internet connection combo (!)
With that done, I have this in the directory:
Code:
AOSP$ ls
abi cts docs hardware ndk prebuilts
bionic dalvik external libcore packages repo.log
bootable development frameworks libnativehelper pdk sdk
build device gdk Makefile prebuilt system
Now, at this point, we should be running build/envsetup.sh and lunch; however, that will cause only the default Google devices (Nexus etc) to be recognized. So, here I did cloned the "device tree" (I guess) into the "Android tree":
Code:
AOSP$ mkdir device/bq
AOSP$ git clone github.com/TeamWin/android_device_bq_vegetahd device/bq/vegetahd
AOSP$ chmod +x device/bq/vegetahd/vendorsetup.sh
AOSP$ ls device/bq/vegetahd/
AndroidBoard.mk BoardConfig.mk kernel omni_vegetahd.mk recovery
AndroidProducts.mk device.mk mkbootimg.mk README.md vendorsetup.sh
AOSP$ ls device/samsung/crespo # for comparison
Android.mk full_crespo.mk libsensors recovery
AndroidProducts.mk gps.conf libstagefrighthw recovery.fstab [...]
vendorsetup.sh
and also cloned the Omnirom TWRP recovery sources (note that if you just mv bootable/recovery bootable/old.recovery, then the builds process may also pick some of those files up, so that directory should be deleted, as guides elsewhere recommend):
Code:
AOSP$ rm -rf bootable/recovery
cd bootable
git clone https://github.com/omnirom/android_bootable_recovery.git recovery-twrp
cd ..
Since build/envsetup.sh should be running the vendorsetup.sh when it finds them, after running it, the Aquaris device should be visible:
Code:
AOSP$ source build/envsetup.sh
including device/asus/grouper/vendorsetup.sh
including device/bq/vegetahd/vendorsetup.sh # ***
including device/generic/armv7-a-neon/vendorsetup.sh
including device/generic/armv7-a/vendorsetup.sh
including device/moto/wingray/vendorsetup.sh
including device/samsung/crespo/vendorsetup.sh
including device/samsung/maguro/vendorsetup.sh
including device/ti/panda/vendorsetup.sh
including sdk/bash_completion/adb.bash
AOSP$ lunch
You're building on Linux
Lunch menu... pick a combo:
1. full-eng
2. full_x86-eng
3. vbox_x86-eng
4. full_grouper-userdebug
5. omni_vegetahd-eng # ***
6. mini_armv7a_neon-userdebug
7. mini_armv7a-userdebug
8. full_wingray-userdebug
9. full_crespo-userdebug
10. full_maguro-userdebug
11. full_panda-userdebug
Which would you like? [full-eng] 5
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.1.2
TARGET_PRODUCT=omni_vegetahd
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.2.0-38-generic-x86_64-with-Ubuntu-14.04-trusty
HOST_BUILD_TYPE=release
BUILD_ID=JZO54M
OUT_DIR=out
============================================
Now, it seems that for such an old version like 4.1.2_r2.1, there is no mka command (not found), which should otherwise be ran at this point - however, I can run make instead of it.
Also because it's so old, I get "You are attempting to build with the incorrect version of java. Your version is: openjdk version "1.8.0_45-internal". The correct version is: Java SE 1.6.", which it so happens, I have - but I have to set environment variables. So here I run:
Code:
AOSP$ export RECOVERY_VARIANT=twrp
AOSP$ ANDROID_PRE_BUILD_PATHS=/path/to/jdk1.6.0_45/bin \
ANDROID_JAVA_TOOLCHAIN=/path/to/jdk1.6.0_45/bin \
JAVA_HOME=/path/to/jdk1.6.0_45 \
PATH=/path/to/jdk1.6.0_45/bin:$PATH \
make -j3 recoveryimage
...
target thumb C: adbd <= system/core/adb/log_service.c
make: *** No rule to make target `out/target/product/vegetahd/obj/EXECUTABLES/recovery_intermediates/recovery', needed by `out/target/product/vegetahd/recovery.img'. Stop.
make: *** Waiting for unfinished jobs....
target thumb C: adbd <= system/core/adb/utils.c
... but as you can see, it fails. This was for the Omnirom sources of TWRP recovery.
Then I thought of going back to the Multirom porting, and so did this:
Code:
AOSP$ rm -r bootable/recovery-twrp
git clone github.com/Tasssadar/Team-Win-Recovery-Project.git bootable/recovery
git clone github.com/Tasssadar/multirom.git system/extras/multirom
git clone github.com/Tasssadar/libbootimg.git system/extras/libbootimg
cd system/extras/multirom
git submodule update --init
cd ../../..
Then I checked the touchpad from adb shell as root:
Code:
cat /proc/bus/input/devices
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="mtk-tpd"
P: Phys=
S: Sysfs=/devices/virtual/input/input3
U: Uniq=
H: Handlers=mouse0 event3 cpufreq
B: PROP=2
B: EV=b
B: KEY=10 0 0 0 0 0 0 0 400 0 0 0 0 1000 40000000 100000 0 0 0
B: ABS=6630000 1000003
... so definitely "type b"; then by doing `find /sys | grep uevent` and comparing as in the porting guide, I put together this file as device/bq/vegetahd/mr_init_devices.c:
Code:
#include <stdlib.h>
// These are paths to folders in /sys which contain "uevent" file
// need to init this device.
// MultiROM needs to init framebuffer, mmc blocks, input devices,
// some ADB-related stuff and USB drives, if OTG is supported
// You can use * at the end to init this folder and all its subfolders
const char *mr_init_devices[] =
{
"/sys/devices/platform/mtkfb.0/graphics/fb0",
"/sys/devices/platform/mtkfb.0",
"/sys/devices/platform/mtk-msdc.0",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0boot0",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0boot1",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0rpmb",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p1",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p2",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p3",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p4",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p5",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p6",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p7",
"/sys/devices/platform/mtk-msdc.1",
"/sys/devices/platform/mtk-msdc.1/mmc_host/mmc1",
"/sys/devices/platform/mtk-msdc.1/mmc_host/mmc1/mmc1:0007",
"/sys/devices/platform/mtk-msdc.1/mmc_host/mmc1/mmc1:0007/block/mmcblk1/mmcblk1p1",
"/sys/devices/platform/mtk-msdc.1/mmc_host/mmc1/mmc1:0007/block/mmcblk1",
"/sys/bus/mmc/uevent",
"/sys/bus/mmc/drivers/mmcblk/uevent",
"/sys/bus/sdio/uevent",
"/sys/devices/virtual/input/*",
"/sys/devices/virtual/misc/uinput",
"/sys/devices/platform/mtk-tpd",
"/sys/devices/platform/mtk-kpd",
"/sys/devices/platform/mtk-kpd/input/input0",
"/sys/devices/platform/mtk-kpd/input/input0/event0",
"/sys/devices/platform/mtk-kpd/misc/mtk-kpd",
// for adb
"/sys/devices/virtual/tty/ptmx",
"/sys/devices/virtual/misc/android_adb",
"/sys/devices/virtual/android_usb/android0/f_adb",
"/sys/bus/usb",
NULL // must be NULL-terminated
}
Then I inspected boot.img of the stock Android firmware:
Code:
$ /path/to/bootimg_tools/boot_info /path/to/bq/2.1.0_20151104-0859_E5HD_bq-FW/boot.img
Page size: 2048 (0x00000800)
Kernel size: 3747904 (0x00393040)
Ramdisk size: 615529 (0x00096469)
Second size: 0 (0x00000000)
Board name: fbcdadc
Command line: ''
Base address: 2147483648 (0x80000000)
... and also did:
Code:
mkdir device/bq/vegetahd/mrom-infos/
wget raw.githubusercontent.com/Tasssadar/device_asus_grouper/cm-10.2-mrom/mrom_infos/ubuntu_touch.txt -O device/bq/vegetahd/mrom-infos/ubuntu_touch.txt
... and confirmed paths, and could finally add this to device/bq/vegetahd/BoardConfig.mk :
Code:
#MultiROM config. MultiROM also uses parts of TWRP config
MR_INPUT_TYPE := type_b
MR_INIT_DEVICES := device/bq/vegetahd/mr_init_devices.c
MR_RD_ADDR := 0x82500000
MR_DPI := hdpi
MR_DPI_FONT := 216
MR_FSTAB := device/bq/vegetahd/recovery/etc/twrp.fstab
MR_KEXEC_MEM_MIN := 0x85000000
MR_INFOS := device/bq/vegetahd/mrom_infos
Here, if I run ... make ... (after first exiting the old terminal shell, and repeating envsetup.sh / lunch in a new one), I get "build/core/base_rules.mk:103: *** user tag detected on new module - user tags are only supported on legacy modules. Stop." So, I did these changes:
Code:
# bootable/recovery/Android.mk:
LOCAL_MODULE := recovery
LOCAL_MODULE_TAGS := optional # add
# bootable/recovery/tests/Android.mk:
LOCAL_MODULE := asn1_decoder_test
LOCAL_MODULE_TAGS := optional # add
Then, a ... make ... at this point fails with: "make: *** No rule to make target `out/target/product/vegetahd/system/xbin/busybox', needed by `out/target/product/vegetahd/obj/SHARED_LIBRARIES/libbmlutils_intermediates/teamwin'. Stop.".
Here I found "[DEV]How to compile TWRP touch recovery - Pg. 150 | Android Development and Hacking" ( forum.xda-developers.com/showthread.php?p=65556586 ), and I downloaded busybox.zip from that page - and did:
Code:
AOSP$ unzip busybox.zip
AOSP$ mv busybox external/
Now, the ... make ... at this point is a bit funny, because it will exit not reporting an error, as if it finished:
Code:
AOSP$ ANDROID_PRE_BUILD_PATHS=/path/to/jdk1.6.0_45/bin \
ANDROID_JAVA_TOOLCHAIN=/path/to/jdk1.6.0_45/bin \
JAVA_HOME=/path/to/jdk1.6.0_45 \
PATH=/path/to/jdk1.6.0_45/bin:$PATH \
make -j3 recoveryimage
...
GEN include/usage_compressed.h
GEN include/applet_tables.h
HOSTCC applets/usage_pod
GEN include/bbconfigopts.h
CC applets/applets.o
LD applets/built-in.o
make[1]: Leaving directory `/media/Data1/src/AOSP/external/busybox'
AOSP$
But here it is apparently just done with applets in busybox! So, I try running ... make ... again, and get:
Code:
external/busybox/android/librpc/bindresvport.c:41:13: error: conflicting types for '__set_errno'
bionic/libc/include/errno.h:45:15: note: previous declaration of '__set_errno' was here
This I fix by changing external/selinux/libsepol/include to external/libsepol/include in:
Code:
# external/busybox/Android.mk:
BUSYBOX_C_INCLUDES = \
$(BB_PATH)/include $(BB_PATH)/libbb \
bionic/libc/private \
bionic/libm/include \
bionic/libc \
bionic/libm \
libc/kernel/common \
external/libselinux/include \
external/libsepol/include \
...
... and at this point, ... make ... will fail with:
Code:
external/busybox/android/librpc/pmap_rmt.c:235:8: warning: implicit declaration of function 'inet_makeaddr' [-Wimplicit-function-declaration]
external/busybox/android/librpc/pmap_rmt.c:238:8: warning: implicit declaration of function 'inet_netof' [-Wimplicit-function-declaration]
external/busybox/android/librpc/pmap_rmt.c:235:19: error: incompatible types when assigning to type 'struct in_addr' from type 'int'
Here I found stackoverflow.com/questions/27762475/incompatible-types-when-assigning-to-type-struct-in-addr-from-type-int/27763398, which notes:
The error message is misleading, the function is simply missing from earlier versions of the NDK.
Click to expand...
Click to collapse
So, as a final try, I tried forcing a newer NDK through an environment variable, as in:
Code:
NDK_HOME=/path/to/android-ndk-r10e \
ANDROID_PRE_BUILD_PATHS=/path/to/jdk1.6.0_45/bin \
ANDROID_JAVA_TOOLCHAIN=/path/to/jdk1.6.0_45/bin \
JAVA_HOME=/path/to/jdk1.6.0_45 \
PATH=/path/to/jdk1.6.0_45/bin:$PATH \
make -j3 recoveryimage
... but this fails in exactly the same manner (with "implicit declaration of function 'inet_makeaddr'", etc).
At this point, I really don't know what I should do... Should I:
Try to use the BQ Kernel sources for this device (even if mentioned above, I haven't used them anywhere yet) somewhere (say clone them in the Android tree)? If so - where?
Try to find a busybox for AOSP 4.1.2? If so - what version is OK, and where do I find it?
Try to bump the AOSP repo version up from 4.1.2? If so, what would be the minimum version required so this builds - and would I have to wait 14+ hours again?
... or is there anything else I could try?
Again, I'm mostly interested in building MultiROM and the recovery image (TWRP?) required for it on the Aquaris E5 - but it would be nice to know how to build TWRP proper recovery image as well...
Thanks in advance for any hints...
Me too
I am planning on doing almost the exact same thing you're trying! But I have a few questions:
Have you tried adding --depth 1 to your repo command to reduce the download time?
Have you seen https://forum.xda-developers.com/showthread.php?t=2329228 ? Mainly the local manifest, also to reduce download time
Why do you want to use the lowest version possible? The TWRP device tree is for Android 5.1, so I'll be using that version.

Upstream arm64 kernel for Raspberry Pi 3

Hi all
If you just need Raspberry Pi 3 to run headless linux and unleash its full 64bit power then you can compile vanilla kernel (kernel.org) for Raspberry Pi 3 using this tutorial.
YOU NEED TO USE THIS WITH ARM64 LINUX DISTRIBUTION
I don't know if it's my custom distribution's fault or kernel fault but when I use arm64 kernel on Raspberry Pi's Github then it's panic because fs driver on heavy load.
This tutorial doesn't use u-boot for booting the kernel, instead I use the firmware as it is.
This tutorial has been tested on Ubuntu 16.10, 17.04 host and you just need to copy and paste, it will work.
First of all, you need to setup build environment by using command below (maybe not all of these are necessary but this is how I usually setup my Android build environment and it's work for kernel build too):
Code:
sudo apt update
sudo apt install -y bison bc build-essential flex git-core gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libxml2 libxml2-utils lzop schedtool xsltproc zlib1g-dev g++-multilib gcc-multilib lib32ncurses5-dev lib32z1-dev
Now you need to get the aarch64 toolchain, here I'll use Linaro because it will somewhat improve performance but you can use the gcc-aarch64-linux-gnu if you want.
This code will download Linaro 6.3.1 and extract it to /opt/ for use later on:
Code:
wget http://releases.linaro.org/components/toolchain/binaries/latest/aarch64-linux-gnu/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu.tar.xz
sudo tar -xvf gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu.tar.xz -C /opt/
Now you need to clone kernel source code, this will takes some time on slow connection even though I did make it only clone the latest commit (shadow clone) but without clone the whole history:
Code:
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git --depth=1 -b linux-4.10.y
You can change the linux-4.10.y to another branch if you want, this branch clone will give you the latest version of that particular kernel version (4.10).
Now start the compilation, here I'm using a build machine with 14 cores, you can replace -j14 with your CPU core number for faster build, don't set it to higher than your real CPU core or it will slow your machine down:
Code:
cd linux-stable
mkdir MODULES BOOT
#
# Export necessary variable
#
export CROSS_COMPILE=/opt/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
export ARCH=arm64
#
# Make arm64 default defconfig
#
make defconfig -j14
#
# You must enable FB_SIMPLE or it will not boot
#
sed -i 's/# CONFIG_FB_SIMPLE is not set/CONFIG_FB_SIMPLE=y/g' .config
#
# Here I enable ethernet driver as built-in because you'll need it in some situation like kernel module not loaded
#
sed -i 's/CONFIG_USB_USBNET=m/CONFIG_USB_USBNET=y/g' .config
sed -i 's/CONFIG_USB_NET_SMSC95XX=m/CONFIG_USB_NET_SMSC95XX=y/g' .config
#
# Disable these heavy module which we will not use it at all
#
sed -i 's/CONFIG_DRM_NOUVEAU=m/# CONFIG_DRM_NOUVEAU is not set/g' .config
sed -i 's/CONFIG_DRM_TEGRA=m/# CONFIG_DRM_TEGRA is not set/g' .config
#
# Making the modules, copy it to ./MODULES
#
make modules -j14
make modules_install -j14 INSTALL_MOD_PATH=MODULES/
#
# Making the kernel and dtbs
#
make Image dtbs -j14
#
# It's compiled, copy it to ./BOOT for easy to work with
#
cp ./arch/arm64/boot/Image ./BOOT/Image
cp ./arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dtb ./BOOT/
You should have all the necessary file from build kernel in 2 directory (BOOT, MODULES) if nothing wrong happens.
[INSTALL KERNEL]
Plug the MicroSDcard of Raspberry Pi 3 to your computer and copy ./BOOT/Image and ./BOOT/bcm2837-rpi-3-b.dtb to partition #1 (vfat)
Edit the config.txt and add lines below, edit if already exist, this will: active arm64 mode, use device_tree for boot kernel, use kernel named Image:
Code:
arm_control=0x200
device_tree=bcm2837-rpi-3-b.dtb
kernel=Image
[INSTALL MODULES]
Now you have to mount the Raspberry Pi 3 Linux OS partition (usually is partition #2) to your system to copy file into it
Make backup and delete every directory in /lib/modules/ of OS partition
Copy ./MODULES/lib/modules/* to /lib/modules/ of OS partition using root
Now it's basically done, unmount/safely eject the sdcard and plug it to your Raspberry Pi 3, boot it up.
Modules might not loaded automatically, run this command on Raspberry Pi 3 shell:
Code:
sudo find "/lib/modules" -mindepth 1 -maxdepth 1 -type d | while read DIR; do echo ${DIR}; BASEDIR=$(basename "${DIR}"); echo " *** depmod ${BASEDIR}"; depmod -b "/" -a "${BASEDIR}"; done
Now modules should be loaded and will be loaded automatically on next boot.
Disclaimer:
- Only Kernel 4.9 and above are supported Raspberry Pi 3 AArch64
- Wifi/Bluetooth will not work since driver still haven't implemented
- Other function might not work
Tested/working:
- USB
- Ethernet
- HDMI
- UART
- GPU acceleration

Categories

Resources