Chinaunix首页 | 论坛 | 博客
  • 博客访问: 182460
  • 博文数量: 28
  • 博客积分: 1226
  • 博客等级: 中尉
  • 技术积分: 300
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 11:56
文章分类
文章存档

2009年(5)

2008年(9)

2007年(14)

我的朋友
最近访客

分类: LINUX

2008-12-24 16:55:23

#!/bin/bash
# Copyright 2008 (c), YUNIX
# All rights reserved.
#
# Filename   : make_sid_root.sh
# Description: Create base system
# Author     : John YU
# Version    : 1.0
# Date       : 08-12-05

if [ `id -u` -ne 0 ]
then
echo "You must run $0 as root"
exit 1
fi

DestDir=/sid-root

if [ ! -e /usr/sbin/debootstrap ]; then
apt-get install debootstrap
fi
if [ ! -d $DestDir ]; then
cd / ; mkdir $DestDir
fi
if [ ! -d $DestDir/bin ]; then
debootstrap sid $DestDir
cp /etc/hosts $DestDir/etc/hosts
cp $DestDir/etc/apt/sources.list $DestDir/etc/apt/sources.list.bak
cp /etc/apt/sources.list  $DestDir/etc/apt/sources.list
fi

mount |grep "$DestDir"
if  [ $? == 1 ] ;then
mount proc-sid $DestDir/proc -t proc
mount --bind /tmp/.X11-unix $DestDir/tmp/.X11-unix/
fi
echo "YU peng edit"
HOME=/root chroot $DestDir /bin/bash
umount $DestDir/proc

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