PPCGeeks Forums HTC Arrive HTC HD2 HTC Thunderbolt HTC Touch Pro 2 HTC Evo 4G HTC Evo 3D Samsung Galaxy S II Motorola Droid X Apple iPhone Blackberry
Go Back   PPCGeeks > Android > Android Motorola Devices > Moto Droid
Register Community Search

Notices


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-18-2010, 11:49 PM
Adrynalyne's Avatar
The Pusher
Offline
Pocket PC: Samsung Omnia i910
Carrier: Verizon
 
Join Date: Dec 2008
Posts: 3,788
Reputation: 7240
Adrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the community
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
[HowTo]Compile your own kernel

This is a wip, so...
Credit to Sticky: How to Compile the Droid kernel for some of the sections I borrowed.

Part 1
Installing GNU/Linux


First, you will need GNU/Linux. Use any distro you like, but for ease, Ubuntu will work fine. Unless you plan on making a dual boot or using it as a main OS, wubi will be one of the easiest ways. It will install Ubuntu onto your Windows partition in a folder of its own. Uninstall is easy as well, you can do it from the control panel. You can also do this under a VM, but wubi is going to be easiest to set up.

Getting Ubuntu
Download Ubuntu | Ubuntu

Then, burn the iso to a CD. To install with Wubi, simply start the setup on the CD from within windows. Follow the directions and you are on your way to installing Ubuntu. When you reboot you will be presented with the choice to boot Windows, or Ubuntu.

Part 2
Setting up Git and kernel source

Getting the kernel source will be done by using this code below. You can literally copy and paste it from here into the ubuntu terminal.
Code:
mkdir -p ~/kernel/droid
cd ~/kernel/droid
git clone git://android.git.kernel.org/kernel/omap.git
git clone git://android.git.kernel.org/platform/system/wlan/ti.git
git clone git://android.git.kernel.org/platform/prebuilt.git
This does take a bit.

The next part is to set git to the version of kernel we want to use. In this case, we will want the latest Eclair source, as its the only kernel that works on ESE53+.

Code:
cd ~/kernel/droid/omap
git checkout --track -b android-omap-2.6.29-eclair origin/android-omap-2.6.29-eclair
cd ~/kernel/droid/ti
git checkout --track -b eclair origin/eclair
cd ~/kernel/droid/prebuilt
git checkout --track -b eclair origin/eclair

Part 3
Configuring kernel options (like tethering and overclocking)

First, lets setup the build environment.
Code:
cd ~/kernel/droid/omap
export ARCH=arm
export CROSS_COMPILE=~/kernel/droid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
make sholes_defconfig

Kernel configuration happens a few ways. You can use menuconfig (gotta install ncurses dev tools)
Code:
cd ~/kernel/droid/omap
make menuconfig
or the more advanced method of modifying the .config file.
The .config file is a hidden file in the ~/kernel/droid/omap. I wil attach mine. Here is where much of the kernel config takes place.
Other more advanced things, such as overclocking, take place in the ~/kernel/droid/omap/arch//arm/mach-omap 2 directory.

To overclock, check out the board.sholes.c file, specifically this part:
Code:
static struct omap_opp sholes_mpu_rate_table[] = {
    {0, 0, 0},
    /*OPP1*/
    {S125M, VDD1_OPP1, 0x20},
    /*OPP2*/
    {S250M, VDD1_OPP2, 0x27},
    /*OPP3*/
    {S500M, VDD1_OPP3, 0x32},
    /*OPP4*/
    {S550M, VDD1_OPP4, 0x38},
    /*OPP5*/
    {S600M, VDD1_OPP5, 0x3E},
};
Speeds are shown/set here, as well as voltages. I haven't messed with this too much yet. This is also linked to the file omap3-opp.h, where the speed settings are defined. I believe most must be editted.
Code:
/* MPU speeds */
#define S600M   600000000
#define S550M   550000000
#define S500M   500000000
#define S250M   250000000
#define S125M   125000000
Enabling the 600mhz mode (and the fifth cpu slot?) requires modifcations to the clock34xx.c file. I will upload mine.

To tether, you will need to enable netfilter and iptables stuff in the kernel. Most of this stuff is NOT in .config, but you can add it. It only requires three lines to enable it, but then the questions that come during compilation are annoying, long, and make it easy to make errors. The .config file I loaded has this already, but I will list the sections as well. These get added to .config. Be careful not to duplicate sections.

Code:
# Networking options
#
CONFIG_COMPAT_NET_DEV_OPS=y
CONFIG_PACKET=y
CONFIG_PACKET_MMAP=y
CONFIG_UNIX=y
CONFIG_XFRM=y
CONFIG_XFRM_USER=y
# CONFIG_XFRM_SUB_POLICY is not set
CONFIG_XFRM_MIGRATE=y
# CONFIG_XFRM_STATISTICS is not set
CONFIG_NET_KEY=y
CONFIG_NET_KEY_MIGRATE=y
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
# CONFIG_IP_ADVANCED_ROUTER is not set
CONFIG_IP_FIB_HASH=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
CONFIG_IP_PNP_RARP=y
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE is not set
# CONFIG_IP_MROUTE is not set
# CONFIG_ARPD is not set
# CONFIG_SYN_COOKIES is not set
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_INET_IPCOMP is not set
# CONFIG_INET_XFRM_TUNNEL is not set
# CONFIG_INET_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_BEET is not set
# CONFIG_INET_LRO is not set
CONFIG_INET_DIAG=y
CONFIG_INET_TCP_DIAG=y
# CONFIG_TCP_CONG_ADVANCED is not set
CONFIG_TCP_CONG_CUBIC=y
CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_TCP_MD5SIG is not set
# CONFIG_IPV6 is not set
CONFIG_ANDROID_PARANOID_NETWORK=y
# CONFIG_NETWORK_SECMARK is not set
CONFIG_NETFILTER=y
# CONFIG_NETFILTER_DEBUG is not set
CONFIG_NETFILTER_ADVANCED=y

#
# Core Netfilter Configuration
#
# CONFIG_NETFILTER_NETLINK_QUEUE is not set
# CONFIG_NETFILTER_NETLINK_LOG is not set
CONFIG_NF_CONNTRACK=y
# CONFIG_NF_CT_ACCT is not set
# CONFIG_NF_CONNTRACK_MARK is not set
# CONFIG_NF_CONNTRACK_EVENTS is not set
# CONFIG_NF_CT_PROTO_DCCP is not set
CONFIG_NF_CT_PROTO_GRE=y
# CONFIG_NF_CT_PROTO_SCTP is not set
# CONFIG_NF_CT_PROTO_UDPLITE is not set
# CONFIG_NF_CONNTRACK_AMANDA is not set
CONFIG_NF_CONNTRACK_FTP=y
# CONFIG_NF_CONNTRACK_H323 is not set
CONFIG_NF_CONNTRACK_IRC=y
# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set
CONFIG_NF_CONNTRACK_PPTP=y
# CONFIG_NF_CONNTRACK_SANE is not set
# CONFIG_NF_CONNTRACK_SIP is not set
# CONFIG_NF_CONNTRACK_TFTP is not set
# CONFIG_NF_CT_NETLINK is not set
CONFIG_NETFILTER_XTABLES=y
# CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set
# CONFIG_NETFILTER_XT_TARGET_CONNMARK is not set
# CONFIG_NETFILTER_XT_TARGET_MARK is not set
# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set
# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set
# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set
# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set
# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set
# CONFIG_NETFILTER_XT_MATCH_CONNBYTES is not set
# CONFIG_NETFILTER_XT_MATCH_CONNLIMIT is not set
# CONFIG_NETFILTER_XT_MATCH_CONNMARK is not set
# CONFIG_NETFILTER_XT_MATCH_CONNTRACK is not set
# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
# CONFIG_NETFILTER_XT_MATCH_DSCP is not set
# CONFIG_NETFILTER_XT_MATCH_ESP is not set
# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set
# CONFIG_NETFILTER_XT_MATCH_HELPER is not set
CONFIG_NETFILTER_XT_MATCH_IPRANGE=y
# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set
# CONFIG_NETFILTER_XT_MATCH_LIMIT is not set
CONFIG_NETFILTER_XT_MATCH_MAC=y
# CONFIG_NETFILTER_XT_MATCH_MARK is not set
CONFIG_NETFILTER_XT_MATCH_MULTIPORT=y
# CONFIG_NETFILTER_XT_MATCH_OWNER is not set
# CONFIG_NETFILTER_XT_MATCH_POLICY is not set
# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set
# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set
# CONFIG_NETFILTER_XT_MATCH_REALM is not set
CONFIG_NETFILTER_XT_MATCH_RECENT=y
# CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT is not set
# CONFIG_NETFILTER_XT_MATCH_SCTP is not set
CONFIG_NETFILTER_XT_MATCH_STATE=y
# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
# CONFIG_NETFILTER_XT_MATCH_STRING is not set
# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set
# CONFIG_NETFILTER_XT_MATCH_TIME is not set
# CONFIG_NETFILTER_XT_MATCH_U32 is not set
# CONFIG_IP_VS is not set

#
# IP: Netfilter Configuration
#
CONFIG_NF_DEFRAG_IPV4=y
CONFIG_NF_CONNTRACK_IPV4=y
CONFIG_NF_CONNTRACK_PROC_COMPAT=y
# CONFIG_IP_NF_QUEUE is not set
CONFIG_IP_NF_IPTABLES=y
# CONFIG_IP_NF_MATCH_ADDRTYPE is not set
# CONFIG_IP_NF_MATCH_AH is not set
# CONFIG_IP_NF_MATCH_ECN is not set
# CONFIG_IP_NF_MATCH_TTL is not set
CONFIG_IP_NF_FILTER=y
CONFIG_IP_NF_TARGET_REJECT=y
CONFIG_IP_NF_TARGET_LOG=y
# CONFIG_IP_NF_TARGET_ULOG is not set
CONFIG_NF_NAT=y
CONFIG_NF_NAT_NEEDED=y
CONFIG_IP_NF_TARGET_MASQUERADE=y
CONFIG_IP_NF_TARGET_NETMAP=y
CONFIG_IP_NF_TARGET_REDIRECT=y
# CONFIG_IP_NF_TARGET_IDLETIMER is not set
# CONFIG_NF_NAT_SNMP_BASIC is not set
CONFIG_NF_NAT_PROTO_GRE=y
CONFIG_NF_NAT_FTP=y
CONFIG_NF_NAT_IRC=y
# CONFIG_NF_NAT_TFTP is not set
# CONFIG_NF_NAT_AMANDA is not set
CONFIG_NF_NAT_PPTP=y
# CONFIG_NF_NAT_H323 is not set
# CONFIG_NF_NAT_SIP is not set
# CONFIG_IP_NF_MANGLE is not set
# CONFIG_IP_NF_RAW is not set
# CONFIG_IP_NF_ARPTABLES is not set
# CONFIG_IP_DCCP is not set
# CONFIG_IP_SCTP is not set
# CONFIG_TIPC is not set
# CONFIG_ATM is not set
# CONFIG_BRIDGE is not set
# CONFIG_NET_DSA is not set
# CONFIG_VLAN_8021Q is not set
# CONFIG_DECNET is not set
# CONFIG_LLC2 is not set
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_ECONET is not set
# CONFIG_WAN_ROUTER is not set
# CONFIG_NET_SCHED is not set
# CONFIG_DCB is not set
When you are done configuring your .config file, BACK IT UP. Each time you setup the build environment, it erases it and makes a default copy. Just watch the prompts and when it does that, replace the new .config file with your own.


Part 4
Compiling kernel and wifi driver

Ready for this? While still in the omap directory (~/kernel/droid/omap)
Code:
make
Now watch the initial prompts. Sometimes it once again nukes your .config file. I have no idea why. So just hit ctrl-x and cancel the compile, and then put your .config file back and make it again.

Now for the wifi.

Code:
cd ~/kernel/droid/ti/wilink_6_1/platforms/os/linux
export ARCH=arm
export CROSS_COMPILE=~/kernel/droid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
export HOST_PLATFORM=zoom2
export KERNEL_DIR=~/kernel/droid/omap
make
The driver will be located under ~/kernel/droid/ti/wilink_6_1/platforms/os/linux.

Put it on your sd card for safe keeping. You need to build this driver, every time you recompile the kernel.


Part 5
Packaging kernel

Make a new directory under your home folder called bin. Log out and back in to get it into your path.
Attached is a zip file of two files you need. Copy mkbootimg into your bin folder, and boot.img-ramdisk.gz into the ~/kernel/droid folder.

To package the kernel into a boot.img file:

Code:
cd ~/kernel/droid
mkbootimg --kernel omap/arch/arm/boot/zImage --ramdisk boot.img-ramdisk.gz --cmdline "console=ttyS2,115200n8 rw mem=244M@0x80C00000 init=/init ip=off brdrev=P3A_CDMA mtdparts=omap2-nand.0:640k@128k(mbm),384k@1408k(cdt),384k@3328k(lbl),384k@6272k(misc),3584k(boot),4608k(recovery),143744k(system),94848k(cache),268032k(userdata),2m(kpanic)" -o boot.img
File will be located in ~/kernel/droid folder. Copy this to your sd card.

Part 6
Flashing kernel and hosing your phone


You cannot do this from within Android, so reboot to recovery mode.
You will also need adb setup for this. In SPRecovery, go to mount options and mount the sd card.

Code:
adb shell
flash_image boot /sdcard/boot.img
Reboot.

Once back up (assuming you booted), install the wifi driver.
Code:
adb shell
su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system
busybox cp /sdcard/tiwlan.ko /system/lib/modules/tiwlan.ko
sync
reboot
Thats the main meat of it. Many things can be added and modified that go beyond this tutorial. The sky is the limit.
Attached Files
File Type: zip mkbootimg.zip (168.6 KB, 17 views) Click for barcode!

Last edited by Adrynalyne; 03-24-2010 at 02:28 PM.
Reply With Quote
This post has been thanked 5 times.
  #2 (permalink)  
Old 03-19-2010, 09:41 AM
blazingwolf's Avatar
VIP Member
Offline
Pocket PC: Samsung Omnia i910
Carrier: Verizon
 
Join Date: Dec 2006
Posts: 2,599
Reputation: 3495
blazingwolf is still contributing even after becoming a VIPblazingwolf is still contributing even after becoming a VIPblazingwolf is still contributing even after becoming a VIPblazingwolf is still contributing even after becoming a VIPblazingwolf is still contributing even after becoming a VIPblazingwolf is still contributing even after becoming a VIPblazingwolf is still contributing even after becoming a VIPblazingwolf is still contributing even after becoming a VIPblazingwolf is still contributing even after becoming a VIPblazingwolf is still contributing even after becoming a VIPblazingwolf is still contributing even after becoming a VIP
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: [HowTo]Compile your own kernel

Nice write up.
__________________
Moto Droid
I make ROMs because I like to. If you want to buy me a Pepsi though: Donate

Follow me on mytabletlife.com
Reply With Quote
  #3 (permalink)  
Old 03-19-2010, 01:38 PM
Adrynalyne's Avatar
The Pusher
Offline
Pocket PC: Samsung Omnia i910
Carrier: Verizon
Threadstarter
 
Join Date: Dec 2008
Posts: 3,788
Reputation: 7240
Adrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the community
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: [HowTo]Compile your own kernel

Just waiting for folks to start cooking.....their Droids
Reply With Quote
  #4 (permalink)  
Old 03-20-2010, 11:27 AM
banden's Avatar
Droidgeek
Offline
Pocket PC: Rooted MotoDroid w/mish mash of ROMs
Carrier: Verizon
 
Join Date: Nov 2009
Posts: 479
Reputation: 985
banden knows their stuffbanden knows their stuffbanden knows their stuffbanden knows their stuffbanden knows their stuffbanden knows their stuffbanden knows their stuffbanden knows their stuff
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: [HowTo]Compile your own kernel

This is interesting: how to configure the task killer. I guess the kernel contains the instructions for how the stock task killer works.
__________________
The 'THanKs' button: use it, love it.
Reply With Quote
This post has been thanked 1 times.
  #5 (permalink)  
Old 03-20-2010, 06:43 PM
Adrynalyne's Avatar
The Pusher
Offline
Pocket PC: Samsung Omnia i910
Carrier: Verizon
Threadstarter
 
Join Date: Dec 2008
Posts: 3,788
Reputation: 7240
Adrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the community
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: [HowTo]Compile your own kernel

The kernel controls it, yeah.
Reply With Quote
  #6 (permalink)  
Old 03-21-2010, 04:31 AM
bgill55's Avatar
Halfway to VIP Status
Offline
Pocket PC: omnia i910 Bgill55 Hybrid Rom!
Carrier: VZW
 
Join Date: Apr 2009
Posts: 573
Reputation: 948
bgill55 knows their stuffbgill55 knows their stuffbgill55 knows their stuffbgill55 knows their stuffbgill55 knows their stuffbgill55 knows their stuffbgill55 knows their stuffbgill55 knows their stuff
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Send a message via MSN to bgill55
Re: [HowTo]Compile your own kernel

Good Gosh I have alot of reading to do!! thanks buddy!
__________________
Im not a Genius, but i would love a Guinness!!

If I Helped you in any way, a simple would be nice!

Visit Me Over at http://Omniarom.com And say Hello!
Reply With Quote
  #7 (permalink)  
Old 03-21-2010, 04:53 AM
Weapondrift's Avatar
Regular 'Geeker
Offline
Pocket PC: HTC Incredible
Carrier: Verizon
Location: Under Cthulhu's bed
 
Join Date: Dec 2008
Posts: 506
Reputation: 590
Weapondrift knows their stuffWeapondrift knows their stuffWeapondrift knows their stuffWeapondrift knows their stuffWeapondrift knows their stuffWeapondrift knows their stuff
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: [HowTo]Compile your own kernel

now I just gotta wait till november when I get my droid

can you compile this using any other Android device?
__________________
Dont make God angry...you might end up with Jesus 2.0!

DavidinCT "I was going to say something like......So I bumped into your girl and noticed the cheeze...then she said she was happy to find a real man....but, I just cant"
Reply With Quote
  #8 (permalink)  
Old 03-21-2010, 12:28 PM
Adrynalyne's Avatar
The Pusher
Offline
Pocket PC: Samsung Omnia i910
Carrier: Verizon
Threadstarter
 
Join Date: Dec 2008
Posts: 3,788
Reputation: 7240
Adrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the communityAdrynalyne is a trusted member of the community
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: [HowTo]Compile your own kernel

Its compiled on your PC so...
Reply With Quote
This post has been thanked 1 times.
  #9 (permalink)  
Old 03-21-2010, 10:21 PM
jrodizzkool01's Avatar
PPCGeeks Regular
Offline
Pocket PC: DROID
Carrier: Verizon
 
Join Date: Jan 2009
Posts: 146
Reputation: 125
jrodizzkool01 is keeping up the good workjrodizzkool01 is keeping up the good work
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: [HowTo]Compile your own kernel

I was all up for doing this until I realized that it wouldn't work with Windows. I don't get why Android ROMS are so much more difficult to build than Windows Mobile ROMS
__________________
Not much of a ppcgeeker but I have a tf3d themes thread on xda http://forum.xda-developers.com/showthread.php?t=541113
Reply With Quote
Reply

  PPCGeeks > Android > Android Motorola Devices > Moto Droid


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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -4. The time now is 09:11 PM.


Powered by vBulletin® ©2000 - 2024, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.6.0
©2012 - PPCGeeks.com