Platform: Debian Wheezy
Cross Compiler: arm-linux-gnueabihf-gcc-4.7
- Set Emdebian apt repo.
vi /etc/apt/sources.list
deb http://www.emdebian.org/debian sid main - Update apt repo. and then add Emdebian keyring. Last, install the cross compiler.
>> sudo apt-get update
>> sudo apt-get install emdebian-archive-keyring
>> sudo apt-get install gcc-4.7-arm-linux-gnueabihf - Set symbolic link of arm-linux-gnueabihf-gcc
>> sudo ln -s /usr/bin/arm-linux-gnueabihf-gcc-4.7 /usr/bin/arm-linux-gnueabihf-gcc - Download Raspberry Pi Linux kernel source code from github
>> git clone https://github.com/raspberrypi/linux.git - Clean the build directory
>>ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make mrproper - Copy Raspberry Pi kernel config file
>> cp arch/arm/configs/bcmrpi_defconfig .config - Check or Modify kernel features (need libncurses5-dev)
>>ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make menuconfig - Build kernel Image
>>ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make Image - If already has a bootable SD card, copy file to replace kernel.img in the SD card.
>> cp arch/arm/boot/Image /media/SD_CARD/kernel.img - Finish.
The other kernel config can use and build OK: bcmrpi_cutdown_defconfig