Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,770,562 Members 37,649 Now Online
XDA Developers Android and Mobile Development Forum

Android Dev. How-To Guide: Compiling the Android/Linux kernel for the Epic Touch 4G

Tip us?
 
dtm_stretch
Old
#21  
Senior Member
Thanks Meter 163
Posts: 475
Join Date: Dec 2010
Location: Albany
Ok so I am getting the following error when I run this command:

export CROSS_COMPILE=/home/derek/Desktop/arm-2009q3/bin/arm-none-eabi

make: /opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-gcc: Command not found

Then when I run:

make -j5 CONFIG_INITRAMFS_SOURCE=/home/derek/Desktop/initramfs

I get the following error :

make: /home/derek/Desktop/arm-2009q3/bin/arm-none-eabigcc: Command not found
scripts/kconfig/conf -s arch/arm/Kconfig
make: /home/derek/Desktop/arm-2009q3/bin/arm-none-eabigcc: Command not found
CHK include/linux/version.h
CHK include/generated/utsrelease.h
HOSTCC scripts/genksyms/genksyms.o
HOSTCC scripts/genksyms/lex.o
make[1]: `include/generated/mach-types.h' is up to date.
CC scripts/mod/empty.o
/bin/sh: /home/derek/Desktop/arm-2009q3/bin/arm-none-eabigcc: not found
make[2]: *** [scripts/mod/empty.o] Error 127
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
HOSTCC scripts/genksyms/parse.o
CC kernel/bounds.s
/bin/sh: /home/derek/Desktop/arm-2009q3/bin/arm-none-eabigcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2
make: *** Waiting for unfinished jobs....
HOSTLD scripts/genksyms/genksyms
make: *** [scripts] Error 2
 
agat63
Old
#22  
agat63's Avatar
Recognized Contributor / Recognized Developer
Thanks Meter 7931
Posts: 3,977
Join Date: Sep 2010
Location: Las Vegas, NV

 
DONATE TO ME
It looks like you don't have gcc installed in your VM.
try to do this int terminal:
# sudo apt-get install gcc and hit enter.
It should install gcc.
After that try the export CROSS_COMPILE= again.
Hope this will work.
The Following 3 Users Say Thank You to agat63 For This Useful Post: [ Click to Expand ]
 
chris41g
Old
#23  
chris41g's Avatar
Recognized Developer
Thanks Meter 3604
Posts: 2,025
Join Date: Sep 2009

 
DONATE TO ME
to the OP:

to make compile times shorter... and a bit easier I suggest making a build script...

Dir tree like this

-Initramfs
-Kernel
buildscript.sh

buildscript.sh something like this...
Code:
#!/bin/bash
CROSS_COMPILE="/home/chris41g/arm-2009q3/bin/arm-none-linux-gnueabi-"
MKZIP='7z -mx9 -mmt=1 a "$OUTFILE" .'
THREADS=$(expr 1 + $(grep processor /proc/cpuinfo | wc -l))
P_DIR="/home/chris41g/android/LoStKernel"
SRC_BASE="$P_DIR/Kernel"
DST_BASE="initramfs/lib/modules"
CC_STRIP="/home/chris41g/arm-2009q3/bin/arm-none-linux-gnueabi-strip"

COPY_WITH_ECHO()
{
	local SRC=$1
	local DST=$2
	echo "Copying $SRC to $DST_BASE/$DST"
	cp "$SRC_BASE/$SRC" "$P_DIR/$DST_BASE/$DST"
}
STRIP_WITH_ECHO()
{
	local DST=$1
	echo "Stripping $DST_BASE/$DST"
	$CC_STRIP -d --strip-unneeded "$P_DIR/$DST_BASE/$DST"
}

CLEAN()
{
pushd Kernel > /dev/null
		nice make V=1 -j"$THREADS" ARCH=arm clean 2>&1 >make.clean.out
popd > /dev/null
}

MAKE_DEFCONFIG()
{
pushd Kernel > /dev/null
		nice make V=1 -j"$THREADS" ARCH=arm ${TARGET}_defconfig 2>&1 >make.defconfig.out
popd > /dev/null
}

MAKE_MODULES()
{
pushd Kernel > /dev/null
		nice make -j"$THREADS" ARCH=arm modules 2>&1 | tee make.out
popd > /dev/null
}

MAKE_ZIMAGE()
{
pushd Kernel > /dev/null
		rm -f usr/initramfs_data.cpio.lzma
		nice make V=1 -j"$THREADS" ARCH=arm CROSS_COMPILE="$CROSS_COMPILE" 2>&1 | tee make.out
popd > /dev/null
}

MAKE_TAR()
{
pushd Kernel > /dev/null
		tar -H ustar -c -C arch/arm/boot zImage >"$OUTFILE_PATH.tar"
popd > /dev/null
}

CLEAN
MAKE_DEFCONFIG
MAKE_MODULES
COPY_WITH_ECHO "drivers/bluetooth/bthid/bthid.ko" "bthid.ko"
COPY_WITH_ECHO "drivers/samsung/j4fs/j4fs.ko" "j4fs.ko"
COPY_WITH_ECHO "drivers/scsi/scsi_wait_scan.ko" "scsi_wait_scan.ko"
COPY_WITH_ECHO "drivers/net/wireless/bcm4330/dhd.ko" "dhd.ko"
COPY_WITH_ECHO "drivers/samsung/vibetonz/vibrator.ko" "vibrator.ko"
COPY_WITH_ECHO "drivers/staging/westbridge/astoria/switch/cyasswitch.ko" "cyasswitch.ko"
COPY_WITH_ECHO "fs/cifs/cifs.ko" "cifs.ko"
STRIP_WITH_ECHO "bthid.ko"
STRIP_WITH_ECHO "cyasswitch.ko"
STRIP_WITH_ECHO "j4fs.ko"
STRIP_WITH_ECHO "scsi_wait_scan.ko"
STRIP_WITH_ECHO "cifs.ko"
MAKE_ZIMAGE
MAKE_TAR
i wrote this while at work, so there may be some errors in it.. but the general idea is the same..
Donate via Paypal


Checkout EpicAOSP for How-To's and AOSP releases...
The Following 2 Users Say Thank You to chris41g For This Useful Post: [ Click to Expand ]
 
MikeC84
Old
#24  
MikeC84's Avatar
Senior Member
Thanks Meter 803
Posts: 1,429
Join Date: Jun 2010
Location: Tucson

 
DONATE TO ME
I would try it but I am rooted so I would like a rooted kernel with cwm. Either way thanks for this.

Now if you could show us how to root the kernel, add cwm / rogue recovery, and make it flashable in recovery, that would be epic..
 
chris41g
Old
#25  
chris41g's Avatar
Recognized Developer
Thanks Meter 3604
Posts: 2,025
Join Date: Sep 2009

 
DONATE TO ME
Quote:
Originally Posted by dtm_stretch View Post
Ok so I am getting the following error when I run this command:

export CROSS_COMPILE=/home/derek/Desktop/arm-2009q3/bin/arm-none-eabi

make: /opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-gcc: Command not found

Then when I run:

make -j5 CONFIG_INITRAMFS_SOURCE=/home/derek/Desktop/initramfs

I get the following error :

make: /home/derek/Desktop/arm-2009q3/bin/arm-none-eabigcc: Command not found
scripts/kconfig/conf -s arch/arm/Kconfig
make: /home/derek/Desktop/arm-2009q3/bin/arm-none-eabigcc: Command not found
CHK include/linux/version.h
CHK include/generated/utsrelease.h
HOSTCC scripts/genksyms/genksyms.o
HOSTCC scripts/genksyms/lex.o
make[1]: `include/generated/mach-types.h' is up to date.
CC scripts/mod/empty.o
/bin/sh: /home/derek/Desktop/arm-2009q3/bin/arm-none-eabigcc: not found
make[2]: *** [scripts/mod/empty.o] Error 127
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
HOSTCC scripts/genksyms/parse.o
CC kernel/bounds.s
/bin/sh: /home/derek/Desktop/arm-2009q3/bin/arm-none-eabigcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2
make: *** Waiting for unfinished jobs....
HOSTLD scripts/genksyms/genksyms
make: *** [scripts] Error 2
try
export CROSS_COMPILE=/home/derek/Desktop/arm-2009q3/bin/arm-none-eabi-

---------- Post added at 12:31 PM ---------- Previous post was at 12:27 PM ----------

Quote:
Originally Posted by MikeC84 View Post
I would try it but I am rooted so I would like a rooted kernel with cwm. Either way thanks for this.

Now if you could show us how to root the kernel, add cwm / rogue recovery, and make it flashable in recovery, that would be epic..
rooting doesnt need to be done in the kernel.. the system can be rooted, and a lot of people suggest that..

as for adding the recovery, that requires quite a few changes to the initramfs. you can look at my github if you would like to..

http://github.com/chris41g

and to make it flashable it pretty easy as well, just take another flashable kernel zip and replace the zImage file with the one you made..
Donate via Paypal


Checkout EpicAOSP for How-To's and AOSP releases...
The Following 3 Users Say Thank You to chris41g For This Useful Post: [ Click to Expand ]
 
MikeC84
Old
(Last edited by MikeC84; 13th January 2012 at 07:06 PM.)
#26  
MikeC84's Avatar
Senior Member
Thanks Meter 803
Posts: 1,429
Join Date: Jun 2010
Location: Tucson

 
DONATE TO ME
Quote:
Originally Posted by chris41g View Post
try
export CROSS_COMPILE=/home/derek/Desktop/arm-2009q3/bin/arm-none-eabi-

---------- Post added at 12:31 PM ---------- Previous post was at 12:27 PM ----------



rooting doesnt need to be done in the kernel.. the system can be rooted, and a lot of people suggest that..

as for adding the recovery, that requires quite a few changes to the initramfs. you can look at my github if you would like to..

http://github.com/chris41g

and to make it flashable it pretty easy as well, just take another flashable kernel zip and replace the zImage file with the one you made..
Cool thanks, I wasnt sure if both the kernel and system needed to be rooted. I already downloaded staedy hawkins initramfs file, which looks like there is his recovery in their.
 
dtm_stretch
Old
#27  
Senior Member
Thanks Meter 163
Posts: 475
Join Date: Dec 2010
Location: Albany
Quote:
Originally Posted by agat63 View Post
It looks like you don't have gcc installed in your VM.
try to do this int terminal:
# sudo apt-get install gcc and hit enter.
It should install gcc.
After that try the export CROSS_COMPILE= again.
Hope this will work.
Strangely, it said it was already installed but I reran and it worked.
 
nthornton1990
Old
#28  
nthornton1990's Avatar
Senior Member
Thanks Meter 34
Posts: 255
Join Date: Aug 2011
Location: tampa
Thank you so much. I asked about this a few days ago and noone responded.

Sent from my SPH-D710 using xda premium
 
MikeC84
Old
#29  
MikeC84's Avatar
Senior Member
Thanks Meter 803
Posts: 1,429
Join Date: Jun 2010
Location: Tucson

 
DONATE TO ME
Quote:
Originally Posted by dtm_stretch View Post
Strangely, it said it was already installed but I reran and it worked.
I got the same error when doing step 4. Sudo make clean and got : /opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-gcc: Command not found

gcc is the latest version so not sure whats going on here...
 
dtm_stretch
Old
(Last edited by dtm_stretch; 13th January 2012 at 08:27 PM.)
#30  
Senior Member
Thanks Meter 163
Posts: 475
Join Date: Dec 2010
Location: Albany
Quote:
Originally Posted by MikeC84 View Post
I got the same error when doing step 4. Sudo make clean and got : /opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-gcc: Command not found

gcc is the latest version so not sure whats going on here...
I would just try the command agat posted earlier then try again.


HAHA Well I never thought I would be able to compile a kernel from source, very easy to follow guide.


Tags
android, compile kernel, development, kernel, source, sph-d710, wifi - haptik woes -_-
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes