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

全部博文(290)

文章存档

2016年(13)

2015年(3)

2014年(42)

2013年(67)

2012年(90)

2011年(75)

分类: LINUX

2011-03-30 23:06:27

在debian/ubuntu系统中使用使用debootstrap创建自己的MiniLinux系统,方法是:

在HDD上划出来一个分区,大小>5G,然后执行:
view source
print?
1 sudo mkfs.ext3 /dev/xxx

然后,指定一个目录,我使用的是/mnt/minisys。

执行这个命令(怎么有点像LFS?)
view source
print?
1 export MINISYS=你的目录

然后(安装了debootstrap的略过第一行)
view source
print?
1 sudo apt-get install debootstrap
2 sudo debootstrap --arch i386 lenny $MINISYS

lenny代表debian 5.0,用的163的mirror,速度快。

执行完后。执行绑定挂载,以便chroot.(某位仁兄的重启进去太麻烦了。我还准备偷懒打包到虚拟机里搞呢。)
view source
print?
1 mount -v --bind /dev $MINISYS/dev
2 mount -vt devpts devpts $MINISYS/dev/pts
3 mount -vt tmpfs shm $MINISYS/dev/shm
4 mount -vt proc proc $MINISYS/proc
5 mount -vt sysfs sysfs $MINISYS/sys

然后chroot,LFS的老方法。
view source
print?
1 chroot "$MINISYS" /usr/bin/env -i \
2 HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
3 PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin \
4 /bin/bash --login +h

出现这个提示符就对了:

安装编译环境,执行:(问题通通YES。【鸡蛋飞来~】)
view source
print?
1 apt-get install build-essential
2 apt-get install gcc
3 apt-get install make
4 apt-get install autoconf automake
5 apt-get install gcc-4.3
6 apt-get install pkg-config
view source
print?
1 apt-get install bison
2 apt-get install flex
3 apt-get install zlib1g-dev
4 apt-get install libpam0g-dev
5 apt-get install libncurses5-dev
6 apt-get install freetype6
7 apt-get install libpng12-dev

然后便可自由定制。最后sqfs打个包就一切OK.

文章地址为
阅读(1813) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

rgwan2011-10-01 12:11:25

谢谢转载!