Cross-compile Linux kernel 1. download linux kernel source code I used is the linux-loongson-release-zb-kernel.tgz to decompress it to the/usr/src directory: tar-xzvf linux-loongson-release-zb-kernel.tgz in this directory will generate linux-loongson-release directory www.2cto.com II. download the cross-compilation tool: extract the http://dev.lemote.com/files/binary/toolchain/kernel/gcc-3.4.6-newbin.ls2f.tar.gz to the/opt directory, first modify the/opt permission sudo chmod 766/opt tar-xzf gcc1_3.4.61_newbin.ls2f.tar.gz-C/opt and then specify its PATH export PATH =/opt/gcc-3 in the mirror variable. 4.6-newbin/bin: $ PATH can also be written ~ /. Bashrc, easy to use multiple times to set executable permissions chmod + x/opt/gcc-3.4.6-newbin/bin-R www.2cto.com III. the Kernel configuration is in the source code Directory: cp arch/mips/configs/loongson3a_xxxx_config. Note: currently, five loongson3a_dawning_config loongson3a_rs780e_config loongson3a_server_config configuration files are available under arch/mips/configs, and then make config. You will find that the default loongson3a_server_config configuration file is already. 4. compile the kernel www.2cto.com 1. local compilation directly make the completion of kernel compilation 2. cross-Compilation In the root directory of the kernel source code, enter make ARCH = mips CROSS_COMPILE = mipsel-linux-or modify makefile. modify the makefile in the root directory and assign the following value to the ARCH variable: ARCH? = Mips assigned CROSS_COMPILE variable CROSS_COOMPILE? = Mipsel-linux-Note: Before executing this step, make menuconfig to enter the configuration interface and select Enable loadable module support. then, select 3 and 4, or 2 and 4 in the lower-level directories. after the modification, select Save an Alternate Configuration File to Save the modification.