[LG Optimus 2x] :
My kernel build setup on a paltry VirtualBox VM - serves the purpose!

# The initial setup for building kernel
# DISCLAIMER: I HAVE TRIED THIS AND IT WORKS FOR ME
# DO NOT HOLD ME RESPONSIBLE IF IT DOES NOT WORK OR CAUSE ANY HARM

# Get git
$ sudo apt-get install git

# Get the gcc arm cross compilers
$ sudo apt-get install gcc-arm-linux-gnuabi
$ sudo apt-get install g++-arm-linux-gnuabi

# Get the tool for making a boot image
$ sudo apt-get install abootimg

# Get zip/unzip to make a flashable zip
$ sudo apt-get install zip

# Checkout the kernel source from RC (since we are on O2X thread)
$ git clone git://github.com/CyanogenMod/lge-kernel-star.git
$ cd lge-kernel-star
$ export BUILDROOT=`pwd`

# Copy the following lines into a shell script and put it under $PATH
# File: buildkernel ----- STARTS HERE -----
#!/usr/bin/env bash

ARMABI=arm-linux-gnueabi-
if [ ! -x `which ${ARMABI}gcc` ] ; then
# Fallback to android provided tools
ARMABI=../prebuilt/linux-x86/toolchain/arm-eabi-4.3.1/bin/arm-eabi-
fi

echo Using CROSS_COMPILE: ${ARMABI}
${ACTION} make star_cyanogenmod_defconfig ARCH=arm
${ACTION} make -j4 ARCH=arm CROSS_COMPILE=${ARMABI} $*
# File: buildkernel ----- ENDS HERE -----

# Usage of buildkernel
# change into the kernel folder you just cloned using git and execute it
$ buildkernel

# Change into a new clean folder for making a boot image
# Copy the newly built zImage into this folder

# Copy the boot.img from CM7 nightly as we need it to extract the RAM FS
$ unzip cm_p990_full-xxx.zip boot.img

# Copy the following lines into a shell script and put it under $PATH
# File: makeboot ----- STARTS HERE -----
#!/usr/bin/env bash
KERNEL=zImage
RAMDISK=initrd.img
BOOTIMAGE=boot.img

$ACTION abootimg -x ${BOOTIMAGE} bootimg.cfg ${RAMDISK}
$ACTION mv ${BOOTIMAGE} ${BOOTIMAGE}.orig
$ACTION abootimg --create ${BOOTIMAGE} -k ${KERNEL} -r ${RAMDISK} -f bootimg.cfg

# Kanged from CM7 build
size=$(for i in ${BOOTIMAGE}; do stat --format "%s" "$i" | tr -d '\n'; echo +; done; echo 0); total=$(( $( echo "$size" ) )); printname=$(echo -n "${BOOTIMAGE}" | tr " " +); echo "$printname total size is $total"; img_blocksize=135168; if [ "" == "yaffs" ]; then reservedblocks=8; else reservedblocks=0; fi; twoblocks=$((img_blocksize * 2)); onepct=$(((((8650752 / 100) - 1) / img_blocksize + 1) * img_blocksize)); reserve=$(((twoblocks > onepct ? twoblocks : onepct) + reservedblocks * img_blocksize)); maxsize=$((8650752 - reserve)); if [ "$total" -gt "$maxsize" ]; then echo "error: $printname too large ($total > [8650752 - $reserve])"; false; elif [ "$total" -gt $((maxsize - 32768)) ]; then echo "WARNING: $printname approaching size limit ($total now; limit $maxsize)"; fi
# File: makeboot ----- ENDS HERE -----

# To make a new boot.img with the new kernel, execute 'makeboot' in the folder
# containing the copied boot.img and built kernel zImage
$ makeboot
$ export BOOTROOT=`pwd`

# Create a new folder to make a flashable zip
# Under the new folder, create the following folder structure
$ mkdir -p system/lib/modules
$ mkdir -p META-INF/com/google/android

# Copy the updater-binary from the CM7 nightly
$ cd META-INF/com/google/android
$ unzip cm_p990_full-xxx.zip META-INF/com/google/android/update-binary

# Copy the following lined into the META-INF/com/google/android/updater-script
# File: updater-script ----- STARTS HERE -----
assert(getprop("ro.product.device") == "p990" || getprop("ro.build.product") == "p990" || getprop("ro.product.board") == "p990");
ui_print("Flashing LGE kernel...");
package_extract_file("boot.img", "/dev/block/mmcblk0p5");
# Consider changing it to ext4 is using upcoming change with support for EXT4
mount("ext3", "EMMC", "/dev/block/mmcblk0p1", "/system");
package_extract_dir("system", "/system");
set_perm_recursive(0, 0, 0755, 0644, "/system/lib/modules");
unmount("/system");
ui_print("Flashed LGE kernel!");
# File: updater-script ----- ENDS HERE -----

# Copy the new boot.img
$ cp $BOOTROOT/boot.img .

# !!!! NOW, remember to copy wireless.ko from the kernel build into the zip !!!!
$ for ii in `find ${BUILDROOT} -type f -name *.ko` ; do cp $ii system/lib/modules/.; done

# You folder structure would look like this
# .
# |-- META-INF
# | `-- com
# | `-- google
# | `-- android
# | |-- update-binary
# | `-- updater-script
# |-- boot.img
# `-- system
# `-- lib
# `-- modules
# |-- ansi_cprng.ko
# |-- scsi_wait_scan.ko
# `-- wireless.ko

# Let us now make the flashable zip
$ zip -r kernel-update.zip META-INFO system

# ---- HOPE THE NEW KERNEL ZIP FLASHES AND WORKS FOR YOU ----