当前位置: 首页 > 图文教程 > 操作系统 > Unix/Linux > FreeBSD系统下创建DVD.iso安装光盘

Unix/Linux
libtcl8.3下载|无法找到libtcl8.3
libmysqlclient.so.10无法找到
Linux+Apache+PHP+MySQL+Zend Optimizer+PHPMyAdmin
glibc安装错误|glibc安装出错
Zlib是什么?|Zlib的作用是什么?|Zlib有什么作用?
什么是glibc?glibc是什么?什么是freetype?freetype是什么?什么是?Xlib是什么?什么是lo
ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)
mysqld是什么意思?如何卸载mysqld?
linux 卸载 mysql
rpm 命令|rpm 安装|rpm 卸载|rpm 使用|rpm 删除
linux下tar命令rpm命令参数列表
linux rpm卸载参数
ERROR 1045: Access denied for user: root@localhost (Using password: NO)
您的服务器不支持mysql数据库
服务器不支持mysql数据库
mysql 如何添加/创建用户
/usr/bin/install: 无法创建一般文件‘/usr/local/man/man1/cjpeg.1’: 没有那个文件
png.h:329:18: zlib.h: 没有那个文件或目录
您的服务器不支持MySql数据库,无法安装论坛程序
phpMyAdmin

Unix/Linux 中的 FreeBSD系统下创建DVD.iso安装光盘


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2010-01-15   浏览: 48 ::
收藏到网摘: n/a

准备刻一张FreeBSD-7.0-RELEASE的DVD,网上很多介绍都是在Windows下使用什么iso提取工具的,貌似很麻烦。参考了一些FreeBSD高手的实现,我写了一个简单的脚本,主要功能是从3张disc*.iso创建出一个dvd.iso

1,准备工作:
工作目录 work/ 和 3张disc*.iso, 比如
work/7.0-RELEASE-i386-disc1.iso
work/7.0-RELEASE-i386-disc2.iso
work/7.0-RELEASE-i386-disc3.iso

2,用以下代码创建脚本文件,比如 mkdvd.sh,放在work目录下。用root用户执行,将在work目录下产生一个7.0-RELEASE-i386-dvd.iso的文件。

                                      
            

#!/bin/sh
            
            disc1=`ls | grep "disc1.iso"`
            disc2=`ls | grep "disc2.iso"`
            disc3=`ls | grep "disc3.iso"`
            
            dvd=`echo $disc1 | sed "s/disc1/dvd/"`
            
            ## Prepare temporary dir to store dvd files
            if                                                                                 test                                                                                 -e tmp &&                                                                                 test                                                                                 -d tmp
            then
                rm -fr tmp
            fi
            mkdir tmp
            
            ## Extract contents of each disc*.iso to temporary dir
            for disc in $disc3 $disc2 $disc1
            do
                mdconfig -a -f $disc -u 66
                if                                                                                 test                                                                                 -e /dev/md66
                then
                echo Extract $disc ...
                mount -t cd9660 /dev/md66 /mnt
                tar -cf -                                                                                 -C /mnt .                                                                                 | tar -xf -                                                                                 -C tmp/
                umount /mnt
                mdconfig -d -u 66
                else
                echo Can not create memory disk.
                exit                                                                                 -1
                fi
            done
            
            ##                                                                                 Merge index to point to the first disc
            echo Merge index ...
            cd tmp
            cat INDEX | sed "s/||2/||1/g"                                                                                 > index
            cat index | sed "s/||3/||1/g"                                                                                 > INDEX
            cat INDEX | sed "s/|3/|1/g"                                                                                 > index
            mv index INDEX
            cd ..
            
            ## Make dvd iso file
            echo Make $dvd ...
            mkisofs -R -no-emul-boot -b boot/cdboot -o $dvd tmp
            rm -fr tmp
            
            exit 0