当前位置:首页 » 软件开发
开发技术指南» 文章正文
    引言: 2005-3-31更新 OpenBSDLiveCD制作过程 刚开始接触OpenBSD时,我就很想使用OpenBSDLiveCD,但没找到。
 

 

 ·freebsd 5.3下安装jail(源创)    »显示摘要«
    摘要: freebsd 5.3下安装jail 作者:梅劲松 感谢:黄冬 按照黄冬的文章在fb5.3下安装jail未果,他提醒我fb5.3的jail已经发生了变更,在他的帮助下成功在fb5.3下安装了jail,整理成资料大家分享一下。 首先安装系统时,最好划分一个单独的分区来存放你的vhost,如果不想变更你的分区设置。也可以将vhost安装在你的/usr或者/home中。如果你有了cvsup,请到......
    摘要: 1:前言 我们学校以前是用的教育网,所有办公机器、机房用的都是公网地址,由于前段时间更换网络出口,换为网通的宽带,所以才作了代理,因为学校领导还没完全确定以后还用不用教育网,所以要求下面机器原来的网络设置不能改变,经过自己摸索,加上cu、freebsdchina上面的各位高手帮忙,现在已经全部搞定,实现了透明代理,下面的机器网络设置跟以前用教育网的一样,可以随时再开通教育网,不敢独享,拿出来......


OpenBSD LiveCD制作过程

2005-3-31更新 【程序编程相关:SA299第九章读书笔记

【推荐阅读:SA299第十一章读书笔记

【扩展信息:阅读笔记:链接器 - 源代码漫游

openbsd livecd制作过程

    刚开始接触openbsd时,我就很想使用openbsd livecd,但没找到.今年1月那时起就想自己做一个livecd,一个新年一过, 就将它放下了,现在又重新开始制作,今天写这篇文章只是我思路的一个开始,制作的livecd,还不完善,我会后续为其改进.

    制作过程:

一. 准备工作:

1. 一个能运行openbsd系统的所需要的必备文件,这里我就没像一些mini livecd那样对系统进行剔牛肉进行精减了,只是将一个能运行的系统的所有文件进行备份.而且如果备份的文件不大, 那制作出的livecd就很小, 我们就可以将这个备份的系统文件也一起放进cd中, 到时就可以用这个livecd安装系统,方法就是我今年1月3日写的«openbsd  另类安装法».

2. openbsd系统的源程序,我们在制作过程中需要编译光盘镜像.

二. 将备份的系统文件解开到一个目录下,我将以这个目录作为livecd的根目录制作cd,如/usr/live/.

三. 将openbsd源程序解开到/usr/src下,然后:

1. 安装必须的程序:

# cd /usr/src/distrib/crunch/crunchgen

#make; make install

#cd /usr/src/distrib/crunch/crunchide

#make; make install

 

2. 定制内核

内核文件是/usr/src/sys/arch/i386/conf/ramdisk_cd,我们需要对这个文件进行修改,其中有三行最重要,一定不能少:

 option  mfs

 option  union

 config  bsd root on cd0a

livecd运行于mfs上,而且它的根目录在cd上.

还有其它一些选项如:

 option small_kernel

 option no_proplice

 option timezone=0

 option dst=0

 option ramdisk_hooks

 option minirootsize=3560

需要将一些多余的东西删除,因此这个内核大小控制在2.88m以内, 太大时会编译失败.我的ramdisk_cd是将/usr/src/sys/arch/i386/conf/generic 与/usr/src/sys/conf/generic这两个文章合并然后去掉一些内容整理出来的.

3. 编译内核

# cd /usr/src/distrib/i386/ramdisk_cd

#make

成功后会在目录下生成cdrom36.fs这个文件,我们将这个文件复制到制作livecd的目录下/usr/live/.

四. 修改/usr/live/etc中的各类文件

1.fstab

[code:1:1af21cc135]

/dev/cd0a / cd9660 ro,noatime 0 0

swap /dev mfs rw,noatime,union,-s=16384 0 0

swap /tmp mfs rw,nodev,noexec,nosuid,noatime,-s=32768 0 0

swap /etc mfs rw,noatime,-s=16384 0 0

swap /var mfs rw,noatime,-s=16384 0 0

swap /home mfs rw,noatime,-s=16384 0 0

[/code:1:1af21cc135]

以前我没发现fstab的功能居然如此强大, 以为它只能mount已分好的挂载点, 原来它在光盘系统中还可以在启动时自动挂载写入fstab中的mfs.

2.rc

   openbsd启动时首先读取这个文件, 如果找不到它就会读取根目录下的/.profile文件进行初始配置.

   修改/etc/rc文件, 三个地方修改

[code:1:1af21cc135]    

# $openbsd: rc,v 1.251 2004/08/21 08:17:28 hshoexer exp $

# system startup script run by init on autoboot

# or after single-user.

# output and error are redirected to console by init,

# and the console is the controlling terminal.

# subroutines (have to come first).

# strip comments (and leading/trailing whitespace if ifs is set)

# from a file and spew to stdout

stripcom() {

local _file="$1"

local _line

{

while read _line ; do

_line=${_line%%#*} # strip comments

test -z "$_line" && continue

echo $_line

done

} < $_file

}

# end subroutines

stty status ^t

# set shell to ignore sigint (2), but not children;

# shell catches sigquit (3) and returns to single user after fsck.

trap : 2

trap : 3 # shouldnt be needed

home=/; export home

path=/sbin:/bin:/usr/sbin:/usr/bin

export path

if [ $1x = shutdownx ]; then

dd if=/dev/urandom of=/var/db/host.random bs=1024 count=64 >/dev/null 2>&1

chmod 600 /var/db/host.random >/dev/null 2>&1

if [ $? -eq 0 -a -f /etc/rc.shutdown ]; then

echo /etc/rc.shutdown in progress...

. /etc/rc.shutdown

echo /etc/rc.shutdown complete.

# bring carp interfaces down gracefully

for hn in /etc/hostname.carp[0-9]*; do

# strip off /etc/hostname. prefix

if=${hn#/etc/hostname.}

test "$if" = "carp[0-9]*" && continue

ifconfig $if > /dev/null 2>&1

if [ "$?" != "0" ]; then

ifconfig $if down

fi

done

if [ "x${powerdown}" = x"yes" ]; then

exit 2

fi

else


...   下一页
    摘要: apache+ssl, php, and mysql updated: 12/10/2004 general information im sure many of you have been wondering how people host secure sites using secure sockets layer (ssl). this guide will show ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE