[Q] How to make a ROM? - Captivate Q&A, Help & Troubleshooting

Hello everyone.
Now I know this question has been posted before but I didn't get enough help from that so...
Let me explain what I've done...
I appreciate all of the work that the Devs have done, however, I would
love to help them.
I decided to try and build my own ROM. Unfortunately, I'm getting stuck and
am not sure how to proceed.
That is why I am here. I was hoping the wise devs here on XDA could help me
along this path I'm taking.
Here's my goal.
Build a 2.1 rom from source. No modifications at first.
Run this on an Emulator to see how it runs.
Then run it on my phone.
Here are the steps I've taken:
- Installed Ubuntu
- Installed jdk1.5
#sudo gedit /etc/apt/sources.list
-Add these lines
deb http://archive.ubuntu.com/ubuntu/ jaunty multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jaunty multiverse
deb http://archive.ubuntu.com/ubuntu/ jaunty-updates multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jaunty-updates multiverse
-Save and exit
#sudo apt-get update
#sudo apt-get install sun-java5-jdk
#sudo update-java-alternatives -s java-1.5.0-sun
-Install the dev tools
# sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind
# cd ~
# mkdir bin
# curl xxxx://android.git.kernel.org/repo >~/bin/repo
# chmod a+x ~/bin/repo
-Get the android source
# cd ~
# mkdir mydroid
# cd mydroid
# repo init -u git://android.git.kernel.org/platform/manifest.git -b android-2.1_r2
# repo sync
-Download the samsung files from opensource.samsung.com
-Search for SGH-I897 and download the tar
# cd ~/Downloads
# mkdir samsung_files
# mv SGH-I897_OpenSource.tar.gz samsung_files/
# cd samsung_files
# tar xzvf SGH-I897_OpenSource.tar.gz
# tar xvf Platform.tar
-Merge the files together
# cd ~/Downloads/samsung_files/Captivate_eclair
# rsync -a --stats --progress dalvik/ ~/mydroid/dalvik/
# rsync -a --stats --progress external/ ~/mydroid/external/
# rsync -a --stats --progress prebuilt/ ~/mydroid/prebuilt/
# rsync -a --stats --progress vendor/ ~/mydroid/vendor/
-Modify the BoardConfig.mk
# sudo gedit ~/mydroid/build/target/board/generic/BoardConfig.mk
-Add these lines
BOARD_HAVE_BLUETOOTH := true
BT_USE_BTL_IF := true
BT_ALT_STACK := true
BRCM_BTL_INCLUDE_A2DP := true
BRCM_BT_USE_BTL_IF := true
-Compile the ROM
# cd ~/mydroid
# make update-api
# make
Now I browsed through the out directory after the Make was complete
and found some .img files:
ramdisk.img
system.img
userdata.img
userdata-qemu.img
I don't have anything for a Kernel and am confused as to how to
take these files and make a .zip that I can flash through CWM
Any direction from here would be greatly appreciated.
i.e.
How to make this run on an emulator.
How to turn this in to a .zip to flash through CWM
Also some tips on modifying the ROM would be nice

i always assumed it was some sort of magic or wizardry.....but all that **** you just said sounds pretty important, too.

Related

[Q] Compiling a simple kernel module for N1

I followed the instructions listed here to compile the kernel from the source and was successful. Next, I saw some instructions here on how to compile our own loadable kernel modules:
Code:
First we must retrieve and copy the kernel config from our device.
$ cd /path/to/android-sdk/tools
$ ./adk pull /proc/config.gz
$ gunzip ./config.gz
$ cp config /path/to/kernel/.config
Next we have to prepare our kernel source for our module.
$ cd /path/to/kernel
$ make ARCH=arm CROSS_COMPILE=/path/to/android-ndk/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin/arm-eabi- modules_prepare
PREPARING YOUR MODULE FOR COMPILATION
We need to create a Makefile to cross-compile our kernel module. The contents of your Makefile should be similar to the following:
obj-m := modulename.o
KDIR := /path/to/kernel
PWD := $(shell pwd)
CCPATH := /path/to/android-ndk/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin
default:
$(MAKE) ARCH=arm CROSS_COMPILE=$(CCPATH)/arm-eabi- -C $(KDIR) M=$(PWD) modules
COMPILING AND INSTALLING YOUR MODULE
$ cd /path/to/module/src
$ make
$ cd /path/to/android-sdk/tools/
$ ./adb push /path/to/module/src/modulename.ko /sdcard/modulename.ko
RUNNING YOUR MODULE
$ cd /path/to/android-sdk/
$ ./adb shell
$ su
# insmod /sdcard/modulename.ko
When I try executing:
Code:
make ARCH=arm CROSS_COMPILE=/path/to/android-ndk/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin/arm-eabi- modules_prepare
I get an error:
Code:
make: *** No rule to make target `modules_prepare`. Stop.
Can someone please tell me if I am missing something here?
EliteLegend said:
I followed the instructions listed here to compile the kernel from the source and was successful. Next, I saw some instructions here on how to compile our own loadable kernel modules:
Code:
First we must retrieve and copy the kernel config from our device.
$ cd /path/to/android-sdk/tools
$ ./adk pull /proc/config.gz
$ gunzip ./config.gz
$ cp config /path/to/kernel/.config
Next we have to prepare our kernel source for our module.
$ cd /path/to/kernel
$ make ARCH=arm CROSS_COMPILE=/path/to/android-ndk/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin/arm-eabi- modules_prepare
PREPARING YOUR MODULE FOR COMPILATION
We need to create a Makefile to cross-compile our kernel module. The contents of your Makefile should be similar to the following:
obj-m := modulename.o
KDIR := /path/to/kernel
PWD := $(shell pwd)
CCPATH := /path/to/android-ndk/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin
default:
$(MAKE) ARCH=arm CROSS_COMPILE=$(CCPATH)/arm-eabi- -C $(KDIR) M=$(PWD) modules
COMPILING AND INSTALLING YOUR MODULE
$ cd /path/to/module/src
$ make
$ cd /path/to/android-sdk/tools/
$ ./adb push /path/to/module/src/modulename.ko /sdcard/modulename.ko
RUNNING YOUR MODULE
$ cd /path/to/android-sdk/
$ ./adb shell
$ su
# insmod /sdcard/modulename.ko
When I try executing:
Code:
make ARCH=arm CROSS_COMPILE=/path/to/android-ndk/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin/arm-eabi- modules_prepare
I get an error:
Code:
make: *** No rule to make target `modules_prepare`. Stop.
Can someone please tell me if I am missing something here?
Click to expand...
Click to collapse
The topic is old but the reply may be useful for other people:
this is the tipical issue when is missing the .config file which is a defconfig to be taken from /kernelfolder/arch/arm/configs

[MOD] Full Linux (Debian) inside WebTop! v0.2.7 [2012/01/18] [11.30 GMT+2:00]

[size=+4]Take back WebTop![/size]​
Use anythings you can imagine! LibreOffice, Java, Firefox 4, ecc...
[size=+2]WHAT THIS MOD DOES:[/size]
Installing WebTopMOD your awm dock will be populated with 3 new icons: leafpad, lxterminal and a penguin.
Leafpad and lxterminal works inside WebTop but clicking on the penguin you get a Debian menu chrooted http://en.wikipedia.org/wiki/Chroot in a Debian enviroment. In xterm you can use synaptic and apt-get to install anything in this new enviroment.
For example I need gimp:
Code:
# apt-get update //refresh packages list from internet
# apt-get install gimp
# gimp //
Clicking another time on the penguin open another xterm IN THE SAME ENVIROMENT so I can start another program
Code:
# oo-writer //openoffice writer
NOTE: Debian disk contain a Debian stable (squeeze) release, some software could be "outdated", if you would live on the edge change stable to unstable in /etc/apt/sources.list IN CHROOT ENVIRONMENT. DO NOT TRY TO CHANGE REPOSITORY IN ORIGINAL WEBTOP ROOT
Look here (http://www.debian.org/releases/) to understand what differ between Debian branches
For example LibreOffice is not yet in stable branch, so you can install OpenOffice or switch repo to testing or unstable
Firefox is renamed Iceweasel and the latest version in unstable is 3.5 and from experimental 4.0.
REMEMBER THAT 0.x VERSION MEAN THAT THIS SOFTWARE CAN BE BUGGED AND I CONSIDER IT IN ALPHA TESTING
[size=+2]PREREQUISITES:[/size]
- A rooted Atrix
- At least 2GB free in internal memory (could be more or less with the customized installation)
- A little bit terminal knowledge and willpower
- Brain
- Liquorice mojito
[size=+2]INSTALLATION:[/size]
[size=+1][1st way - EASY METHOD][/size]
Prerequisite for this method is:
On your phone: CWM installed
0) Download Debian disk - http://droid.makrit.net/WebTopMOD/WebTopMOD-20110707.7z
1) Unpack in your internal or external storage (path should be /sdcard(-ext)/WebTopMOD/linuxdisk)
Please don't use "adb push" it corrupt big files
2) Download easy-signed.zip - http://www.multiupload.com/C5GEIHDEM0, MIRROR
3) Install using CWM, reboot and enter in WebTop!
Uninstaller for version >=0.2.7 http://www.multiupload.com/18H5OHND90, MIRROR
Uninstaller for version <= 0.2.2 http://www.multiupload.com/W37DT6HJ7X
Uninstaller for version 0.2.1 http://www.multiupload.com/TO6W9X7CBU
Uninstaller for version >= 0.2 http://www.multiupload.com/GLKUZA2KP9
[size=+1][2nd way - CUSTOM METHOD][/size]
Temporary deprecated
Code:
Prerequisite for this method is:
On your computer: have a Debian installation or a Debian live cd or download this file ([url]http://www.multiupload.com/403F0OQEDA[/url] -> 2GB disk in 66MB), unpack it and skip to step 8
On your phone: install a "complete" busybox thought any free market apps and be connected to internet with a wireless network.
[b][On your phone][/b]
0) Start WebTop and leave it opened
[b][On your computer][/b]
1) Create a file with the dimensions that fit your needs using dd (I used this command to create the 2GB file: dd bs=1024 count=1 seek=$((1024*1024*2-1)) if=/dev/zero of=debian)
2) Format the new "disk" using ext3 (mkfs.ext3 debian)
3) Create a folder to mount the disk (mkdir temp)
4) Mount the disk (sudo mount -t ext3 -o loop debian temp)
5) Debootstrap! (sudo debootstrap --foreign --arch armel stable temp [url]http://ftp.debian.org/debian[/url])
6) Wait...
7) Unmount disk (sudo umount temp) and remove temp directory (rmdir temp)
8) Copy debian in your internal storage inside a folder called "DEBIAN" (uppercase without quotes)
[b][On your computer if you are using adb (recommended) or on your phone using terminal emulator, connectbot, ecc)][/b]
9) Open a terminal and type:
Get superuser permissions
[code]
# su
edit sudoers
Code:
# vi /etc/sudoers
You should add "%admin ALL=NOPASSWD: ALL" after the line containing "%admin ALL=(ALL) ALL". You can try typing this:
Please note that if you are using a terminal emulator on your phone escape is bad interpreted by Android using a physical keyboard, you have to send the escape key in another way.
Code:
GkyyPjwwwld3wi
NOPASSWD: [with a space]
[Escape]
:wq!
Now we enter in a more complete and privileged bash
Code:
# /usr/bin/sudo -H -u adas bash
Enable AWM to launch anything
Search→Go To… line 1317
Take this line:
use_profile 3
and turn it into:
use_profile 2
Code:
sudo leafpad /etc/tomoyo/domain_policy.conf
Now you can add any launcher to your AWM, look in easy-signed.zip (/usr/share/applications and /home/michele/easy/home/adas/.gconf/apps/avant-window-navigator)
Mount debian disk:
Code:
# cd /sdcard/DEBIAN
# mkdir root
# sudo mount -t ext3 -o loop=/dev/block/loop7 debian root
Debootstrap! (second stage)
Code:
# sudo chroot root /debootstrap/debootstrap --second-stage
Disable X ACL (in WebTop)
Code:
# export DISPLAY=:0
# xhost +
Enter in the new system
Code:
# sudo cp /etc/hosts /sdcard/DEBIAN/root/etc/hosts
# sudo cp /etc/fstab /sdcard/DEBIAN/root/etc/fstab
# sudo cp /etc/resolv.conf /sdcard/DEBIAN/root/etc/resolv.conf
# sudo mount -o bind /proc /sdcard/DEBIAN/root/proc
# sudo mount -o bind /dev /sdcard/DEBIAN/root/dev
# sudo mount -o bind /dev/pts /sdcard/DEBIAN/root/dev/pts
# sudo mount -o bind /dev/shm /sdcard/DEBIAN/root/dev/shm
# sudo mount -o bind /sys /sdcard/DEBIAN/root/sys
# sudo mount -o bind /var/run/dbus/ /sdcard/DEBIAN/root/var/run/dbus/
# sudo chroot /sdcard/DEBIAN/root /bin/bash
Export X display (in chroot)
Code:
# export DISPLAY=:0
Add Debian main repository
Code:
# echo "deb http://ftp.debian.org/debian/ stable main non-free contrib" > /etc/apt/sources.list
Finish debian installation
Code:
# apt-get update ; apt-get install dbus dialog locales
Configure your locale
Code:
# dpkg-reconfigure locales
Install xterm
Code:
# apt-get install xterm
Run xterm!
Code:
# xterm
Now you can install anything simply using "apt-get install PROGRAM_NAME" or installing synaptic
Before unplug HDMI cable you should exit form chroot environment and unmount the chroot:
Code:
# exit
# sudo umount /sdcard/DEBIAN/root/proc
# sudo umount /sdcard/DEBIAN/root/dev
# sudo umount /sdcard/DEBIAN/root/dev/pts
# sudo umount /sdcard/DEBIAN/root/dev/shm
# sudo umount /sdcard/DEBIAN/root/sys
# sudo umount /sdcard/DEBIAN/root/var/run/dbus
# sudo umount /sdcard/DEBIAN/root
[size=+2]USE:[/size] (ONLY FOR CUSTOM METHOD)
[On your computer if you are using adb or on your phone using terminal emulator, connectbot, ecc)]
9) Open a terminal and type:
Get superuser permissions
Code:
# su
Now we enter in a more complete and privileged bash
Code:
# /usr/bin/sudo -H -u adas bash
Mount debian disk:
Code:
# cd /sdcard/DEBIAN
# sudo mount -t ext3 -o loop=/dev/block/loop7 debian root
Disable X ACL (in WebTop)
Code:
# export DISPLAY=:0
# xhost +
Enter in the new system
Code:
# sudo cp /etc/hosts /sdcard/DEBIAN/root/etc/hosts
# sudo cp /etc/fstab /sdcard/DEBIAN/root/etc/fstab
# sudo cp /etc/resolv.conf /sdcard/DEBIAN/root/etc/resolv.conf
# sudo mount -o bind /proc /sdcard/DEBIAN/root/proc
# sudo mount -o bind /dev /sdcard/DEBIAN/root/dev
# sudo mount -o bind /dev/pts /sdcard/DEBIAN/root/dev/pts
# sudo mount -o bind /dev/shm /sdcard/DEBIAN/root/dev/shm
# sudo mount -o bind /sys /sdcard/DEBIAN/root/sys
# sudo chroot /sdcard/DEBIAN/root /bin/bash
Export X display (in chroot)
Code:
# export DISPLAY=:0
Run xterm!
Code:
# xterm
Before unplug HDMI cable you should exit form chroot environment and unmount the chroot:
Code:
# exit
# sudo umount /sdcard/DEBIAN/root/proc
# sudo umount /sdcard/DEBIAN/root/dev
# sudo umount /sdcard/DEBIAN/root/dev/pts
# sudo umount /sdcard/DEBIAN/root/dev/shm
# sudo umount /sdcard/DEBIAN/root/sys
# sudo umount /sdcard/DEBIAN/root
[/code]
[size=+2]THANKS TO:[/size]
Sogarth - for http://forum.xda-developers.com/showthread.php?t=983208
kennethpenn - for motoblur remove tool! many many thanks!
Chainfire - for Gingerbreak
makr8100 - for http://droid.makrit.net/ mirror
and many other users that works actively to hack this phone!
[size=+2]NOTE:[/size]
- exporting library you can start a lot of programs without starting chroot (obviously mounting the loop device), for example you can use xterm inside WebTop launching
Code:
# LD_LIBRARY_PATH=.:/sdcard/DEBIAN/root/usr/lib /sdcard/DEBIAN/root/usr/bin/xterm
- you can use sd-card replacing /sdcard/DEBIAN to /sdcard-ext/DEBIAN
If you would like to support my work click the this droid
[size=+2]MANY THANKS FOR CONTRIBUTOR:[/size]
Francisco Bravo
Robert Johnson
[size=+2]CHANGELOG:[/size]
v0.2.7 [2012/01/18] [11.30 GMT+2:00]
easy-signed: http://www.multiupload.com/C5GEIHDEM0
uninstaller: http://www.multiupload.com/18H5OHND90
EASY:
- Disabled Tomoyo (no more firefox issues between different webtop versions)
- New uninstaller
v0.2.6 [2011/07/07] [14.15 GMT+2:00]
Debian disk: http://droid.makrit.net/WebTopMOD/WebTopMOD-20110707.7z
easy-signed: http://droid.makrit.net/software/atrix/easy_v0.2.6.zip-signed.zip
EASY:
- binded in chroot tmp folders
- correct typo in missing disk message
- changed umount function (should works fine now!)
- added linuxdisk check (0 size, is a file)
- 2.3.4 compatibility
- cleaned mount function
LINUXDISK:
- added pdmenu and menu
- added device etc mountpoint in /mnt/DEVICE/etc
- dynamic change of resolv.conf (thanks to krkeegan)
- linuxdisk now is ~4gb (4095MB)
- added device etc mountpoint in /mnt/DEVICE/usr
- added plugins folder symlink to use flash player or other plugins between browser (inside and outside chroot) (FLASH DOESN'T WORK YET)
v0.2.5.1b [2011/07/07] [10.15 GMT+2:00]
Debian disk: unmodified
easy-signed: http://www.multiupload.com/ZAPZW2XX45
EASY:
- removed firmware check
- using a newer version of update-binary
v0.2.5 [2011/05/27] [9.30 GMT+2:00]
Debian disk: unmodified
easy-signed: http://www.multiupload.com/F68D73KF26
EASY:
- fixed unmount function
- removed motorola links
- fixed leafpad icon
v0.2.4 [2011/05/26] [20.30 GMT+2:00]
Debian disk: unmodified
easy-signed: http://www.multiupload.com/VI4JEFWLI6
EASY:
- corrected calls to loopdevice function (thanks Cryofix)
- check awm folders existence and fully reset permissions
- set different permissions to linux script, xmessage, lxterminal and WebTopMOD folder
v0.2.3 [2011/05/26] [15.45 GMT+2:00]
Debian disk: unmodified
easy-signed: http://www.multiupload.com/2JAO6F42Z4
EASY:
- corrected typo (remember..) in installation
- make new loop device (avoid conflict)
- renfoced unmount function
- fix permission for linux.desktop (awm launcher)
v0.2.2 [2011/05/25] [22.00 GMT+2:00]
Debian disk: http://www.multiupload.com/DVF6BJGJR3
easy-signed: http://www.multiupload.com/NKSFL81ODW
EASY:
- removed /mnt/androidroot (doesn't work)
- added /mnt/sdcard and /mnt/sdcard-ext
- code clean
- corrected lxterm policy
- replaced backup script
- corrected sudoers replace
- replaced debian with a more generic linux notation
- added check disk existence
- disk can be in sdcard or sdcard-ext
CUSTOM:
- Temporary deprecated (I've no time to update it today)
v0.2.1 [2011/05/25] [10.30]
DebianEnabler: http://www.multiupload.com/F8TMHY8VQA
Images: 2gb: http://www.multiupload.com/A1B6LG9YYF
easy-signed.zip: http://www.multiupload.com/HPA820KCKR
EASY:
- replaced xterm with native lxterminal
- introduced backup original files
- added uninstaller for version >= 0.2 http://www.multiupload.com/GLKUZA2KP9
- added uninstaller for version <= 0.2.1 http://www.multiupload.com/TO6W9X7CBU
v0.2 [2011/05/24] [17.30]
EASY:
DebianEnabler: http://www.multiupload.com/F8TMHY8VQA
Images: 2gb: http://www.multiupload.com/A1B6LG9YYF
easy-signed.zip: http://www.multiupload.com/NHJGJD7E3E
- easy method!
- symbolic link in /mnt/androidroot to real root
- added image already configured with dbus, locales and dialog
- added launcher for debian chroot and xterm in awm
CUSTOM:
- added instruction to make custom launcher in awm
- added instruction to configure locales, dbus and dialog
- corrected chroot adding /var/run/dbus
v0.1 [2011/05/24]
- initial release
Pro. This looks like the real deal (no compromises). I will be waiting for the noob version though
Sent from my MB860 using XDA Premium App
What versions does this work with? 1.8.3, 1.5.7, 1.2.6 ?
XxKILLx3RxX said:
What versions does this work with? 1.8.3, 1.5.7, 1.2.6 ?
Click to expand...
Click to collapse
I used an ATT Atrix with 1.8.3 firmware.
However this guide should be applicable to any atrix (att, bell, ecc) with any firmware...
Can i use ubuntu as the debian system on the pc to do the image, secondly how do i make a 4 or even 6 gb image, thirdly is this similar to the chroot modes?
crnkoj said:
Can i use ubuntu as the debian system on the pc to do the image, secondly how do i make a 4 or even 6 gb image, thirdly is this similar to the chroot modes?
Click to expand...
Click to collapse
6gb:
Code:
dd bs=1024 count=1 seek=$((1024*1024*6-1)) if=/dev/zero of=debian
5gb:
Code:
dd bs=1024 count=1 seek=$((1024*1024*5-1)) if=/dev/zero of=debian
4gb:
Code:
dd bs=1024 count=1 seek=$((1024*1024*4-1)) if=/dev/zero of=debian
3gb:
Code:
dd bs=1024 count=1 seek=$((1024*1024*3-1)) if=/dev/zero of=debian
1gb:
Code:
dd bs=1024 count=1 seek=$((1024*1024*1-1)) if=/dev/zero of=debian
debootstrap from ubuntu
Code:
sudo apt-get install debootstrap
sudo debootstrap --foreign --arch armel squeeze temp http://ftp.debian.org/debian
Thanks man, ill go and try it out within the next few hours. Btw i already have lxterminal working in the webtop, can i use that instead of adb/ terminal emulator to enter those commands?
crnkoj said:
Thanks man, ill go and try it out within the next few hours. Btw i already have lxterminal working in the webtop, can i use that instead of adb/ terminal emulator to enter those commands?
Click to expand...
Click to collapse
Sure! I assumed that on 1.8.3 terminal is not available...
SystemR89 said:
Sure! I assumed that on 1.8.3 terminal is not available...
Click to expand...
Click to collapse
ye thats true, i copied it over from an old /osh dump and it seems to work fine, if you want/need it i can send it to you (only the lxterminal or the whole /osh dump) just started the procedures to get it on.
SystemR89 said:
6gb:
Code:
dd if=/dev/zero of=/data/6GB.swap bs=1024 count=6144000
4gb:
Code:
dd if=/dev/zero of=/data/6GB.swap bs=1024 count=4096000
debootstrap from ubuntu
Code:
sudo apt-get install debootstrap
sudo debootstrap --foreign --arch armel squeeze temp http://ftp.debian.org/debian
Click to expand...
Click to collapse
those commands returned the error:
dd: opening '/data/6GB/swap': No such file or directory
hmm in your first post the one for dding a 2gb file is different as these two.
AWESOME!!
You beat me to it!! I just ordered a Atrix and it's enroute to me over here in Japan... I was thinking I would try to build Gentoo on the webtop somehow.
I have experience there doing the whole bootstrapping thing, but then it hit me-- "How will I compile the programs?" since everything gets made from source and not from RPMs or DEBs in that distro.
Now I am totally chomping at the bit for my Atrix to get here; I am going to experiment using it as my ONLY computer at work, and out and about. I tend to use cloud-based apps even when creating content (I'm a teacher/photographer/web developer) and I feel uneasy about taking my loaded-to-the-gills Macbook on crowded Tokyo trains with me everyday.
Now with your find, I can still manage to do some light graphics work at times in GIMP too maybe?
crnkoj said:
those commands returned the error:
dd: opening '/data/6GB/swap': No such file or directory
hmm in your first post the one for dding a 2gb file is different as these two.
Click to expand...
Click to collapse
ops.. you are right.. corrected!
starrwulfe said:
Now with your find, I can still manage to do some light graphics work at times in GIMP too maybe?
Click to expand...
Click to collapse
I've not tried gimp, but it should works, we have 1gB of ram!
I was thinking how great gentoo would be too. kholk said once he manages to get kexec and a custom kernel to work he will start work for on gentoo to replace the webtop, that ought to be awesome than
Cannot wait to give this a shot! I just need to order a blue tooth mouse and keyboard.
SystemR89 said:
ops.. you are right.. corrected!
Click to expand...
Click to collapse
ya thought so to just change to debian, btw why do you say if in ubuntu you use the squeeze tag and if just debian you use the stable tag when doing the debootstrap?
crnkoj said:
ya thought so to just change to debian, btw why do you say if in ubuntu you use the squeeze tag and if just debian you use the stable tag when doing the debootstrap?
Click to expand...
Click to collapse
I'm not sure that stable tag works with ubuntu..
Wow amazing I will try when I can, will be funny or nice if we can connect the display to a chinese tablet xD so we can get a portable display xD
.......................................................
Sent from my loved atrix ;D
update.zip, multiple size disk and terminal-less installation and usage will be ready in the next hours!
Stay tuned!

[GUIDE] Building An Android Kernel

There are a lot of people out there wondering how to build kernels. It sounds confusing and hard, but once you get the hang of it, it is actually quite easy. I got the jist of it in just a few practices. Now I give all of my information to you, in the simplest, most comprehensible and most noob friendly way I can. In this guide, I will be building the kernel for my phone, the Samsung Galaxy Victory 4G LTE. So make your adjustments where necessary.
What You Will Need:
A linux OS. I now use Ubuntu 14.04 Manjaro, and Manjaro or Arch are preferred. (Ubuntu is easiest)
Patience
(Optional) A boot.img for your device
Required files
Required Files:
Open terminal and paste the following (I assume you already have java and perl and all that jazz):
In Ubuntu/ Debian:
Code:
sudo apt-get install abootimg git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev ia32-libs lib32z1-dev lib32ncurses5-dev gcc-multilib g++-multilib
For Arch/Manjaro, do
Code:
sudo pacman -S gcc git gnupg flex bison gperf sdl wxgtk squashfs-tools curl ncurses zlib schedtool perl-switch zip unzip libxslt python2-virtualenv bc
for 32 and 64 bit systems. For only 64 bit, add the following:
Code:
sudo pacman -S gcc-multilib lib32-zlib lib32-ncurses lib32-readline
Also, abootimg can be installed using
Code:
yaourt -S abootimg-git
For other distros, you may have to modify the command to get the required files, such as using yum
Also, make sure you have setup git and it is ready to go.
Setting Up Folders:
You are going to need a folder to build you kernel in. For this tutorial, I will use my setup: /home/nick/android/kernel/SPH-L300/Kernel. Kernel is the source directory that is made from the source zip and SPH-L300 I will also use a lot, which contains Kernel.
Downloading The Source:
Download the zip from http://opensource.samsung.com/ or from InsanelyCool's stock kernel source. Then I put it in the SPH-L300 folder. Afterwards, unzip it. You should have 2 files, Kernel.tar.gz and Platform.tar.gz. We are going to focus on Kernel.tar.gz, so unzip it. This will make the Kernel folder.
Now, in your terminal, cd to somewhere to keep your toolchains. I keep mine in ~/android/kernel.
Now type
Code:
git clone git://github.com/DooMLoRD/android_prebuilt_toolchains.git toolchains
for the toolchains I used. They should be put in the folder toolchains.
Modifying The Kernel:
Now is the time to modify the kernel. You can apply patches and change governors and frequencies etc here.
Applying a Patch:
The kernel version is 3.0.31. You can upgrade it using patches. Patches can be found here. You have to apply one patch at a time, which is why scripts come in handy when patching multiple times. I am going to show you how to upgrade to 3.0.33, since you can do that without error.
First, download patch-3.0.31-32.bz2 (or .gz) and download patch-3.0.32-33.bz2 (or .gz).
Extract both and move the extracted files into the Kernel source folder.
Cd to this folder in your terminal and type
Code:
patch -p1 < patch-3.0.31-32
. If you get something about
Code:
...assume -R? [n]
just press enter then press y then enter again.
Do the same steps for applying the other patch, just mod the command to work.
Building The Kernel:
Setting Up Environment:
In the Kernel source directory, open the file Makefile and press ctrl-f. Then enter CROSS_COMPILE, and look for CROSS_COMPILE = /xxxxx, where xxxxx is a directory. Change that directory to the toolchain of your choice. **Not all toolchains work!** For me, it would look like: CROSS_COMPILE = /home/nick/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi- for Linaro 4.6.2. Save the file and exit.
Make sure your terminal is in the Kernel source directory.
Kernel Name:
If you want to change the kernel name, in terminal type
Code:
KBUILD_BUILD_VERSION="ROM NAME"
then
Code:
export KBUILD_BUILD_VERSION
.
Compiling It:
Next, type
Code:
export ARCH=arm
into terminal.
Almost there. The next step is to type
Code:
make gogh_defconfig
into terminal.
If you added options such as governors, do
Code:
make menuconfig
to activate them.
Otherwise, type
Code:
make -jx
where x is the number of processes per core. I use
-j2 for a dual core cpu. This takes about 20-30 mins for me. A quad-core Intel cpu takes 4 mins if you use -j5. For Intel, it is the # of cores + 1.
Actually Putting The Kernel Together:
Now that it has built, assuming you have had no errors and the terminal finishes with
Code:
Kernel: arch/arm/boot/zImage is ready
you are ready to assemble the kernel. Cd to outside your Kernel source to the folder that contains it. For me that would be SPH-L300. You are going to need a working boot.img for this phone to speed up this process by a lot. Whether its stock, mine, or Insanelycool's, just paste it into the folder.
In terminal, type
Code:
abootimg -x boot.img
Then
Code:
mkdir initrd && cd initrd && zcat ../initrd.img | cpio -i
And finally
Code:
find . | cpio -o -H newc | gzip > ../initrd.img
This splits the boot.img, and puts the ramdisk in the initrd folder.
Now, navigate to (kernel source)/arch/arm/boot and copy the zImage to where you were before (the SPH-L300 folder for me). When you paste, override the pre-existing zImage.
If you would like to change the splash screen before the bootanimation, swap out initlogo.rle in the initrd folder with the image of you choice. It must be a rle image and must be named initlogo to work. I won't tell you how to convert png's to rle's cuz I am sure you know how to Google.
Now, we actually but the boot.img together. In terminal, type
Code:
cd ../ && abootimg --create boot.img -k zImage -r initrd.img && abootimg --create boot.img -f bootimg.cfg -k zImage -r initrd.img
and make sure you are in the initrd folder. If you get the error updated is too big for Boot Image, use this command:
Code:
cd ../ && abootimg --create boot.img -k zImage -r initrd.img && abootimg --create boot.img -f bootimg.cfg -k zImage -c "bootsize=xxxxxx" -r initrd.img
and replace the x's with the size the kernel wants to be. This will give you a new boot.img in the containing folder (SPH-L300 for me). Now just zip it up and tell the updater-script where to flash it and voila!, you just made you own kernel.
Feel free to ask any questions below.
I WOULD LIKE TO THANK ONE PERSON IN SPECIFIC, AND THAT IS INSANELYCOOL FOR TEACHING ME MOST OF THE STEPS HERE.
please help me a aint got a clue using ubuntu 15.10 withe kernel 4.3
Nick_73 said:
There are a lot of people out there wondering how to build kernels. It sounds confusing and hard, but once you get the hang of it, it is actually quite easy. I got the jist of it in just a few practices. Now I give all of my information to you, in the simplest, most comprehensible and most noob friendly way I can. In this guide, I will be building the kernel for my phone, the Samsung Galaxy Victory 4G LTE. So make your adjustments where necessary.
What You Will Need:
A linux OS. I now use Ubuntu 14.04 Manjaro, and Manjaro or Arch are preferred. (Ubuntu is easiest)
Patience
(Optional) A boot.img for your device
Required files
Required Files:
Open terminal and paste the following (I assume you already have java and perl and all that jazz):
In Ubuntu/ Debian:
Code:
sudo apt-get install abootimg git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev ia32-libs lib32z1-dev lib32ncurses5-dev gcc-multilib g++-multilib
For Arch/Manjaro, do
Code:
sudo pacman -S gcc git gnupg flex bison gperf sdl wxgtk squashfs-tools curl ncurses zlib schedtool perl-switch zip unzip libxslt python2-virtualenv bc
for 32 and 64 bit systems. For only 64 bit, add the following:
Code:
sudo pacman -S gcc-multilib lib32-zlib lib32-ncurses lib32-readline
Also, abootimg can be installed using
Code:
yaourt -S abootimg-git
For other distros, you may have to modify the command to get the required files, such as using yum
Also, make sure you have setup git and it is ready to go.
Setting Up Folders:
You are going to need a folder to build you kernel in. For this tutorial, I will use my setup: /home/nick/android/kernel/SPH-L300/Kernel. Kernel is the source directory that is made from the source zip and SPH-L300 I will also use a lot, which contains Kernel.
Downloading The Source:
Download the zip from http://opensource.samsung.com/ or from InsanelyCool's stock kernel source. Then I put it in the SPH-L300 folder. Afterwards, unzip it. You should have 2 files, Kernel.tar.gz and Platform.tar.gz. We are going to focus on Kernel.tar.gz, so unzip it. This will make the Kernel folder.
Now, in your terminal, cd to somewhere to keep your toolchains. I keep mine in ~/android/kernel.
Now type
Code:
git clone git://github.com/DooMLoRD/android_prebuilt_toolchains.git toolchains
for the toolchains I used. They should be put in the folder toolchains.
Modifying The Kernel:
Now is the time to modify the kernel. You can apply patches and change governors and frequencies etc here.
Applying a Patch:
The kernel version is 3.0.31. You can upgrade it using patches. Patches can be found here. You have to apply one patch at a time, which is why scripts come in handy when patching multiple times. I am going to show you how to upgrade to 3.0.33, since you can do that without error.
First, download patch-3.0.31-32.bz2 (or .gz) and download patch-3.0.32-33.bz2 (or .gz).
Extract both and move the extracted files into the Kernel source folder.
Cd to this folder in your terminal and type
Code:
patch -p1 < patch-3.0.31-32
. If you get something about
Code:
...assume -R? [n]
just press enter then press y then enter again.
Do the same steps for applying the other patch, just mod the command to work.
Building The Kernel:
Setting Up Environment:
In the Kernel source directory, open the file Makefile and press ctrl-f. Then enter CROSS_COMPILE, and look for CROSS_COMPILE = /xxxxx, where xxxxx is a directory. Change that directory to the toolchain of your choice. **Not all toolchains work!** For me, it would look like: CROSS_COMPILE = /home/nick/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi- for Linaro 4.6.2. Save the file and exit.
Make sure your terminal is in the Kernel source directory.
Kernel Name:
If you want to change the kernel name, in terminal type
Code:
KBUILD_BUILD_VERSION="ROM NAME"
then
Code:
export KBUILD_BUILD_VERSION
.
Compiling It:
Next, type
Code:
export ARCH=arm
into terminal.
Almost there. The next step is to type
Code:
make gogh_defconfig
into terminal.
If you added options such as governors, do
Code:
make menuconfig
to activate them.
Otherwise, type
Code:
make -jx
where x is the number of processes per core. I use
-j2 for a dual core cpu. This takes about 20-30 mins for me. A quad-core Intel cpu takes 4 mins if you use -j5. For Intel, it is the # of cores + 1.
Actually Putting The Kernel Together:
Now that it has built, assuming you have had no errors and the terminal finishes with
Code:
Kernel: arch/arm/boot/zImage is ready
you are ready to assemble the kernel. Cd to outside your Kernel source to the folder that contains it. For me that would be SPH-L300. You are going to need a working boot.img for this phone to speed up this process by a lot. Whether its stock, mine, or Insanelycool's, just paste it into the folder.
In terminal, type
Code:
abootimg -x boot.img
Then
Code:
mkdir initrd && cd initrd && zcat ../initrd.img | cpio -i
And finally
Code:
find . | cpio -o -H newc | gzip > ../initrd.img
This splits the boot.img, and puts the ramdisk in the initrd folder.
Now, navigate to (kernel source)/arch/arm/boot and copy the zImage to where you were before (the SPH-L300 folder for me). When you paste, override the pre-existing zImage.
If you would like to change the splash screen before the bootanimation, swap out initlogo.rle in the initrd folder with the image of you choice. It must be a rle image and must be named initlogo to work. I won't tell you how to convert png's to rle's cuz I am sure you know how to Google.
Now, we actually but the boot.img together. In terminal, type
Code:
cd ../ && abootimg --create boot.img -k zImage -r initrd.img && abootimg --create boot.img -f bootimg.cfg -k zImage -r initrd.img
and make sure you are in the initrd folder. If you get the error updated is too big for Boot Image, use this command:
Code:
cd ../ && abootimg --create boot.img -k zImage -r initrd.img && abootimg --create boot.img -f bootimg.cfg -k zImage -c "bootsize=xxxxxx" -r initrd.img
and replace the x's with the size the kernel wants to be. This will give you a new boot.img in the containing folder (SPH-L300 for me). Now just zip it up and tell the updater-script where to flash it and voila!, you just made you own kernel.
Feel free to ask any questions below.
I WOULD LIKE TO THANK ONE PERSON IN SPECIFIC, AND THAT IS INSANELYCOOL FOR TEACHING ME MOST OF THE STEPS HERE.
Click to expand...
Click to collapse
Actually where is the zImage located in output/arch/arm/boot/ or in source/arch/arm/boot/ both the files are different for me
Sent from my SM-G530H using Tapatalk
pradeepreddychimmula said:
Actually where is the zImage located in output/arch/arm/boot/ or in source/arch/arm/boot/ both the files are different for me
Sent from my SM-G530H using Tapatalk
Click to expand...
Click to collapse
The one you made may be a diff size depending on the compression and mods you've done
Sent from my A0001 using Tapatalk
Nick_73 said:
The one you made may be a diff size depending on the compression and mods you've done
Sent from my A0001 using Tapatalk
Click to expand...
Click to collapse
I mean which is the compiled one
Sent from my SM-G530H using Tapatalk
pradeepreddychimmula said:
I mean which is the compiled one
Sent from my SM-G530H using Tapatalk
Click to expand...
Click to collapse
The one u compiled should be the output
Sent from my A0001 using Tapatalk
Nick_73 said:
There are a lot of people out there wondering how to build kernels. It sounds confusing and hard, but once you get the hang of it, it is actually quite easy. I got the jist of it in just a few practices. Now I give all of my information to you, in the simplest, most comprehensible and most noob friendly way I can. In this guide, I will be building the kernel for my phone, the Samsung Galaxy Victory 4G LTE. So make your adjustments where necessary.
What You Will Need:
A linux OS. I now use Ubuntu 14.04 Manjaro, and Manjaro or Arch are preferred. (Ubuntu is easiest)
Patience
(Optional) A boot.img for your device
Required files
Required Files:
Open terminal and paste the following (I assume you already have java and perl and all that jazz):
In Ubuntu/ Debian:
Code:
sudo apt-get install abootimg git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev ia32-libs lib32z1-dev lib32ncurses5-dev gcc-multilib g++-multilib
For Arch/Manjaro, do
Code:
sudo pacman -S gcc git gnupg flex bison gperf sdl wxgtk squashfs-tools curl ncurses zlib schedtool perl-switch zip unzip libxslt python2-virtualenv bc
for 32 and 64 bit systems. For only 64 bit, add the following:
Code:
sudo pacman -S gcc-multilib lib32-zlib lib32-ncurses lib32-readline
Also, abootimg can be installed using
Code:
yaourt -S abootimg-git
For other distros, you may have to modify the command to get the required files, such as using yum
Also, make sure you have setup git and it is ready to go.
Setting Up Folders:
You are going to need a folder to build you kernel in. For this tutorial, I will use my setup: /home/nick/android/kernel/SPH-L300/Kernel. Kernel is the source directory that is made from the source zip and SPH-L300 I will also use a lot, which contains Kernel.
Downloading The Source:
Download the zip from http://opensource.samsung.com/ or from InsanelyCool's stock kernel source. Then I put it in the SPH-L300 folder. Afterwards, unzip it. You should have 2 files, Kernel.tar.gz and Platform.tar.gz. We are going to focus on Kernel.tar.gz, so unzip it. This will make the Kernel folder.
Now, in your terminal, cd to somewhere to keep your toolchains. I keep mine in ~/android/kernel.
Now type
Code:
git clone git://github.com/DooMLoRD/android_prebuilt_toolchains.git toolchains
for the toolchains I used. They should be put in the folder toolchains.
Modifying The Kernel:
Now is the time to modify the kernel. You can apply patches and change governors and frequencies etc here.
Applying a Patch:
The kernel version is 3.0.31. You can upgrade it using patches. Patches can be found here. You have to apply one patch at a time, which is why scripts come in handy when patching multiple times. I am going to show you how to upgrade to 3.0.33, since you can do that without error.
First, download patch-3.0.31-32.bz2 (or .gz) and download patch-3.0.32-33.bz2 (or .gz).
Extract both and move the extracted files into the Kernel source folder.
Cd to this folder in your terminal and type
Code:
patch -p1 < patch-3.0.31-32
. If you get something about
Code:
...assume -R? [n]
just press enter then press y then enter again.
Do the same steps for applying the other patch, just mod the command to work.
Building The Kernel:
Setting Up Environment:
In the Kernel source directory, open the file Makefile and press ctrl-f. Then enter CROSS_COMPILE, and look for CROSS_COMPILE = /xxxxx, where xxxxx is a directory. Change that directory to the toolchain of your choice. **Not all toolchains work!** For me, it would look like: CROSS_COMPILE = /home/nick/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi- for Linaro 4.6.2. Save the file and exit.
Make sure your terminal is in the Kernel source directory.
Kernel Name:
If you want to change the kernel name, in terminal type
Code:
KBUILD_BUILD_VERSION="ROM NAME"
then
Code:
export KBUILD_BUILD_VERSION
.
Compiling It:
Next, type
Code:
export ARCH=arm
into terminal.
Almost there. The next step is to type
Code:
make gogh_defconfig
into terminal.
If you added options such as governors, do
Code:
make menuconfig
to activate them.
Otherwise, type
Code:
make -jx
where x is the number of processes per core. I use
-j2 for a dual core cpu. This takes about 20-30 mins for me. A quad-core Intel cpu takes 4 mins if you use -j5. For Intel, it is the # of cores + 1.
Actually Putting The Kernel Together:
Now that it has built, assuming you have had no errors and the terminal finishes with
Code:
Kernel: arch/arm/boot/zImage is ready
you are ready to assemble the kernel. Cd to outside your Kernel source to the folder that contains it. For me that would be SPH-L300. You are going to need a working boot.img for this phone to speed up this process by a lot. Whether its stock, mine, or Insanelycool's, just paste it into the folder.
In terminal, type
Code:
abootimg -x boot.img
Then
Code:
mkdir initrd && cd initrd && zcat ../initrd.img | cpio -i
And finally
Code:
find . | cpio -o -H newc | gzip > ../initrd.img
This splits the boot.img, and puts the ramdisk in the initrd folder.
Now, navigate to (kernel source)/arch/arm/boot and copy the zImage to where you were before (the SPH-L300 folder for me). When you paste, override the pre-existing zImage.
If you would like to change the splash screen before the bootanimation, swap out initlogo.rle in the initrd folder with the image of you choice. It must be a rle image and must be named initlogo to work. I won't tell you how to convert png's to rle's cuz I am sure you know how to Google.
Now, we actually but the boot.img together. In terminal, type
Code:
cd ../ && abootimg --create boot.img -k zImage -r initrd.img && abootimg --create boot.img -f bootimg.cfg -k zImage -r initrd.img
and make sure you are in the initrd folder. If you get the error updated is too big for Boot Image, use this command:
Code:
cd ../ && abootimg --create boot.img -k zImage -r initrd.img && abootimg --create boot.img -f bootimg.cfg -k zImage -c "bootsize=xxxxxx" -r initrd.img
and replace the x's with the size the kernel wants to be. This will give you a new boot.img in the containing folder (SPH-L300 for me). Now just zip it up and tell the updater-script where to flash it and voila!, you just made you own kernel.
Feel free to ask any questions below.
I WOULD LIKE TO THANK ONE PERSON IN SPECIFIC, AND THAT IS INSANELYCOOL FOR TEACHING ME MOST OF THE STEPS HERE.
Click to expand...
Click to collapse
How to covert zImage- to boot.img
Sent from my SM-G530H using Tapatalk
pradeepreddychimmula said:
How to covert zImage- to boot.img
Sent from my SM-G530H using Tapatalk
Click to expand...
Click to collapse
It tells u in the instructions how to put the zImage into the boot.img
Sent from my 1+ One using Tapatalk
Fantastic guide. Much appreciated!!! Thank you.
Now if i need to compile a custom kernel, i know where to look at.
Nick_73 said:
(I assume you already have java and perl and all that jazz)
Click to expand...
Click to collapse
it's not noob friendly. how do i know about other stuff that required for compiling?
Thank's for this tutorial. I have a Unbuntu box with 4Gig RAM and I'm interested in trying this out. Would that be sufficient for compiling android or should I upgrade my machine first?
Hello,
I'm compiling this kernel https://github.com/MiCode/Xiaomi_Kernel_OpenSource/tree/ido-l-oss
But the kernel stop booting as it doesn't found a sound card.
Running ls /dev/snd return only timer while it will have some pcm and other device in stock kernel.
Can somebody point me where to look at?
Thanks
Sent from my Redmi 3 using XDA Labs
can I have one?
can I have a copy of the Victory's rom o.o it sounds AWESOME
Soory but I am newbie building kernels for every device is same thanks in advance

[GUIDE] Android One (Sprout) Making Kernel's or ROM's in Simple Way [NOOB FRIENDLY]

Post is Influenced from @Anik_khan Kernel Post to make Procedure More Simple for Us All.
So Don't BE Shocked to see Things
Prerequisites:
Ubuntu 14.04 Trusty Tahr 64 Bit. (Can be on VirtualBox or Full Install Your Wish.)
RAM Minimum:2GB Recommended:4GB
Around 100GB Space for ROM’s. (Kernels can use upto 1GB.)
Unlimited (Fast) LAN Connection.
More RAM, or faster CPU, or SSD will speed up the process.
A Brain (Most Important of All :v)
At the starting of the post I have linked a script by @akhilnarang which if run will automatically install all these programs for lazy people.
If you not interested to do all procedure from below just use the script. Simply it will automatically configure the build environment.
NOTE-------- some of these packages may already be on your machine. Obviously, if you complete a step and you have one of these installed, the machine simply will not do anything. So...it will not hurt anything. Some of the packages are different from Ubuntu 12.04 and 13.04 (use these packages for Ubuntu 14.04 as many of the old ones have obsoleted - these are new replacements).
So if you set up your pc with Ubuntu we are good to go.
All code will be in code boxes like this:
Code:
$
means you have to run that command in the terminal (don't type the $).
All commands with sudo, gksudo, or gksu means it requires root permission.
It will ask for password.
Once you type, then in that terminal session it will not ask you for a few minutes again.
Any time you make changes to .bashrc or .profile file, make sure to run
Code:
$ source ~/.bashrc
$ source ~/.profile
Or exit and open new terminal else the changes will not take place
Setting Up Build Environment
Method 1:
So if you not interested in doing below all steps then simply use this script by my friend @akhilnarang
Open terminal and type:
Code:
$ sudo apt-get install git-core
then do
Code:
$ git clone https://github.com/akhilnarang/scripts.git
$ cd scripts
$ . build-environment-setup.sh
This script will install all required packages
Method 2:
1)Installing Java JDK
Open terminal (CTRL + ALT + T)
Then execute the following commands in terminal one by one:
Download & install java
Code:
$ sudo apt-get update && sudo apt-get install openjdk-7-jdk openjdk-7-jre
CHECK if java properly installed or not
Code:
$ java -version
If you get output like
Code:
Code:
java version "1.7.0_79" or anything higher(in my case)
on the first line then all is good
Now JDK is configured!
Note: Only for Ubuntu 14.04 or higher
2)Installing Required Packages
Open Terminal
Now execute this command:
Note: This will take some time, has to download about 500MB or so of packages
Code:
$ sudo apt-get update && sudo apt-get install git-core python gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.8-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev openjdk-7-jdk pngcrush schedtool \
libxml2 libxml2-utils xsltproc lzop libc6-dev schedtool g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline-gplv2-dev gcc-multilib liblz4-* android-tools-adb android-tools-fastboot ccache
3)Installing Android SDK
Download the SDK from here!
Accept Terms & download 64 bit.
Extract in your home directory & rename extracted folder "android-sdk".
Now, execute these commands in terminal:
Code:
$ cd ~/android-sdk/tools/
$ ./android sdk
At this point the SDK should come up and you will need to download at least all the tools and all the extras files (at least to 4.0, so select them and install them.When it finishes downloading & installing everything you have to run this command in ANOTHER TERMINAL:
Code:
$ sudo apt-get install gksudo
$ gksu gedit .bashrc
And you need to add at the end of it your SDK paths these three lines (copy and paste them):
Code:
export PATH=~/android-sdk/tools:$PATH
export PATH=~/android-sdk/platform-tools:$PATH
export PATH=~/bin:$PATH
Save and close the file, then close terminal, or
Code:
source ~/.bashrc
Find your .profile file and add this at the bottom of the file
Code:
PATH="$HOME/android-sdk/tools:$HOME/android-sdk/plartform-tools:$PATH"
SDK is configured.
4)Configuring USB Access
Now we need to set permissions so that our USB ports can detect our android devices
Type in the following commands, it will download a file with the permissions, give it permission to execute, and restart the service.
Code:
$ sudo curl --create-dirs -L -o /etc/udev/rules.d/51-android.rules -O -L https://raw.githubusercontent.com/snowdream/51-android/master/51-android.rules
$ sudo chmod 644 /etc/udev/rules.d/51-android.rules
$ sudo chown root. /etc/udev/rules.d/51-android.rules
$ sudo service udev restart
$ sudo killall adb
ADB & Fastboot are configured
5)Installing Repo Package
Open terminal and type:
Code:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
6)Configure Git
Open terminal and type:
Code:
$ git config --global user.email ""
$ git config --global user.name ""
Git is configured.
7)Configure ccache
Open terminal and type:
Code:
$ gksu gedit ~/.bashrc
Enter these lines
Code:
export USE_CCACHE=1
export CCACHE_DIR=~/.ccache
Save & close
Open terminal & execute:
Code:
$ source .bashrc
$ ccache -M 50G
I usually use 50 gigs. You can use more if you have more space, or build for many devices
Congrats
YOUR BUILD ENVIROMENT IS NOW SETUP .
Making Kernel
Good work !!! Waiting for completion
Sent from my Moto G using Tapatalk
Thread closed per OPs request

[Guide] Build ASOP from source with Ubuntu 14.04 64bit

First let me give you some background information before we start. I know there are guides out there but I found them all to be incomplete either missing a step here or there that is why I am posting this guide. After a lot of trial and error I tried to make the process as simple as it can be. This guide is for Ubuntu 14.04 64bit Desktop or Server version. This guide might work on other distros but I cannot guarantee it. This guide is designed to build the AOSP rom from Google source jellybean to lollipop. I highly recommend doing this on a remote server, like a vps or dedicated box. This guide is for root users if your not root then you may need to use "sudo" on many of the commands.
## Disclaimer I am not responsible for anything that happens to your device this is a guide only. I am not a master developer or linux guru if you have questions I will try to answer them best I can. ##
Most important command if your on a remote machine this will keep the process going if you get disconnected.
screen
## Establishing a Build Environment ##
# Java Install
apt-get update
apt-get upgrade (upgrades all the packages installed on system that have updates)
apt-get install openjdk-7-jdk (Lollipop)
apt-get install openjdk-6-jdk (KitKat or older)
# Optionally, update the default Java version by running:
update-alternatives --config java
update-alternatives --config javac
# Check if JAVA is Installed
java -version
# You should see something like this depending on the version you installed.
java version "1.7.0_91"
OpenJDK Runtime Environment (IcedTea 2.6.3) (7u91-2.6.3-0ubuntu0.14.04.1)
OpenJDK 64-Bit Server VM (build 24.91-b01, mixed mode)
# Installing required packages
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 libgl1-mesa-dev libxml2-utils xsltproc unzip python-networkx libswitch-perl schedtool
## Downloading the Source ##
# To install Repo:
Make sure you have a bin/ directory in your home directory and that it is included in your path:
mkdir ~/bin
PATH=~/bin:$PATH
# Download the Repo tool and ensure that it is executable:
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
# Initializing a Repo client
# After installing Repo, set up your client to access the Android source repository:
# Create an empty directory to hold your working files. Give it any name you like:
mkdir WORK
cd WORK
git config --global user.email "useyourrealemail"
git config --global user.name "usearealname"
repo init -u https://android.googlesource.com/platform/manifest
To check out a branch other than "master", specify it with -b. For a list of branches, see Source Code Tags and Builds.
repo init -u https://android.googlesource.com/platform/manifest -b android-5.1.1_r1 ( To build only Lollipop. I suggest this option for most)
## Downloading the Android Source Tree ##
# To pull down the Android source tree to your working directory from the repositories as specified in the default manifest, run
repo sync -j4
# The Android source files will be located in your working directory under their project names. This takes anywhere from 15 minutes to a few hours depending on your internet connection. (Thats why I recommend building on a remote machine)
## Binaries ##
# Extracting the proprietary binaries
# Each set of binaries comes as a self-extracting script in a compressed archive. After uncompressing each archive, run the included self-extracting script from the root of the source tree, confirm that you agree to the terms of the enclosed license agreement, and the binaries and their matching makefiles will get installed in the vendor/ hierarchy of the source tree.
https://developers.google.com/android/nexus/drivers
# Nexus 7 (Wi-Fi) binaries for Android 4.1.2
Code:
wget -c https://dl.google.com/dl/android/aosp/broadcom-grouper-jzo54k-26240daf.tgz && wget -c wget -c https://dl.google.com/dl/android/aosp/elan-grouper-jzo54k-c889b8f4.tgz && wget -c wget -c https://dl.google.com/dl/android/aosp/invensense-grouper-jzo54k-aae1cd0c.tgz && wget -c wget -c https://dl.google.com/dl/android/aosp/nvidia-grouper-jzo54k-56de148f.tgz && wget -c wget -c https://dl.google.com/dl/android/aosp/nxp-grouper-jzo54k-4bfb1fb6.tgz && wget -c wget -c https://dl.google.com/dl/android/aosp/widevine-grouper-jzo54k-aca0e725.tgz
for f in *.tgz; do tar xzf $f; done
for extractor_script in *.sh; do bash $extractor_script; done
Please ACCEPT each one by typing I ACCEPT
# Nexus 7 (Wi-Fi) binaries for Android 4.2/4.2.1
Code:
wget -c https://dl.google.com/dl/android/aosp/broadcom-grouper-jop40c-1bf6a3d7.tgz && wget -c https://dl.google.com/dl/android/aosp/elan-grouper-jop40c-3c485b17.tgz && wget -c https://dl.google.com/dl/android/aosp/invensense-grouper-jop40c-9f366366.tgz && wget -c https://dl.google.com/dl/android/aosp/nvidia-grouper-jop40c-1a641dd0.tgz && wget -c https://dl.google.com/dl/android/aosp/nxp-grouper-jop40c-e072af0d.tgz && wget -c https://dl.google.com/dl/android/aosp/widevine-grouper-jop40c-ef747ec3.tgz
for f in *.tgz; do tar xzf $f; done
for extractor_script in *.sh; do bash $extractor_script; done
Please ACCEPT each one by typing I ACCEPT
# Nexus 7 (Wi-Fi) binaries for Android 4.2.2
Code:
wget -c https://dl.google.com/dl/android/aosp/asus-grouper-jdq39-b6907aa5.tgz && wget -c https://dl.google.com/dl/android/aosp/broadcom-grouper-jdq39-4a9b93a2.tgz && wget -c https://dl.google.com/dl/android/aosp/elan-grouper-jdq39-82c8d127.tgz && wget -c https://dl.google.com/dl/android/aosp/invensense-grouper-jdq39-28df082f.tgz && wget -c https://dl.google.com/dl/android/aosp/nvidia-grouper-jdq39-738059f9.tgz && wget -c ]https://dl.google.com/dl/android/aosp/nxp-grouper-jdq39-28a5fe9a.tgz && wget -c https://dl.google.com/dl/android/aosp/widevine-grouper-jdq39-73fc49a2.tgz
for f in *.tgz; do tar xzf $f; done
for extractor_script in *.sh; do bash $extractor_script; done
Please ACCEPT each one by typing I ACCEPT
# Nexus 7 (Wi-Fi) binaries for Android 4.3
Code:
wget -c https://dl.google.com/dl/android/aosp/asus-grouper-jwr66y-d9ad928d.tgz && wget -c https://dl.google.com/dl/android/aosp/broadcom-grouper-jwr66y-af694cc9.tgz && wget -c https://dl.google.com/dl/android/aosp/elan-grouper-jwr66y-2ece01e1.tgz && wget -c https://dl.google.com/dl/android/aosp/invensense-grouper-jwr66y-f21f0c49.tgz && wget -c https://dl.google.com/dl/android/aosp/nvidia-grouper-jwr66y-b3b0003e.tgz && wget -c https://dl.google.com/dl/android/aosp/nxp-grouper-jwr66y-f5d295e4.tgz && wget -c https://dl.google.com/dl/android/aosp/widevine-grouper-jwr66y-a0b9cafc.tgz
for f in *.tgz; do tar xzf $f; done
for extractor_script in *.sh; do bash $extractor_script; done
Please ACCEPT each one by typing I ACCEPT
# Nexus 7 (Wi-Fi) binaries for Android 4.4
Code:
wget -c https://dl.google.com/dl/android/aosp/asus-grouper-krt16s-286ffbbf.tgz&& wget -c https://dl.google.com/dl/android/aosp/broadcom-grouper-krt16s-2461febe.tgz && wget -c https://dl.google.com/dl/android/aosp/elan-grouper-krt16s-4b37aa74.tgz && wget -c https://dl.google.com/dl/android/aosp/invensense-grouper-krt16s-d5bdd039.tgz&& wget -c https://dl.google.com/dl/android/aosp/nvidia-grouper-krt16s-2e8efaff.tgz && wget -c https://dl.google.com/dl/android/aosp/nxp-grouper-krt16s-fe4b53e1.tgz && wget -c https://dl.google.com/dl/android/aosp/widevine-grouper-krt16s-68751697.tgz
for f in *.tgz; do tar xzf $f; done
for extractor_script in *.sh; do bash $extractor_script; done
Please ACCEPT each one by typing I ACCEPT
# Nexus 7 (Wi-Fi) binaries for Android 4.4.2
Code:
wget -c https://dl.google.com/dl/android/aosp/asus-grouper-kot49h-2567c00c.tgz && wget -c https://dl.google.com/dl/android/aosp/broadcom-grouper-kot49h-45c0c43a.tgz && wget -c https://dl.google.com/dl/android/aosp/elan-grouper-kot49h-d3cda89d.tgz && wget -c https://dl.google.com/dl/android/aosp/invensense-grouper-kot49h-2f4def27.tgz && wget -c https://dl.google.com/dl/android/aosp/nvidia-grouper-kot49h-73d2765c.tgz && wget -c https://dl.google.com/dl/android/aosp/nxp-grouper-kot49h-6d4f389b.tgz && wget -c https://dl.google.com/dl/android/aosp/widevine-grouper-kot49h-51d2ed4b.tgz
for f in *.tgz; do tar xzf $f; done
for extractor_script in *.sh; do bash $extractor_script; done
Please ACCEPT each one by typing I ACCEPT
# Nexus 7 (Wi-Fi) binaries for Android 4.4.3
Code:
wget -c https://dl.google.com/dl/android/aosp/asus-grouper-ktu84l-8dde86d9.tgz && wget -c https://dl.google.com/dl/android/aosp/broadcom-grouper-ktu84l-079650ef.tgz && wget -c https://dl.google.com/dl/android/aosp/elan-grouper-ktu84l-caa1c219.tgz && wget -c https://dl.google.com/dl/android/aosp/invensense-grouper-ktu84l-fae837a0.tgz&& wget -c https://dl.google.com/dl/android/aosp/nvidia-grouper-ktu84l-22d95d44.tgz && wget -c https://dl.google.com/dl/android/aosp/nxp-grouper-ktu84l-ece658d1.tgz && wget -c https://dl.google.com/dl/android/aosp/widevine-grouper-ktu84l-f3760dae.tgz
for f in *.tgz; do tar xzf $f; done
for extractor_script in *.sh; do bash $extractor_script; done
Please ACCEPT each one by typing I ACCEPT
# Nexus 7 (Wi-Fi) binaries for Android 4.4.4
Code:
wget -c https://dl.google.com/dl/android/aosp/asus-grouper-ktu84p-b12ce5f7.tgz && wget -c https://dl.google.com/dl/android/aosp/broadcom-grouper-ktu84p-646d5a68.tgz && wget -c https://dl.google.com/dl/android/aosp/elan-grouper-ktu84p-742223b3.tgz && wget -c https://dl.google.com/dl/android/aosp/invensense-grouper-ktu84p-724c855a.tgz && wget -c https://dl.google.com/dl/android/aosp/nvidia-grouper-ktu84p-e6d581dc.tgz && wget -c https://dl.google.com/dl/android/aosp/nxp-grouper-ktu84p-27abae08.tgz && wget -c https://dl.google.com/dl/android/aosp/widevine-grouper-ktu84p-57b01f77.tgz
for f in *.tgz; do tar xzf $f; done
for extractor_script in *.sh; do bash $extractor_script; done
Please ACCEPT each one by typing I ACCEPT
# Nexus 7 (Wi-Fi) binaries for Android 5.0
Code:
wget -c https://dl.google.com/dl/android/aosp/asus-grouper-lrx21p-896ccd01.tgz && wget -c https://dl.google.com/dl/android/aosp/broadcom-grouper-lrx21p-1220d525.tgz && wget -c https://dl.google.com/dl/android/aosp/elan-grouper-lrx21p-a53f697e.tgz && wget -c https://dl.google.com/dl/android/aosp/invensense-grouper-lrx21p-4a1a3ab1.tgz && wget -c https://dl.google.com/dl/android/aosp/nvidia-grouper-lrx21p-c4905f19.tgz && wget -c https://dl.google.com/dl/android/aosp/nxp-grouper-lrx21p-d0465c3c.tgz && wget -c https://dl.google.com/dl/android/aosp/widevine-grouper-lrx21p-78877346.tgz
for f in *.tgz; do tar xzf $f; done
for extractor_script in *.sh; do bash $extractor_script; done
Please ACCEPT each one by typing I ACCEPT
# Nexus 7 (Wi-Fi) binaries for Android 5.0.2
Code:
wget -c https://dl.google.com/dl/android/aosp/asus-grouper-lrx22g-aec33ad2.tgz && wget -c https://dl.google.com/dl/android/aosp/broadcom-grouper-lrx22g-c7f54ba9.tgz && wget -c https://dl.google.com/dl/android/aosp/elan-grouper-lrx22g-580da07a.tgz && wget -c https://dl.google.com/dl/android/aosp/invensense-grouper-lrx22g-fd3690aa.tgz && wget -c https://dl.google.com/dl/android/aosp/nvidia-grouper-lrx22g-1d3281e3.tgz && wget -c https://dl.google.com/dl/android/aosp/nxp-grouper-lrx22g-93aec176.tgz && wget -c https://dl.google.com/dl/android/aosp/widevine-grouper-lrx22g-179aea10.tgz
for f in *.tgz; do tar xzf $f; done
for extractor_script in *.sh; do bash $extractor_script; done
Please ACCEPT each one by typing I ACCEPT
# Nexus 7 (Wi-Fi) binaries for Android 5.1.0
Code:
wget -c https://dl.google.com/dl/android/aosp/asus-grouper-1743759-83e8c08c.tgz && wget -c https://dl.google.com/dl/android/aosp/broadcom-grouper-1743759-48f4fdc9.tgz && wget -c https://dl.google.com/dl/android/aosp/elan-grouper-1743759-9f5eb659.tgz && wget -c https://dl.google.com/dl/android/aosp/invensense-grouper-1743759-744cc938.tgz && wget -c https://dl.google.com/dl/android/aosp/nvidia-grouper-1743759-a1088a38.tgz&& wget -c https://dl.google.com/dl/android/aosp/nxp-grouper-1743759-1d7e8bba.tgz && wget -c https://dl.google.com/dl/android/aosp/widevine-grouper-1743759-d6f899eb.tgz
for f in *.tgz; do tar xzf $f; done
for extractor_script in *.sh; do bash $extractor_script; done
Please ACCEPT each one by typing I ACCEPT
# Nexus 7 (Wi-Fi) binaries for Android 5.1.1
Code:
wget -c https://dl.google.com/dl/android/aosp/asus-grouper-lmy47v-f395a331.tgz && wget -c https://dl.google.com/dl/android/aosp/broadcom-grouper-lmy47v-5671ab27.tgz && wget -c https://dl.google.com/dl/android/aosp/elan-grouper-lmy47v-6a10e8f3.tgz&& wget -c https://dl.google.com/dl/android/aosp/invensense-grouper-lmy47v-ccd43018.tgz && wget -c https://dl.google.com/dl/android/aosp/nvidia-grouper-lmy47v-c9005750.tgz&& wget -c https://dl.google.com/dl/android/aosp/nxp-grouper-lmy47v-18820f9b.tgz&& wget -c https://dl.google.com/dl/android/aosp/widevine-grouper-lmy47v-e570494f.tgz
for f in *.tgz; do tar xzf $f; done
for extractor_script in *.sh; do bash $extractor_script; done
Please ACCEPT each one by typing I ACCEPT
# Now that is done you should of seen several files being extracted in certain directories.
source build/envsetup.sh
lunch (Pick the grouper-userdebug}
#To make a Fastboot flash image
make -j4
# If you get the following error on make
************************************************************
You are attempting to build with an unsupported JDK.
You use OpenJDK but only Sun/Oracle JDK is supported.
Please follow the machine setup instructions at
************************************************************
add-apt-repository ppa:webupd8team/java
apt-get update
apt-get install oracle-java7-installer (Lollipop)
apt-get install oracle-java6-installer (KitKat or older)
update-alternatives --config java
The rerun command (make -j4)
#Flashable Zip
make -j4 otapackage
# If you get the following error on make
************************************************************
You are attempting to build with an unsupported JDK.
You use OpenJDK but only Sun/Oracle JDK is supported.
Please follow the machine setup instructions at
************************************************************
add-apt-repository ppa:webupd8team/java
apt-get update
apt-get install oracle-java7-installer (Lollipop)
apt-get install oracle-java6-installer (KitKat or older)
update-alternatives --config java
The rerun command (make -j4 otapackage)
CREDITS and THANKS to:
AOSP/Google and Google Search
reserved for future use
another one
can i build cyanogenmod 13 using this method? im a total noob but i want to make a rom D;
---------- Post added at 12:20 PM ---------- Previous post was at 12:12 PM ----------
also, when you say that this guide is for rooted user, do you mean that the phone has to be rooted? (again im a noob xD)
supertiger1234 said:
can i build cyanogenmod 13 using this method? im a total noob but i want to make a rom D;
---------- Post added at 12:20 PM ---------- Previous post was at 12:12 PM ----------
also, when you say that this guide is for rooted user, do you mean that the phone has to be rooted? (again im a noob xD)
Click to expand...
Click to collapse
I would not recommend this guide for anything above lollipop.
ezbncs said:
I would not recommend this guide for anything above lollipop.
Click to expand...
Click to collapse
ah okay. is there any other guide to port cm 13? i cant find it anywhare.
supertiger1234 said:
ah okay. is there any other guide to port cm 13? i cant find it anywhare.
Click to expand...
Click to collapse
Im not sure you will have to search the forums or google.
AOSP built just fine for me with OpenJDK... and Google's documentation page seems to say OpenJDK is the right JDK for building under Ubuntu. So the build script seems to be incorrect. I got past the error you reported by tweaking the check.
In build/core/main.mk line 195 (the line which ends with "grep -i openjdk),)") I changed "ifneq" to "ifeq" and then it built fine for me. Probably not the right change, but it let me proceed. I was building aosp6 on Ubuntu 15.10 with java-8-openjdk-64.
aaopt said:
AOSP built just fine for me with OpenJDK... and Google's documentation page seems to say OpenJDK is the right JDK for building under Ubuntu. So the build script seems to be incorrect. I got past the error you reported by tweaking the check.
In build/core/main.mk line 195 (the line which ends with "grep -i openjdk),)") I changed "ifneq" to "ifeq" and then it built fine for me. Probably not the right change, but it let me proceed. I was building aosp6 on Ubuntu 15.10 with java-8-openjdk-64.
Click to expand...
Click to collapse
I mainly got the error when building diffrent versions of 4.1.2 to 4.4.4. I never got the error when doing lollipop so I included the oracle fix just to be safe incase others incounter the same problem. Thank you for the possible fix I will be testing it out soon.

Categories

Resources