[HTC One SV] Modding.MyMind:
Alright, I'm back. In regards to AOSP. It won't just simply work for any device even if the kernel is modified for proper support. AOSP is a large open source project. Just like CM, OmniRom, etc. The source has to be download, then you must put together a device tree which is basically a bunch of ".mk" files along with things which are needed specifically for your device. Would go in grave detail about this, but that is a tutorial in itself. Nevertheless, once all that has bee setup, you proceed to build the Rom then install to your device and proceed to work out any bugs (which there will be bugs).

I do not use windows. I use linux. Linux is required in order to build/develop kernels, Roms, etc. If you are using windows then you must either split your system for dual booting between windows and linux or you must run a virtual program that will allow for linux to operate on your computer while also running windows at the same time. I HIGHLY RECOMMEND you remove windows and do a clean install of linux if you plan to develop.

---------- Post added at 10:19 PM ---------- Previous post was at 09:42 PM ----------

To build a kernel, it must be done on linux. You need an arm toolchain. For our kernel source, arm-eabi-4.6 is recommended. To use a different toolchain other than that would require you to make some changes to the kernel source to prevent build errors.

You have to export the path to your toolchain.

Here is a script I use when building my kernel. Study it and it should be helpful for you.

#!/bin/bash

#######################################
# Remove prebuilt kernel from last build
#rm ~/cm11/kernel/htc/k2_cl/output/kernel/zImage
if [ -e zImage ]; then
rm zImage
fi
#######################################

#######################################
# Remove logs from last build
rm kernelcompile.log
rm modulecompile.log
#######################################

############################################################

# Set Default Path's here!
TOP_DIR=$PWD

# KERNEL_PATH is the folder where your kernel source is located.
KERNEL_PATH="/home/moddingmymind/cm11/kernel/htc/k2_cl"

# STRIP is the strip brinary from the toolchain to strip unneeded symbols after the build is finished to help reduce size.
STRIP="/home/moddingmymind/arm-eabi-4.6/bin/arm-eabi-strip"

# OUTPUT is the folder where I place my finish builds.
OUTPUT="/home/moddingmymind/cm11/kernel/htc/k2_cl/output"

# Set toolchain path here! This will be the directory to your current toolchain.
TOOLCHAIN="/home/moddingmymind/arm-eabi-4.6/bin/arm-eabi-"

############################################################

#######################################
# KBUILD_BUILD_VERSION will set the name of the final build.
export KBUILD_BUILD_VERSION="JesusFreak"

# KERNELDIR is the path to the folder where your kernel source is located at.
export KERNELDIR=$KERNEL_PATH
#######################################

#echo "Cleaning latest build"
# make is a simple command needed to build makefiles.
# ARCH is simply telling it what type of architecture the machine is.
# CROSS_COMPILE is merely pointing the building process to the actual toolchain needed to make this work.
# The following is simply determining how many processors your computer currently has and applies that to "-j#" where "#" is your total processors. This reflects the speed of your build.

make ARCH=arm CROSS_COMPILE=$TOOLCHAIN -j`grep 'processor' /proc/cpuinfo | wc -l` mrproper

# Making our .config
#Sources will always have a defconfig file. For the kernel, you MUST make your .config file specific to your device or your build WILL fail.

make k2_cl_defconfig

# Make our menuconfig before proceeding with the build.
# This will bring up a window where you can make neceassary changes to your kernel source through a gui implementation prior to building your source.

make menuconfig

# Make Kernel using proper number of processors and store verbose in log file for review.

make -j`grep 'processor' /proc/cpuinfo | wc -l` zImage ARCH=arm CROSS_COMPILE=$TOOLCHAIN >> kernelcompile.log 2>&1 || exit 1

# Make Modules using proper number of processors and store verbose in log file for review

make -j`grep 'processor' /proc/cpuinfo | wc -l` modules ARCH=arm CROSS_COMPILE=$TOOLCHAIN >> modulecompile.log 2>&1 || exit 1

# make ARCH=arm CROSS_COMPILE=$TOOLCHAIN -j4 modules >> modulecompile.log

# Copying kernel modules after making install of modules

sudo make modules_install

mkdir $OUTPUT/tempo;
cp -r '/lib/modules/3.4.10.JesusFreak/kernel' $OUTPUT/tempo/;
sudo rm -rf '/lib/modules/3.4.10.JesusFreak';

find $OUTPUT/tempo/kernel/ -name '*.ko' -exec cp -av {} $OUTPUT/modules/ \;
rm -rf $OUTPUT/tempo;

# Strip modules
cd $OUTPUT/modules
$STRIP --strip-unneeded *.ko

# Copy Kernel Image
rm -f $OUTPUT/$KBUILD_BUILD_VERSION.zip
cp -f $KERNEL_PATH/arch/arm/boot/zImage $OUTPUT/prebuilt/zImage

# CREATE A ZIP which is prebuilt for flashing in the recovery to install and use.
cd $OUTPUT
zip -r $KBUILD_BUILD_VERSION.zip *

# Remove builds after the zip is completed.
rm -f $OUTPUT/prebuilt/zImage
rm -f $OUTPUT/modules/*.ko