LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: dsj

制作Fedora DVD ISO的方法

[复制链接]
发表于 2005-4-12 10:01:00 | 显示全部楼层

fc3, 20050311

http://fedoranews.org/contributors/gene_czarcinski/update_distro/
http://fedoranews.org/contributo ... s-update-distro.pdf

原文的排版很不错, 是 fedora 官方文档的风格
How to update Fedora Core 3 Distribution CDs
by Gene Czarcinski on Feb 27, 2005 (UPDATED 2005-03-11)

The purpose of this document is threefold:

   1.

      Describe how to update Fedora Core 3 distribution CDs and then create new, updated iso images.
   2.

      Describe how to create DVD images instead of CD images.
   3.

      Given an updated distribution, create an updated RescueCD which, optionally, is modified to add additional software.

Some of the information in this document is based on information in Updating and Rebuilding Fedora Core 2 Installation CDs . There is also the currently unmaintained AnacondaDocumentationProject.

While this document describes the process for the i386 distribution, it also applies to the Fedora Core 3 x86_64 distribution and may also be extended to the development tree.
Updating and creating the distribution
Step 1: Preparation

Fedora Core 3 comes with all of the tools necessary to update and rebuild the installation CDs. To perform this does require a fair amount of disk space - approximately 22 GB. Fedora Core 3 is distributed on CD ISO images which total about 4.5 GB. The space requirements are as follows:

   1.

      Space for the distributed ISO images (4.5 GB).
   2.

      Space for the expanded installation tree built from the ISO images (4.5 GB). This tree will be updated during the update/rebuild process.
   3.

      Space for the split trees which will divide the installation tree into ISO image size pieces (4.5 GB).
   4.

      Space for the updated ISO images (4.5 GB).
   5.

      Extra working space used during the rebuild process (1 to 3 GB).

Rounding up and being generous results in needing about 2 GB of space. If you rebuild the optional RescueCD, you will need an addition 1 to 2 GB of space.

Although updating and rebuilding the installation CDs could be performed on some other system, we assume this is being done on a Fedora Core 3 system. You will need to install the following packages:

anaconda-10.1.0.2-1
anaconda-help-10.1.0-1
anaconda-runtime-10.1.0.2-1
busybox-anaconda-1.00.rc1-5

Next you need to build the installation tree. All of the following needs to be performed as "root". Assuming that the distributes ISO images are located in another partition, the partition needs to have at least 10 GB of available space (or 15 GB if the new ISO images are to be pleaced there also). In a subdirectory on that partition, execute the following:

export PYTHONPATH=/usr/lib/anaconda
export PATH="$PATH:/usr/lib/anaconda-runtime"
export FCBASE=`pwd`
mkdir -p $FCBASE/fc3/i386

This sets things up. Now do the following:

mount -o ro,loop FC3-i386-disc1.iso /mnt
cp -a /mnt/* $FCBASE/fc3/i386/
umount /mnt/

Then repeat the above for each of the other three ISO binary (i386) images and the four SRPMS ISO images.

Note: If you have the DVD ISO image then you can use it in place of the four binary ISO images. However, you will still need to copy the contents of the four CD SRPMS ISO images.

Note: If you already have an expanded tree which is being used for NFS, etc. installs, then simply copy it.

You have now created the installation tree.
Step 2: Updating

In general, updating a distribution consists of replacing the RPMs and src RPMs with updated versions. You need to make sure you delete the older (replaced) versions. Since the file names will differ between to old and the updated versions of the packages, this can be a lengthy manual process. I am sure that someone has created a script which will remove the older packages and only leave the updated versions.

Caution: A few packages have multiple architectures and you need to be careful not to delete the extra architectures. Specifically on the i386 distribution:

   1.

      The glibc, nptl, and openssl packages have both i386 and i686 versions of packages.
   2.

      The kernel and kernel-smp packages have i586 and i686 versions of packages (but no i386).

The x86_64 distribution of Fedora Core 3 contains many packages which have both x86_64 and i386 (or i686 in some case) versions of packages so that both 32-bit and 64-bit applications can be supported.

If you need a special kernel to support what you are doing, you can use the src RPM to rebuild a custom kernel package and then use these rebuilt packages in the updated distribution. How you do this kernel package rebuilding is beyond the scope of this document.

You can also add packages to the distribution by copying them to the $FCBASE/fc3/i386/Fedora/RPMS directory and the $FCBASE/fc3/i386/SRPMS directory (for src.rpm).

To edit the comps file, please see Editing the Comps File.
Step 3: Cleanup

The original build which created the ISO images leaves some extra files which can be removed with the following command:

find $FCBASE/fc3 -name TRANS.TBL -exec rm -f {} \;
find $FCBASE/fc3 -name boot.cat -exec rm -f {} \;

Step 4: Build

OK, you now have an updated installation tree and you need to execute the following commands:

   1.

      Update the hdlist file with the following command:

genhdlist --productpath=Fedora $FCBASE/fc3/i386

   2.

      Next, create the package order file:

pkgorder $FCBASE/fc3/i386 i386 Fedora | tee \
$FCBASE/fc3/pkgfile

   3.

      Next, update the installation files:

buildinstall --pkgorder $FCBASE/fc3/pkgfile \
--version 3 --product "Fedora Core" \
--release "Fedora Core 3" \
--prodpath Fedora \
$FCBASE/fc3/i386

Step 5: Splitting the installation tree

To create CD ISO images, you will need to split the binary and SRPMS into eight CD trees:

rm -fr $FCBASE/fc3/i386-disc[1-9]

splittree.py --arch=i386 \
--total-discs=8 --bin-discs=4 --src-discs=4 \
--release-string="Fedora Core 3" \
--pkgorderfile=$FCBASE/fc3/pkgfile \
--distdir=$FCBASE/fc3/i386 \
--srcdir=$FCBASE/fc3/i386/SRPMS \
--productpath=Fedora

rm -f $FCBASE/fc3/i386-disc1/Fedora/base/hdlist

genhdlist --productpath=Fedora --withnumbers \
--fileorder $FCBASE/fc3/pkgfile \
$FCBASE/fc3/i386-disc[1234]

The split trees are created in $FCBASE/fc3 and are named i386-disc[1-8].

NOTE: The "--distdir=$FCBASE/fc3/i386" parameter DOES NOT end with a "/" intentionally. If it does end with "/", then the split trees will be named -disc[12345678] and be sub-directories of $FCBASE/fc3/i386/ instead of being i386-disc[1-8] under subdirectory $FCBASE/fc3.

The splittree.py program does not currently support splitting the installation tree into DVD size trees. However, this can be performed manually. The options are to modify the installation tree which you just created or to create two new DVD-sized trees. For purposes of this HOWTO, two new direcoty trees will be created:

mkdir -p $FCBASE/fc3/i386-dvd1
mkdir -p $FCBASE/fc3/i386-dvd2
cp -a $FCBASE/fc3/i386/* $FCBASE/fc3/i386-dvd1/
cp -p $FCBASE/fc3/i386/.discinfo $FCBASE/fc3/i386-dvd1/
cp -p $FCBASE/fc3/i386/* $FCBASE/fc3/i386-dvd2/
mv $FCBASE/i386-dvd1/SRPMS $FCBASE/fc3/i386-dvd2/


Another approach (thanks to Andrew Mann) for creating DVD images was simply described in anaconda-devel-list message. This describes the changes needed to splittree.py to handle DVD images:

cp /usr/lib/anaconda-runtime/splittree.py \
./splittree-dvd.py

then around line 79, change

self.target_size = 640.0 * 1024.0 * 1024

to be

self.target_size = 4.4 * 1024.0 * 1024.0 * 1024

You can also change all of the "-disc" to "-dvd" so
that both CD and DVD split trees can coexist.

rm -fr $FCBASE/fc3/i386-dvd[1-9]

./splittree.py --arch=i386 \
--total-dvds=2 --bin-dvds=1 --src-dvds=1 \
--release-string="Fedora Core 3" \
--pkgorderfile=$FCBASE/fc3/pkgfile \
--distdir=$FCBASE/fc3/i386 \
--srcdir=$FCBASE/fc3/i386/SRPMS \
--productpath=Fedora

Now go to step 6 but only create the first (bootable) image and the single SRPMS image.
Step 6: Creating the CD or DVD ISO Images

   1.

      The first binary or installation image differs from the other images because it is bootable. The following command will create this ISO image:

cd $FCBASE/fc3

mkisofs -R -J -T -v \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-V "Fedora Core 3 (update or whatever)" \
-b isolinux/isolinux.bin -c isolinux/boot.cat \
-x "lost+found" \
-o FC3-i386-disc1.iso\
i386-disc1

      or, if you are creating a DVD image, then use:

mkisofs -R -J -T -v \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-V "Fedora Core 3 (updated or whatever)" \
-b isolinux/isolinux.bin -c isolinux/boot.cat \
-x "lost+found" \
-o FC3-i386-dvd1.iso \
i386-dvd1

   2.

      Continue to create the other CD binary discs ISO images with (skip if doing DVD images):

mkisofs -R -J -T -v \
-V "Fedora Core 3 (updated or whatever)" \
-x "lost+found" \
-o FC3-i386-disc2.iso \
i386-disc2

      which is repeated for disc3 and disc4.
   3.

      Then do the SRPMS which is similar to that done for disc[2-4]:

mkisofs        -R -J -R -v \
-V "Fedora Core 3 (updated or whatever)" \
-x "lost+found" \
-o FC3-i386-SRPMS-disc1.iso \
i386-disc5

      which is repeated for disc6 -> disc2.iso, disc7 ->disc3.iso, and disc8 -> disc4.iso.

      If you are creating a DVD SRPMS image, then do:

mkisofs -R -J -R -v \
-V "Fedora Core 3 (updated or whatever)" \
-x "lost+found" \
-o FC3-i386-SRPMS-dvd1.iso \
i386-dvd2

cd $FCBASE

      All done!
      Updating and creating the RescueCD

      The following process assumes that you have the trees, etc. described above.
      Step 1: The RescueCD Tree

      Run the commands:

rm -fr $FCBASE/fc3/i386-rescueimage
mk-rescuecd.i386 $FCBASE/fc3/i386 \
$FCBASE/fc3 \
"FC 3" \
Fedora

      If you only want a RescueCD with software from the updated packages (such as an updated kernel), then skip to step 4.
      Step 2: Increasing RAMDISK Size

      If you would like to increase the size of the ramdisk you boot into, then do the following:
         1.

            Edit $FCBASE/rescue/i386-rescue/isolinux/isolinux.cfg and change the ramdisk_size values from their standard setting of 8192 to something larger such as 16384.
         2.

            Do:

gunzip < $FCBASE/fc3/i386-rescueimage/isolinux/initrd.img \
> /tmp/initrd.old
mount -o ro,loop /tmp/initrd.old /mnt/xx

         3.

            Then create the updated image:

dd  if=/dev/zero of=/tmp/initrd.new bs=1k count=12288
mke2fs -F -i 4086 /tmp/initrd.new
mount -o loop /tmp/initrd.new /mnt/zz
cp -va /mnt/xx/* /mnt/zz
cp -vp /mnt/xx/.buildstamp /mnt/zz
umount /mnt/xx
umount /mnt/zz

         4.

            Now gzip and replace the original initrd.img:

gzip -9 </tmp/initrd.new \
> $FCBASE/fc3/i386-rescueimage/isolinux/initrd.img

      Step 3: Adding software

      Do the following:

mount -o ro,loop \
$FCBASE/fc3/i386-rescueimage/Fedora/base/stage2.img \
/mnt/xx
mkdir $FCBASE/stage2
cp -va /mnt/xx/* $FCBASE/stage2
cp -vp /mnt/xx/.buildstamp $FCBASE/stage2

      Now update the stage2 directory with your stuff such as programs into $FCBASE/stage2/usr/bin. Be careful that your software does not need additional libraries, etc. [statically linked programs are the way to go]. Once you have everything updated, then do:

mkcramfs $FCBASE/stage2/ /tmp/stage2.new
cp -vp /tmp/stage2.new \
$FCBASE/fc3/i386-rescueimage/Fedora/base/stage2

      Step 4: CD creation

      Similar to the bootable installation CD, do the following:

cd $FCBASE/fc3
mkisofs -R -J -T -v \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-V "Fedora Core 3 Rescue CD (or whatever)" \
-b isolinux/isolinux.bin -c isolinux/boot.cat \
-x "lost+found" \
-o FC3-i386-rescuecd.iso \
i386-rescue
cd $FCBASE
回复 支持 反对

使用道具 举报

发表于 2005-9-8 21:33:13 | 显示全部楼层
无聊译一下上文,方便别人方便自己
回复 支持 反对

使用道具 举报

发表于 2005-9-8 21:33:58 | 显示全部楼层
如何更新 Fedora Core 3 发行版 CD

作者:Gene Czarcinski 写于 2005 年 2 月 27 日 (更新于 2005-03-11)
翻译:懒猫 / Stephen Wong 译于广州,2005 年 9 月 8 日

声明:本文档的原文著作权属于 Gene Czarcinski,译文的著作权属于 懒猫 / Stephen Wong,译文的出版权、发行权属于原文作者、译文作者和 LinuxSir.org 社区共同所有。本文首先公开发布于 LinuxSir.org 社区,转载和/或修订请保留著作权信息和本声明条款。原文作者、译文作者、历次修订者及 LinuxSir.org 社区保留一切法律权利。

原文 PDF 文档的网址链接:
http://fedoranews.org/contributo ... s-update-distro.pdf
原文 Web 文档的网址链接:
http://fedoranews.org/contributors/gene_czarcinski/update_distro/

本文档有以下三个目的:

1. 说明如何更新 Fedora Core 3 发行版 CD 然后创建更新了的 ISO 镜像。
2. 说明如何创建 DVD 镜像以取代 CD 镜像。
3. 被给予一个更新了的发行版以后,创建一张可选择地添加了更多软件的拯救 CD。

本文档的部分信息基于更新和重建 Fedora Core 2 安装 CD 的信息,也有当前未被维护的 Anaconda 文档计划。

当本文档说明用于 i386 发行版的过程时,其也适用于 Fedora Core 3 的 x86 64位发行版,而且还可以被延长适用到发展趋势的版本。

更新和创建发行版

第一步:筹备

Fedora Core 3 带有用于更新和重建安装 CD 的所有所需的工具。这要求一个充足的磁盘空间 —— 大约 22 GB。Fedora Core 3 发行于总共约有 4.5 GB 的 CD ISO 镜像上。空间要求如下:

1. 用于发行版 ISO 镜像的空间 (4.5 GB)。

2. 用于从 ISO 镜像生成的扩展安装目录树的空间 (4.5 GB)。这棵树将于更新 / 重建过程中被更新。

3. 用于将会按 ISO 镜像容量分割的安装目录树的分支目录树的空间。(4.5 GB)

4. 用于更新了的 ISO 镜像的空间 (4.5 GB)。

5. 在重建过程中额外的工作空间 (1 到 3 GB)。

  整理结果需要约 2 GB 空间。如果你重建可选择的拯救 CD,你将需要额外的 1 到 2 GB 空间。

  虽然更新和重建安装 CD 可以被执行于某些其他的系统,但我们假定这是在一套 Fedora Core 3 系统上进行的。你将需要安装以下软件包:

anaconda-10.1.0.2-1
anaconda-help-10.1.0-1
anaconda-runtime-10.1.0.2-1
busybox-anaconda-1.00.rc1-5

  然后你需要构建安装目录树。以下所有操作需要以“root”身份执行。假定发行版 ISO 镜像放在别的磁盘分区,这个分区需要拥有至少 10 GB 可用的空间(也或者是 15 GB,如果新的 ISO 镜像将放在那里的话)。在那个分区的一个子目录内执行如下操作:

export PYTHONPATH=/usr/lib/anaconda
export PATH="$PATH:/usr/lib/anaconda-runtime"
export FCBASE=`pwd`
mkdir -p $FCBASE/fc3/i386

  这是一些设置。现在执行下面的操作:

mount -o ro,loop FC3-i386-disc1.iso /mnt
cp -a /mnt/* $FCBASE/fc3/i386/
umount /mnt/

  然后对另外三个 ISO i386的二进制镜像及四个 SRPMS ISO 镜像重复如上的操作。

  注意:如果你有 DVD ISO 镜像则你可以使用它来替代那四个二进制的 ISO 镜像。然而,你将仍然需要复制四个 SRPMS ISO 的 CD 镜像中的内容。

  注意:如果你已经有一个正被用于 NFS 等安装的扩展目录树,则只要简单地复制它就行了。

  你现在已经创建了安装目录树。

第二步:更新

  一般地,更新一个发行版在于把 RPM 和 源代码 RPM 替换为更新了的版本。你需要确定你删除了旧的(被替换的)版本。因为旧的和新版本软件包的文件名会有不同,这可能是一个冗长的手工过程。我确信有人已经创建了一个将会除去较旧版本并只留下新版本软件包的脚本。

  警告:少部分的软件包存在多架构版本,你需要小心不要删除了额外的的架构版本。i386 发行版明确如下:

1. glibc,nptl 和 openssl 软件包用 i386 和 i686 版本的软件包。

2. 内核和对称多处理器(smp)内核有 i586 和 i686 版本的软件包(但没有 i386 版本)。

  Fedora Core 3 的 64位 x86 发行版包含很多有 64位 x86 和 i386 (某些或者是 i686)版本的软件包,因此 32位和 64位的软件都可以被支持。

  如果你需要一个特别的内核用于支持你正在进行的工作,你可以使用源代码 RPM 重建一个定制的内核软件包,然后在更新的发行版中使用这些重建的软件包。你如何重建这个内核软件包的方法不在本文档范围之内。

  你也可以通过复制软件包到 $FCBASE/fc3/i386/Fedora/RPMS 目录和 $FCBASE/fc3/i386/SRPMS 目录(用于源代码 RPM)以添加软件包。

  编辑 comps 文件,请参阅《Editing the Comps File》。

第三步:清理

  原始的构建会在创建 ISO 镜像的时候留下一些额外的文件。这些文件可以用下面的命令清除:

find $FCBASE/fc3 -name TRANS.TBL -exec rm -f {} \;
find $FCBASE/fc3 -name boot.cat -exec rm -f {} \;

第四步:构建

  OK,你现在有一个更新版本的安装目录树,你需要执行如下命令:

1. 通过如下命令更新 hdlist 文件:

genhdlist --productpath=Fedora $FCBASE/fc3/i386

2. 接着,创建软件包顺序文件:

pkgorder $FCBASE/fc3/i386 i386 Fedora | tee \
$FCBASE/fc3/pkgfile

3. 然后,更新安装文件:

buildinstall --pkgorder $FCBASE/fc3/pkgfile \
--version 3 --product "Fedora Core" \
--release "Fedora Core 3" \
--prodpath Fedora \
$FCBASE/fc3/i386

第五步:分离安装目录树

  若是创建 CD ISO 镜像,你将需要把二进制 RPM 和源代码 RPM 分离到八张 CD 目录树中:

rm -fr $FCBASE/fc3/i386-disc[1-9]

splittree.py --arch=i386 \
--total-discs=8 --bin-discs=4 --src-discs=4 \
--release-string="Fedora Core 3" \
--pkgorderfile=$FCBASE/fc3/pkgfile \
--distdir=$FCBASE/fc3/i386 \
--srcdir=$FCBASE/fc3/i386/SRPMS \
--productpath=Fedora

rm -f $FCBASE/fc3/i386-disc1/Fedora/base/hdlist

genhdlist --productpath=Fedora --withnumbers \
--fileorder $FCBASE/fc3/pkgfile \
$FCBASE/fc3/i386-disc[1234]

  分支目录树被创建于 $FCBASE/fc3,并被命名为 i386-disc[1-8]。

  注意:参数“--distdir=$FCBASE/fc3/i386”刻意不以“/”结尾。如果它以“/”结尾,则分支目录树将被命名为 -disc[12345678] 并且作为子目录被置于 $FCBASE/fc3/i386/ 中而不是置于 $FCBASE/fc3 子目录中的 i386-disc[1-8]。

  splittree.py 程序当前不支持把安装目录树分离到 DVD 容量的目录树中。然而,这可以被手工完成。这个选择将修改你刚刚创建的或即将创建的两个新的 DVD 容量的目录树。为了打到这个目的,两个目录树将被创建如下:

mkdir -p $FCBASE/fc3/i386-dvd1
mkdir -p $FCBASE/fc3/i386-dvd2
cp -a $FCBASE/fc3/i386/* $FCBASE/fc3/i386-dvd1/
cp -p $FCBASE/fc3/i386/.discinfo $FCBASE/fc3/i386-dvd1/
cp -p $FCBASE/fc3/i386/* $FCBASE/fc3/i386-dvd2/
mv $FCBASE/i386-dvd1/SRPMS $FCBASE/fc3/i386-dvd2/


  创建 DVD 镜像的另一个途径(感谢 Andrew Mann)在 anaconda-devel-list 信息中简单地说明了。这说明改变需要 用 splittree.py 操作 DVD 镜像:

cp /usr/lib/anaconda-runtime/splittree.py \
./splittree-dvd.py

  然后在第 79 行附近,把

self.target_size = 640.0 * 1024.0 * 1024

  修改为

self.target_size = 4.4 * 1024.0 * 1024.0 * 1024

  你也可以把所有“-disc”改为“-dvd”,以至于 CD 和 DVD 分支树都可以共存。

rm -fr $FCBASE/fc3/i386-dvd[1-9]

./splittree.py --arch=i386 \
--total-dvds=2 --bin-dvds=1 --src-dvds=1 \
--release-string="Fedora Core 3" \
--pkgorderfile=$FCBASE/fc3/pkgfile \
--distdir=$FCBASE/fc3/i386 \
--srcdir=$FCBASE/fc3/i386/SRPMS \
--productpath=Fedora

  现在进行第六步,但仅仅创建第一个(可引导的)镜像以及单个的 SRPMS 镜像。

第六步:创建 CD 或 DVD ISO 镜像

1. 第一个安装镜像不同于其他的镜像,因为它是可引导的。以下命令将创建这个 ISO 镜像。

cd $FCBASE/fc3

mkisofs -R -J -T -v \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-V "Fedora Core 3 (update or whatever)" \
-b isolinux/isolinux.bin -c isolinux/boot.cat \
-x "lost+found" \
-o FC3-i386-disc1.iso\
i386-disc1

  或者,如果你创建一个 DVD 镜像,则使用如下命令:

mkisofs -R -J -T -v \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-V "Fedora Core 3 (updated or whatever)" \
-b isolinux/isolinux.bin -c isolinux/boot.cat \
-x "lost+found" \
-o FC3-i386-dvd1.iso \
i386-dvd1

2. 继续创建其他二进制 CD 的 ISO 镜像(如果正在制作 DVD 镜像则跳过):

mkisofs -R -J -T -v \
-V "Fedora Core 3 (updated or whatever)" \
-x "lost+found" \
-o FC3-i386-disc2.iso \
i386-disc2

  重复用于三号和四号光盘。

3. 然后如 disc[2-4] 般制作 SRPMS 光盘镜像:

mkisofs -R -J -R -v \
-V "Fedora Core 3 (updated or whatever)" \
-x "lost+found" \
-o FC3-i386-SRPMS-disc1.iso \
i386-disc5

  重复制作 disc2.iso 的步骤用于 disc6,重复制作 disc3.iso 的步骤用于 disc7,重复制作 disc4.iso 的步骤用于 disc8。

  如果你正在创建一个 DVD SRPMS 镜像,则操作如下:

mkisofs -R -J -R -v \
-V "Fedora Core 3 (updated or whatever)" \
-x "lost+found" \
-o FC3-i386-SRPMS-dvd1.iso \
i386-dvd2

cd $FCBASE

  如此便完成了 ISO 镜像的制作。

更新和创建拯救 CD

  以下过程假定你已经拥有目录树等条件,如上文所述。

第一步:拯救 CD 的目录树

  运行命令:

rm -fr $FCBASE/fc3/i386-rescueimage
mk-rescuecd.i386 $FCBASE/fc3/i386 \
$FCBASE/fc3 \
"FC 3" \
Fedora

  如果你只是想要一个带有更新了的软件包(例如一个更新了的内核)的拯救 CD,则跳过第四步。

第二步:增加 RAMDISK 的容量

  如果你意欲增加引导时内存虚拟磁盘(RAMDISK)的容量,则执行如下操作:

1. 编辑 $FCBASE/rescue/i386-rescue/isolinux/isolinux.cfg 文件,把 ramdisk_size 的值从标准设置的 8192 改为某个更大的值,例如 16386。

2. 执行:

gunzip < $FCBASE/fc3/i386-rescueimage/isolinux/initrd.img \
> /tmp/initrd.old
mount -o ro,loop /tmp/initrd.old /mnt/xx

3. 然后创建更新了的镜像:

dd if=/dev/zero of=/tmp/initrd.new bs=1k count=12288
mke2fs -F -i 4086 /tmp/initrd.new
mount -o loop /tmp/initrd.new /mnt/zz
cp -va /mnt/xx/* /mnt/zz
cp -vp /mnt/xx/.buildstamp /mnt/zz
umount /mnt/xx
umount /mnt/zz

4. 现在压缩打包并替换原始的 initrd.img:

gzip -9 </tmp/initrd.new \
> $FCBASE/fc3/i386-rescueimage/isolinux/initrd.img

第三步:添加软件

  执行如下操作:

mount -o ro,loop \
$FCBASE/fc3/i386-rescueimage/Fedora/base/stage2.img \
/mnt/xx
mkdir $FCBASE/stage2
cp -va /mnt/xx/* $FCBASE/stage2
cp -vp /mnt/xx/.buildstamp $FCBASE/stage2

  现在用你的素材更新 stage2 目录,例如把程序放进 $FCBASE/stage2/usr/bin 。这里要小心,你的软件并不需要附加的库(静态链接程序使用这个方法)。一旦你把所有东西更新好了,则执行:

mkcramfs $FCBASE/stage2/ /tmp/stage2.new
cp -vp /tmp/stage2.new \
$FCBASE/fc3/i386-rescueimage/Fedora/base/stage2

第四步:创建 CD

  和可引导的安装 CD 相似,执行如下操作:

cd $FCBASE/fc3
mkisofs -R -J -T -v \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-V "Fedora Core 3 Rescue CD (or whatever)" \
-b isolinux/isolinux.bin -c isolinux/boot.cat \
-x "lost+found" \
-o FC3-i386-rescuecd.iso \
i386-rescue
cd $FCBASE

  全文完。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表