Post Reply

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

13th January 2012, 04:14 PM   |  #21  
Senior Member
Flag Albany
Thanks Meter: 163
 
475 posts
Join Date:Joined: Dec 2010
More
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
13th January 2012, 04:33 PM   |  #22  
agat63's Avatar
Recognized Contributor / Recognized Developer
Las Vegas, NV
Thanks Meter: 7,937
 
3,979 posts
Join Date:Joined: Sep 2010
Donate to Me
More
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: [ View ]
13th January 2012, 05:57 PM   |  #23  
chris41g's Avatar
Recognized Developer
Thanks Meter: 3,604
 
2,025 posts
Join Date:Joined: 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..
The Following 2 Users Say Thank You to chris41g For This Useful Post: [ View ]
13th January 2012, 06:25 PM   |  #24  
MikeC84's Avatar
Senior Member
Flag Tucson
Thanks Meter: 808
 
1,439 posts
Join Date:Joined: Jun 2010
Donate to Me
More
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..
13th January 2012, 06:31 PM   |  #25  
chris41g's Avatar
Recognized Developer
Thanks Meter: 3,604
 
2,025 posts
Join Date:Joined: Sep 2009
Donate to Me
Quote:
Originally Posted by dtm_stretch

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

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..
The Following 3 Users Say Thank You to chris41g For This Useful Post: [ View ]
13th January 2012, 07:02 PM   |  #26  
MikeC84's Avatar
Senior Member
Flag Tucson
Thanks Meter: 808
 
1,439 posts
Join Date:Joined: Jun 2010
Donate to Me
More
Quote:
Originally Posted by chris41g

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.
Last edited by MikeC84; 13th January 2012 at 07:06 PM.
13th January 2012, 07:11 PM   |  #27  
Senior Member
Flag Albany
Thanks Meter: 163
 
475 posts
Join Date:Joined: Dec 2010
More
Quote:
Originally Posted by agat63

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.
13th January 2012, 07:18 PM   |  #28  
nthornton1990's Avatar
Senior Member
Flag tampa
Thanks Meter: 34
 
255 posts
Join Date:Joined: Aug 2011
More
Thank you so much. I asked about this a few days ago and noone responded.

Sent from my SPH-D710 using xda premium
13th January 2012, 07:25 PM   |  #29  
MikeC84's Avatar
Senior Member
Flag Tucson
Thanks Meter: 808
 
1,439 posts
Join Date:Joined: Jun 2010
Donate to Me
More
Quote:
Originally Posted by dtm_stretch

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...
13th January 2012, 07:36 PM   |  #30  
Senior Member
Flag Albany
Thanks Meter: 163
 
475 posts
Join Date:Joined: Dec 2010
More
Quote:
Originally Posted by MikeC84

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.

Last edited by dtm_stretch; 13th January 2012 at 08:27 PM.

Post Reply Subscribe to Thread

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

Advanced Search
Display Modes