[Galaxy S II Q&A, Help & Troubleshooting] antaresteleko:
Hi Saul and everybody,

I figured out what the problem was; this is just in case it's useful to someone.

It seems the "make clean" and "make mrproper" routines in the Makefile created by Samsund does not work properley and you need to unzip the entire source code again and restart the proces from scratch every time you want to change the .config and re-compile.

Afterwards, I also noticed the image won't work because I needed to exctract an initramfs for my device and to link it to the new kernel during the kernel compilation process and setting the CONFIG_INITRAMFS_SOURCE .config parameter pointing to the location where it was extracted.

In order to extract my initramfs, I applied the following script (which is an adaptation I made to this one http://xdaforums.com/wiki/Extract_initramfs_from_zImage) to a zImage kernel included in a stockrom that worked fine in my device:

#!/bin/bash

#
#Source: http://xdaforums.com/wiki/Extract_initramfs_from_zImage
#
#Extract initramfs from zImage
#
#initramfs provides the rootfs when booting a Linux kernel on a mobile device.
#Below script may be helpful if you are interested in extracting such an image from a zImage kernel file.
#Tested on Ubuntu for Samsung Galaxy S firmware. Other zImages may have different archiving options - would require a #modification to the script...
#
#After extracting the initramfs, it can be unpacked into the local directory with
#
#cpio -v -i --no-absolute-filenames < <path-to-initramfs.img>
#

zImage=$1
#========================================================
# find start of gziped kernel object in the zImage file:
#========================================================

#
# Next two lines modified by Federico Linares
#
p1=`perl -e 'print "\x1F\x8B\x08"'`	# Added by Federico Liares
pos=`grep -P -a -b --only-matching $p1 $zImage | cut -f 1 -d :`	# Modified by Federico Linares
echo "-I- Extracting kernel image from $zImage (start = $pos)"

#========================================================================
# the cpio archive might be gzipped too, so two gunzips could be needed:
#========================================================================
dd if=$zImage bs=1 skip=$pos | gunzip > /tmp/kernel.img
pos=`grep -P -a -b -m 1 --only-matching $'\x1F\x8B\x08' /tmp/kernel.img | cut -f 1 -d :`
#===========================================================================
# find start and end of the "cpio" initramfs image inside the kernel object:
# ASCII cpio header starts with '070701'
# The end of the cpio archive is marked with an empty file named TRAILER!!!
#===========================================================================
if [ ! $pos = "" ]; then
echo "-I- Extracting compressed cpio image from kernel image (start = $pos)"
dd if=/tmp/kernel.img bs=1 skip=$pos | gunzip > /tmp/cpio.img
start=`grep -a -b -m 1 --only-matching '070701' /tmp/cpio.img | head -1 | cut -f 1 -d :`
end=`grep -a -b -m 1 --only-matching 'TRAILER!!!' /tmp/cpio.img | head -1 | cut -f 1 -d :`
inputfile=/tmp/cpio.img
else
echo "-I- Already uncompressed cpio.img, not decompressing"
start=`grep -a -b -m 1 --only-matching '070701' /tmp/kernel.img | head -1 | cut -f 1 -d :`
end=`grep -a -b -m 1 --only-matching 'TRAILER!!!' /tmp/kernel.img | head -1 | cut -f 1 -d :`
inputfile=/tmp/kernel.img
fi

# 11 bytes = length of TRAILER!!! zero terminated string, fixes premature end of file warning in CPIO
end=$((end + 11))
count=$((end - start))
if (($count < 0)); then
echo "-E- Couldn't match start/end of the initramfs image."
exit
fi
echo "-I- Extracting initramfs image from $inputfile (start = $start, end = $end)"
dd if=$inputfile bs=1 skip=$start count=$count > initramfs.cpio

And that's almost all. At this point everything works fine except the Wifi. I think I have to link it to the kernel as a module, but I am not sure where to get the module from.

Any help would be greatly appreciated.

______________________________

Device: GT-I9100

Android version: 4.0.3

Baseband: I9100BULP6

Kernel: 3.0.15-I9100G

Compilation: IML74K.BULPC