准备刻一张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
|
如对本文有疑问,
点击进行留言回复!!
相关文章:
-
-
-
-
FreeBSD 远程存取
0. 前言
若以服务器管理而言,我们不能够老是待在主机旁边,必须要有远程访问系统 (telnet 、 ftp) 的需要。 但因为这两个协议并不很安全,所以...
[阅读全文]
-
-
FREEBSD手工配置网络
在FreeBSD系统中,网络能力十分重要,对于一个标准的FreeBSD系统,至少要有一个网络界面以便与其他计算机通信。最常见的网络界面为以太网卡。此外FreeB...
[阅读全文]
-
-
-
删除 FreeBSD 账号
0. 前言 新增了使用者之后,就必须要了解如何删除使用者。
1. 删除账号 请以 root 的身分,执行这个 rmuser 这个命令。
系统询...
[阅读全文]
-
新增 FreeBSD 账号
0. 前言
因为 root 这个账号为系统管理者,所以请尽量养成好习惯。 如非必要请采用其它账号进行工作。 再加上,通常我们都是采用远程登入系统,所以要有...
[阅读全文]
-
网友评论