制作Loongson版Debian squeeze系统(非LFS)
来源:互联网 发布:怎么查淘宝店铺地址 编辑:程序博客网 时间:2024/04/28 22:03
制作Loongson版Debiansqueeze系统
2012-11-21
1.背景
本文档试图通过官方源码为龙芯2F笔记本制作Debiansqueeze系统。
需要的设备:
2.制作squeeze基本系统(在龙芯母机上运行)
2.1下载基本系统
2.2设置root密码:
3.制作内核
3.1使用源码安装内核(在X86母机上运行)
3.1.1制作编译内核的交叉工具链
采用gcc4.4.4+binutils-2.20.1,请在gnu网站上自行下载
mkdir toolchain
cd toolchain
wget gcc4.4.4.tar.bz2和binutils-2.20.1.tar.bz2
编译binutils-2.20.1,vimake-binutils.sh,写入如下内容:
#!/bin/sh
cross_host="x86_64-linux-gnu"
cross_target="mips64el-linux"
dell_install_path="/Your-Install-Path/install"
binutils_version="binutils-2.20.1"
binutils_suffix=".tar.bz2"
#mkdir -pv ./install
# build binutils-2.20
if [ ! -e ./$binutils_version ]; then
fi
if [ -e ./build-binutils ]; then
fi
mkdir -pv ./build-binutils
cd build-binutils
../$binutils_version/configure--prefix=$dell_install_path
--build=$cross_host --host=$cross_host--target=$cross_target
--enable-shared --disable-werror -v \
&& make \
&& make install
cd ../
echo "End of building binutilstoolchain"
运行../make-binutils.sh,如果在configure过程中停掉,请安装相应包,并重新执行
编译gcc-4.4.4,vimake-gcc.sh,写入以下内容:
#!/bin/sh
cross_host="x86_64-linux-gnu"
cross_target="mips64el-linux"
dell_install_path="/Your-Install-Path/install"
gcc_version="gcc-4.4.4"
gcc_suffix=".tar.bz2"
sudo apt-get install libgmp-dev libmpfr-devlibmpc-dev
if [ ! -e ./$gcc_version ]; then
fi
if [ -e ./build-gcc ]; then
fi
mkdir -pv ./build-gcc
cd ./build-gcc
env
../$gcc_version/configure--prefix=$dell_install_path
--build=$cross_host --host=$cross_host--target=$cross_target
--disable-shared --enable-languages=c--disable-threads--disable-werror
-v \
&& make all-gcc -j4\
&& make install-gcc
cd ../
运行../make-gcc.sh,如果在configure过程中停掉,请安装相应包,并重新执行
3.1.2编译龙芯2F笔记本的内核
从官方下载最新内核源码,例如linux-3.5.1.tar.bz2
tar xf linux-3.5.1.tar.bz2
cd linux-3.5.1
cp arch/mips/configs/lemote2f_defconfig./.config
make ARCH=mips menuconfig, 检查一下并退出
make ARCH=mipsCROSS_COMPILE=/Your-Install-Path/install/bin/mips64el-linux-
3.2使用apt安装内核((在龙芯母机上运行,未测试)
chroot ./chroot-squeeze
vi /etc/apt/sources.list,写入以下内容:
debhttp://linux-libre.fsfla.org/pub/linux-libre/lemote/gnewsense metadmain
保存退出
wgethttp://www.fsfla.org/svnwiki/selibre/linux-libre/download/SIGNING-KEY
apt-key add SIGNING-KEY
apt-get update
apt-cache search linux-image loongson
最后用apt-getinstall安装有loongson 2f字样的内核包
4.制作系统硬盘(需要将龙芯2F笔记本的硬盘接入X86母机或者龙芯母机,然后在母机上操作)
假设龙芯2F笔记本的硬盘(以sata硬盘为例)分区sdb1(sda为已有硬盘)为系统安装分区,大小至少需要5G
mkfs.ext3 /dev/sdb1
mount /dev/sdb1 /mnt
cp -af ./chroot-squeezedebian/patches/
wgethttp://jasonwoof.com/downloads/01_mips-sarea.diff
echo"01_mips-sarea.diff" >> series
cd../..
dpkg-buildpackage -b -uc
cd..
dpkg -ixserver-{common,xephyr,xorg-{core,dev}}_*.deb
其中01_mips-sarea.diff的内容如下:
diff -urNxorg-server-1.3.0.orig/hw/xfree86/dri/sarea.hxorg-server-1.1.1/hw/xfree86/dri/sarea.h
---xorg-server-1.3.0.orig/hw/xfree86/dri/sarea.h
+++xorg-server-1.3.0/hw/xfree86/dri/sarea.h
@@ -44,6 +44,8 @@
+#elif defined(__mips__)
+#defineSAREA_MAX
diff --gita/hw/xfree86/os-support/linux/lnx_video.cb/hw/xfree86/os-support/linux/lnx_video.c
index 688106a..1552860 100644
---a/hw/xfree86/os-support/linux/lnx_video.c
+++b/hw/xfree86/os-support/linux/lnx_video.c
@@ -505,9 +505,10 @@ _X_EXPORT volatile unsignedchar *ioBase = NULL;
-#if defined(__powerpc__)
+#if defined(__powerpc__) ||defined(__mips__)
+
@@ -532,7 +533,22 @@ xf86EnableIO(void)
-#elif !defined(__mc68000__) &&!defined(__sparc__) && !defined(__mips__) &&!defined(__sh__) && !defined(__hppa__) &&!defined(__s390__) && !defined(__arm__) &&!defined(__m32r__)
+#elif defined(__mips__)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#elif !defined(__mc68000__) &&!defined(__sparc__) && !defined(__sh__) &&!defined(__hppa__) && !defined(__s390__) &&!defined(__arm__) && !defined(__m32r__)
6.4配置xorg.conf
vi/etc/X11/xorg.conf,写入以下内容:
#xorg.conf (X.Org X Window System server configurationfile)
#
# Thisfile was generated by dexconf, the Debian X Configuration tool,using
#values from the debconf database.
#
# Editthis file with caution, and see the xorg.conf manualpage.
# (Type"man xorg.conf" at the shell prompt.)
#
# Thisfile is automatically updated on xserver-xorg package upgrades*only*
# if ithas not been modified since the last upgrade of thexserver-xorg
#package.
#
# Ifyou have edited this file but would like it to be automaticallyupdated
#again, run the following command:
#
Section"Device"
EndSection
Section"Screen"
EndSection
7.安装gnome(在龙芯2F笔记本上操作)
apt-get install gdm3
restart
结束!
参考文献:
http://wiki.debian.org/DebianYeeloong/HowTo/Install
- 制作Loongson版Debian squeeze系统(非LFS)
- Debian squeeze 美化字体
- Debian(squeeze)安装OpenCv
- debian squeeze安装ibus
- 第三章 制作LFS系统的准备工作
- LFS系统安装镜像制作
- LFS制作
- LFS制作
- debian squeeze (testing)安装virtualbox
- squeeze debian更换默认浏览器
- 临时-loongson系统安装
- Debian Squeeze下升级Virtualbox虚拟机
- debian squeeze 6 非常好的台湾源。
- Debian 6 (Squeeze) 下编译内核
- 在 Debian Squeeze中安装 fcitx 输入法
- debian Squeeze 编译安装vim 7.3
- debian Squeeze 安装chrome deb包,flash
- debian Squeeze 安装gnome截图软件.
- 容易的导出excel
- 加速ssh登陆认证
- mysql 服务没了
- Linux命令行如何关闭屏保
- 解决VIM插件/colorscheme出现E492不是编辑器命令 ^M
- 制作Loongson版Debian squeeze系统(非LFS)
- 解决龙芯3A Debian6.0.3 o32系统编译oprofile的libbfd动态链接问题
- hdu 2852 KiKi's K-Number 线段树
- 解决龙芯3A Debian6.0.3 o32系统编译xorg-xserver-1.7.7出错的问题
- nagios学习笔记
- virtualbox压缩vdi硬盘
- 解决龙芯3A运行madd.d指令报错“非法指令“的问题
- 关于龙芯3A运行gsdivu除法指令的问题
- will be doing的用法