Kernel compile :

Do it on user not root :

1. Make sure you have an appropriate environment to get the source (git) and to compile the kernel. Install git, gcc, make and libncurses5-dev at least. For Ubuntu based distributions.
apt-get install git-core build-essential libncurses5-dev

2. Create a directory to hold the kernel sources
mkdir ~/htcleo
3. Download the kernel source
cd ~/htcleo
git clone git://git.linuxtogo.org/home/groups/mobile-linux/kernel.git
cd kernel
git checkout -b htc-qsd8k-2.6.29 origin/htc-qsd8k-2.6.29

4. Download and decompress the arm toolchain (64mb)
cd ~/htcleo
wget http://www.codesourcery.com/gnu_tool...ux-gnu.tar.bz2
tar xjf arm-2008q1-126-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

5. Generate the default .config for the kernel(ARCH is case sensitive)
cd kernel
make htcleo_defconfig ARCH=arm

6. Compile
export PATH=~/htcleo/arm-2008q1/bin:$PATH
make Image ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-


Find your kernel Image in /htcleo/kernel/arch/arm/boot/ 

Now you can configure your proper kernel :
mousepad (Xfce) or gedit (Gnome) ~/htcleo/kernel/arch/arm/configs/htcleo_defconfig
cd ~/htcleo/kernel
make mrproper
make htcleo_defconfig ARCH=arm
export PATH=~/htcleo/arm-2008q1/bin:$PATH (must need once time)
make Image ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-

Use git pull in ~/htcleo/kernel to update file and recompile to have the last modified on development 



Initrd compile :

Need to be root !

1. Download initrd.gz from other HTC compiled
mkdir initrd (or anything else in propely folder nothing else on)
cd initrd (put your initrd.gz here)
gzip -dc initrd.gz | cpio -id
Now you have all file and folder you can touch and modified
Use mousepad or gedit on root 


2. Recompile proper
rm initrd.gz (before do a copy for other instance)
find (all name of folder and file) | cpio --create --format='newc' > initrd



Compile source for Arm :
(root user)
On source folder :
#export ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- PATH=(your path)/arm-2008q1/bin:$PATH
#CC=arm-none-linux-gnueabi-gcc ./configure --host=arm-none-linux-gnueabi --target=arm-none-linux-gnueabi
# make