Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1551542
  • 博文数量: 290
  • 博客积分: 3468
  • 博客等级: 中校
  • 技术积分: 3461
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-28 22:21
文章分类

全部博文(290)

文章存档

2016年(13)

2015年(3)

2014年(42)

2013年(67)

2012年(90)

2011年(75)

分类: LINUX

2011-05-24 19:08:36

系统环境:龙芯2F + debian5

# apt-get install debootstrap
# mount /dev/sda8 /mnt
# mkdir -p /mnt/root/minisys
# cd /mnt
loongson:/mnt# debootstrap --arch mipsel squeeze root/minisys 
I: Base system installed successfully.    //提示这个表示基本系统差不多完成了,剩下的就是一些设置了

loongson:/mnt# LANG=C chroot /mnt/root/minisys     //chroot的作用是改变程序执行时所参考的根目录位置
root@loongson:/# apt-get install vim
root@loongson:/# vim /etc/fstab
proc    /proc   proc    defaults        0       0

root@loongson:/# vim /etc/network/interfaces
   auto lo
   iface lo inet loopback

root@loongson:/# dpkg-reconfigure tzdata  //配置时区
root@loongson:/# apt-get installl locales
root@loongson:/# dpkg-reconfigure locales //配置字符集
root@loongson:/# apt-get install  console-data
root@loongson:/# dpkg-reconfigure console-data //配置键盘
root@loongson:/# apt-get clean     //清理缓存(主要是安装时下载下来的软件包)
root@loongson:/# passwd root    //设置密码  此处不设置将不能进入系统

root@loongson:/# exit
loongson:/mnt# mv root/minisys/* ./
loongson:/mnt# reboot

这里少了一步安装内核是因为2F的内核我用的是以前的稳定些,怕网上下的不能用,主要是一些驱动方面的问题
(内核安装过程# apt-cache search linux-image

然后使用所选择的内核软件包名来安装。

# aptitude install linux-image-2.6.32-arch-etc
)

网络标识符相关:
由于网络设置标识符是udev 动态分配的名字,所以名字也不一定会是我们常见的eth0,eth1。
幸运是的我们可以通查看文件知道:
#  cat /proc/net/dev  //从这里我们可以看出这台机器的网络设置标识符是eth2和eth3
Inter-|   Receive                                                |  Transmit
 face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
    lo:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
 bond0:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
dummy0:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
   eql:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
  eth2:    2240      17    0    0    0     0          0         0     5479      41    0    0    0     0       0          0
  eth3:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
  usb0:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
 teql0:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
 tunl0:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
  gre0:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0

我们也通过修改文件来指定:
$ vim /etc/udev/rules.d/70-persistent-net.rules
# PCI device 0x10ec:0x8167 (r8169)
  7 SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:23:9e:ff:e0:36", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
  8
  9 # PCI device 0x10ec:0x8167 (r8169)
 10 SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:23:9e:ff:e0:37", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
 11
 12 # PCI device 0x10ec:0x8167 (r8169)
 13 SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:23:9e:ff:e1:1c", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
 14
 15 # PCI device 0x10ec:0x8167 (r8169)
 16 SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="01:23:23:23:89:aa", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"

整个系统打包之后在 86M

更详细的方法请参考中与debootstrap 的相关章节

2011-05-24


阅读(2353) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~