Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
jim93
Old
#1  
Senior Member - OP
Thanks Meter 340
Posts: 750
Join Date: Oct 2011

 
DONATE TO ME
Default [GUIDE] How to compile Sidekick 4G Kernel [Ubuntu]

1) download source code from https://opensource.samsung.com/index.jsp. You are looking for source code for SGH-T839.

2) Get initramfs (Need to make a kernel package)
Extract it using extract boot http://www.mediafire.com/?lc12eceeh617b97.
This is why I am looking for a boot.img

extract it
Code:
tar -xvf extractboot.tar.gz
now move into directory with extract boot and copy your boot.img into here and do
Code:
./extractboot boot.img
3) Get mkboot tools
http://www.mediafire.com/?w06d1m6n1dgo4op
untar it by doing
Code:
tar -xvf $FILENAMEHERE
Add the bin directory to your path by moving to the bin directory and copying down the path then
Now you will add this to your path by editing your .bashrc file.

Go to your bashrc file
Code:
gedit ~/.bashrc
and adding this
Code:
PATH=$PATH:/FULLDIRECTORYYOUWROTEDOWN/
export PATH
4) Download the ARM toolchain
https://sourcery.mentor.com/sgpp/lit...ux-gnueabi.bin
and
https://sourcery.mentor.com/sgpp/lit...-none-eabi.bin


5) Install the ARM Toolchain
create the directory /opt/toolchains/arm-2009q3/
Code:
sudo mkdir /opt/toolchains/arm-2009q3/
then install the toolchain using /opt/toolchains/arm-2009q3/
as the install directory
Code:
sudo chmod +x arm-2009q3-68-arm-none-eabi.bin
sudo chmod +x arm-2009q3-67-arm-none-linux-gnueabi.bin
sudo  ./arm-2009q3-67-arm-none-linux-gnueabi.bin -i console
sudo  ./arm-2009q3-68-arm-none-eabi.bin -i console
6) Compile
Extract your source code and go to the directory Kernel and do the following

WARNING: MAKE SURE THERE ARE NO SPACES IN YOUR FILEPATH BECAUSE THE MAKEFILE DOESNT LIKE THEM.
Code:
make clean
make arch=arm sidekick_rev02_defconfig
make ARCH=arm HOSTCFLAGS="-g -O3" -j8 CROSS_COMPILE=/opt/toolchain/bin/arm-none-eabi-
Now copy any of the resulting compiled ko files into the initramfs file you have extracted and you should have what you need to package a kernel.
The Following 4 Users Say Thank You to jim93 For This Useful Post: [ Click to Expand ]
 
windxixi
Old
#2  
Member
Thanks Meter 52
Posts: 51
Join Date: Dec 2009
you forget initramfs
 
jim93
Old
#3  
Senior Member - OP
Thanks Meter 340
Posts: 750
Join Date: Oct 2011

 
DONATE TO ME
Quote:
Originally Posted by windxixi View Post
you forget initramfs
yeah I kept it out so that somebody would post a boot.img then could do steps related to that. I am looking for a boot.img to get initramfs from
 
windxixi
Old
#4  
Member
Thanks Meter 52
Posts: 51
Join Date: Dec 2009
unpack zImage

Sent from my SGH-T839 using XDA

---------- Post added at 08:46 AM ---------- Previous post was at 07:49 AM ----------

and how to pack a boot.img?
 
nxd
Old
#5  
Senior Member
Thanks Meter 70
Posts: 112
Join Date: Oct 2011
Location: Tucson, AZ
A request to anyone building SK4G kernels.

Please disable the keystroke logging printk statements in the file:

Code:
drivers/input/keyboard/s3c-keypad.c
The lines look like this:

Code:
//printk("\nkey Pressed  : key %d map %d\n",i, pdata->keycodes[i]);
and

Code:
//printk("\nkey Released : %d  map %d\n",i,pdata->keycodes[i]);
It is possible to recover the actual keystrokes from the numerical codes those statements log, and the messages go into the dmesg buffer. So it's pretty easy to extract them and determine exactly what the user typed.

In the latest Samsung sources I've seen, those lines were already commented out. It makes sense to enable them while debugging a new ROM build, but please do disable them prior to building a kernel intended for general consumption.
 
yogi2010
Old
(Last edited by yogi2010; 19th April 2012 at 10:42 PM.)
#6  
Senior Member
Thanks Meter 273
Posts: 1,975
Join Date: Dec 2010
Location: Los Angeles, CA
Do you guys know if the available source code will produce a kernel that will work with kj2? the kernel version in SGH-T839_Opensource_Update1 looks to match up, but I compilied a zImage and it didn't boot on stock kj2. but I could very well be missing something.

I have done a small amount of kernel work on an HTC device, but I basically just used the Rom Kitchen to pack up my zImages with a boot.img-ramdisk to create a boot.img. I guess I might need a little more instruction for packing up a Samsung kernel. Is it also an option to just tar up the zImage and flash it with Odin/Heindall?

Thanks for this thread, and for any other advice!

Sent from my SGH-T839 using Tapatalk 2
 
nxd
Old
#7  
Senior Member
Thanks Meter 70
Posts: 112
Join Date: Oct 2011
Location: Tucson, AZ
In case it might be useful to someone else working on building a kernel.

The official and Bali_SK4G sources both seem to insist on building with debug symbols enabled for some of the modules. In particular, i was ending up with dhd.ko being 2.4 MB in size, where it should have been less than 400 KB.

The ideal case would be to determine why the debug symbols are being included -- commenting out the labelled debug options in the bcm4329 Makefile didn't accomplish this.

But a workaround is to strip the modules after the build is finished, before assembling the initramfs.
 
nxd
Old
#8  
Senior Member
Thanks Meter 70
Posts: 112
Join Date: Oct 2011
Location: Tucson, AZ
Has anyone been able to build a working zImage for KJ2 using Dr. Honk's Bali sources [1] and sduvick's KJ2 ramdisk files [2]?

I have been able to build a zImage of a reasonable size (6520 KB). But when I flash this to the KERNEL partition using heimdall, the device boot loops to the B&W Sidekick logo. It doesn't get far enough to show any adb log output.

I can then use the same heimdall flashing procedure to flash the Platypus Egg v1 zImage, or other KJ2-compatible zImage files, and the device boots and works properly.

So I'm trying to figure out what I'm doing wrong in building my zImage. If anyone has any advice I would be appreciative.

[1] https://github.com/drhonk/Bali_SK4G
[2] https://github.com/sduvick/SK4g_KJ2_Ramdisk
 
nxd
Old
(Last edited by nxd; 14th May 2012 at 10:12 AM.)
#9  
Senior Member
Thanks Meter 70
Posts: 112
Join Date: Oct 2011
Location: Tucson, AZ
I got an updated Bali_SK4G kernel booting using the ramdisk from GenericGinger 2.0.

I have worked up some patches to disable the logging of keystrokes and other more trivial debug spew in dmesg. Also included is a Makefile patch that was required for the compile to complete with my toolchain.

https://carbon.flatlan.net/nxd/patch...4G_nxd.tar.bz2

md5sum: 5d14ac32de155cdca0fd82f14bc4ceca

These patches are GPL licensed, in compliance with the license for the Linux kernel itself. I make no guarantees about their suitability for any purpose. I grant permission to use them to anyone who would like to do so, so long as they comply with the GPL.

I'd like to make a compiled kernel available with these changes, but XDA's rules can be interpreted to mean that I must obtain permission from a series of upstream contributors, some of whom may not be reachable. Perhaps a moderator will clarify the parameters of the permission rule.

The Following User Says Thank You to nxd For This Useful Post: [ Click to Expand ]
 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

report this ad
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

Go to top of page...

XDA PORTAL POSTS

Jolla Sailfish OS Flagship Device Makes First Appearance

Given the amount of coverage that Android receives around here, you could almost be … more

XDA University: Porting ClockworkMod Recovery to New Devices

Having a good recovery makes the process of modifying, tweaking, maintaining, … more

One Stop Guide Shop for the Newbie and Dev

It’s been well established that XDA-Developers isthedestination for resources relating to … more

What Happened at Google I/O 2013 – XDA Developer TV

Unless you just emerged from a deep, dark, dank cavern under the Earth, you know … more