`
yangzhiyong77
  • 浏览: 967182 次
文章分类
社区版块
存档分类
最新评论

龙芯fuloong2f 内核编译简略总结

 
阅读更多

本地编译

在文件/etc/apt/sources.list 添加源
http://dev.lemote.com/debian lenny main contrib non­free
http://dev.lemote.com/debian­loongson loongson main
安装编译工具:
apt­get install gcc

下载内核源码
git clone git://dev.lemote.com/linux_loongson.git #将 git 仓库克隆下来
git checkout origin/linux­2.6.27.1­lemote –b linux­2.6.27.1­lemote #使用 2.6.27.1 分支源码

使用默认配置编译
cp arch/mips/configs/ls2f_notebook_config .config #使用 yeeloong 的默认配置
cp arch/mips/configs/ls2f_fuloong_defconfig .config #如果为 fuloong2f 编译内核请使用这个配
置。
make menuconfig #配置内核
make #编译内核
make modules_install #安装模块

使用新内核
将编译好的 vmlinux 拷贝到目录/boot
修改/boot/boot.cfg 中 kernel 一行,指向新内核。

交叉编译

叉编译工具链:
地址:http://dev.lemote.com/debian­loongson/code/gcc­3.4.6­newbin.ls2f.tar.gz
tar xf gcc­3.4.6­newbin.ls2f.tar.gz –C /opt #解压
chmod +x /opt/gcc­3.4.6­newbine/bin ­R #添加可执行权限
编辑~/.bashrc,在文件最后添加 export PATH=/opt/gcc­3.4.6­newbin/bin:$PATH

下载内核源码

同上

使用默认配置编译
cp arch/mips/configs/ls2f_notebook_defconfig .config #yeeloong 配置
cp arch./mips/configs/ls2f_fuloong_defconfig .config #如果是为 fuloong2f 编译请使用该配置
make ARCH=mips menuconfig #配置内核选项
make ARCH=mips CROSS_COMPILE=mipsel­linux­ #编译内核
make ARCH=mips CROSS_COMPILE=mipsel­linux­ modules_install #安装内核模块
注意:这里模块默认安装在/lib/modules 下面的,考虑到交叉编译可以在 Makefile 中的添加
export INSTALL_MOD_PATH=/path/to/your/dir 然后打包传到 yeeloong 或者 fuloong 机器上

用默认配置不能使用USB键盘鼠标,需要把内核的OHCI选上

更多内容参考http://dev.lemote.com/code/linux_loongson

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics