(11 intermediate revisions by the same user not shown) | |||
Line 62: | Line 62: | ||
setenforce 0 | setenforce 0 | ||
=== | === 在 64-bit 机器上制作 32-bit 定制 ISO === | ||
如果您用的是 x86_64 的机器,但是想做一个 32-bit ISO镜像, 请在 livecd-creator 命令之前添加: | |||
setarch i686 livecd-creator [...] | setarch i686 livecd-creator [...] | ||
=== | === 例: 定制 Fedora 桌面版 Live CD === | ||
注意,由于 lived-creator 的工作方式,无法在安装过程中选择一套不同的包或不同的文件系统. 假设您用的是 '''fedora-live-desktop.ks''' 配置文件, 然后运行下列命令: | |||
<pre>livecd-creator \ | <pre>livecd-creator \ | ||
Line 76: | Line 76: | ||
--fslabel=Fedora-LiveCD --cache=/var/cache/live | --fslabel=Fedora-LiveCD --cache=/var/cache/live | ||
</pre> | </pre> | ||
或 | |||
<pre> | <pre> | ||
livecd-creator \ | livecd-creator \ | ||
Line 83: | Line 83: | ||
</pre> | </pre> | ||
这样就会创建一个名叫 "Fedora-LiveCD" 的 Live CD. | |||
名字是用 ''--fs-label'' 指定的,用于: | |||
* | * 在ext3 和 iso9660 文件系统中做为文件系统标签 (因此, 它作为 CD 的名字在桌面上可见) | ||
* | * 在 ''isolinux'' bootloader 中. | ||
如果您有可用的本地库,并且不想等待下载包, 只需要修改配置文件中列出的 URL,让其指向您的本地库. | |||
{{Admon/tip | | {{Admon/tip | 您可用在 x86_64 系统中用 setarch 命令创建一个 x86 live cd/dvd . 例如: setarch i386 livecd-creator <..> .}} | ||
=== | === 例: 一个准系统 Live CD === | ||
命令 | |||
<pre>livecd-creator \ | <pre>livecd-creator \ | ||
--config=/usr/share/doc/livecd-tools-<version>/livecd-fedora-minimal.ks --cache=/var/cache/live </pre> | --config=/usr/share/doc/livecd-tools-<version>/livecd-fedora-minimal.ks --cache=/var/cache/live </pre> | ||
将创建一个可以引导至登录提示符的 live CD . | |||
{{Admon/tip | | {{Admon/tip | 准系统 Live CD 不支持登录功能. | 因为没有做配置的话, 如果 root 密码没有设置或清除,用户不被允许登录系统.}} | ||
=== 用 KVM 或 qemu 测试您的 Live CD === | |||
在 root 下运行: | |||
qemu-kvm -m 512 -cdrom filename.iso | qemu-kvm -m 512 -cdrom filename.iso | ||
如果您没有 KVM , 可以用 qemu 代替 | |||
qemu -m 512 --cdrom filename.iso | qemu -m 512 --cdrom filename.iso | ||
用您的 Live CD 镜像的名字替换 '''filename.iso''' . | |||
{{Admon/tip || | {{Admon/tip || 对于 Fedora 11 之前的发行版,要确保用 root 运行 '''"yum install kvm qemu"''' . Fedora 11 已经将 kvm 和 qemu 合并到一个单独的包. 只安装 qemu 包就够了 .}} | ||
== Live | == Live 镜像安装 == | ||
对于 Fedora 7, 它已经支持从一个 live 镜像进行安装. 要使用这个功能, 请点击桌面上的 ''Install to Hard Drive'' 条目,或者运行 | |||
<pre> | <pre> | ||
Line 128: | Line 127: | ||
</pre> | </pre> | ||
如果你没有这个图标的话. | |||
== Live | == Live 镜像媒介的验证 == | ||
live 镜像可以整合验证自己的功能. 要做到这一点, 您需要在创建镜像的系统和镜像上同时安装 '''isomd5sum'''. 这是为了能够使用 '''implantisomd5''' 和 '''checkisomd5''' 工具. 这些工具可以将 md5sum 嵌入 iso9660 镜像的应用空间. 这就可以在挂载真正的根文件系统之前进行验证. | |||
== | == 在 USB 媒介中使用 Live 镜像 == | ||
USB | USB 接口越来越普遍,是一种使用 live 镜像的好方法. 您可以获取一个 live CD or DVD iso 镜像,并将其改造,使其可以用于 USB 接口设备. 为此, 要用 '''[[livecd-iso-to-disk]]''' 脚本: | ||
<pre> | <pre> | ||
Line 142: | Line 141: | ||
</pre> | </pre> | ||
将 /dev/sdb1 替换为您想要挂载 live 镜像的分区. 这不是一个有破坏性的过程; USB 接口设备中的当前数据将被保存. | |||
其他可用的信息请看 [[How to create and use Live USB]]. | |||
== | == 其他资源 == | ||
* | * [[Classroom | Fedora Classroom]] 覆盖了 [[Classroom/Creating_Fedora_Remix | creating Fedora remixes]]. | ||
* | * 如果您正在发布您的定制版,您需要关心 [[JeroenVanMeeuwen/Revisor/FedoraRebrandRemixGuidelines | trademark usage and GPL responsibilities]]. |
Latest revision as of 15:46, 19 June 2012
本页阐述了如何制作一张基于 Fedora 系统(包括派生发行版,例如 RHEL , CentOS )的定制版 Live CD 或 DVD .
如果您只是想把一个预制 ISO 写入光盘, 请查看 http://fedoraproject.org/en/get-fedora 下载一个 LiveCD 或 LiveDVD, 然后在 install guide 或 burning how-to 查看进一步的说明.
在 project wiki 查看更多的详情. 该项目的讨论在 http://admin.fedoraproject.org/mailman/listinfo/livecd.
该项目和它的源文件支持 GPLv2 许可证. 查看该文件的拷贝获取详情.
创建一个 Live 镜像
要创建一个 Live 镜像, 要用到 livecd-creator 工具. 需要超级用户权限. 这个工具多少有点自己的记录, 用 --help 查看它的选项.
livecd-creator 是 livecd-tools
包的一部分. 如果您的系统没有安装, 用下面的命令安装:
su -c 'yum install livecd-tools spin-kickstarts'
如果您对本地化 Live CD 文件感兴趣, 还要安装 l10n-kickstarts.
livecd-creator 是怎样工作的
简而言之, livecd-creator 程序
- 为 ext3 文件系统新建一个文件,文件系统中包含了构成 Live CD 的所有数据
- Loopback 将这个文件挂载到根文件系统
- 将必要的核心文件系统 (/dev, /dev/pts, /proc, /sys, /selinux) 挂载到根目录
- 用一个配置文件定义所需的包和默认的配置选项.文件的格式与用 kickstart 安装系统是所用的一样.
- 用 yum 和 kickstart 文件中给出的库安装所需的包
- 可选的,由 live CD 配置文件指定的运行脚本.
- 重新标识整个根文件系统(为 SELinux)
- 创建一个 live CD 特定的,匹配已安装的内核的 initramfs
- 卸载已经挂载到根目录的核心文件系统
- 卸载根文件系统
- 创建一个只包含 ext3/4 文件(压缩)的 squashfs 文件系统
- 配置 bootloader
- 创建一个 iso9660 可引导 CD/DVD
Live 镜像配置文件
Live 镜像的配置是在一个文件中定义的,文件的格式与用 kickstart 安装系统是的一样. 它们包含了一些基本的系统配置条目, 包清单和一个在构建过程的最后阶段运行的脚本.
对于 Fedora 项目, 两个最重要的 live 镜像配置文件是
- fedora-live-minimization.ks : 基本 live 镜像系统 (包含在 'livecd-tools' 包)
- fedora-live-desktop.ks : 完整的桌面,带有应用程序和对于 Fedora 所支持所有语言环境的输出输出支持 (这是 'spin-kickstarts' 包的一部分)
其他定制版的 kickstart 文件(例如 Fedora Electronics Lab) 可以在安装 'spin-kickstarts'包后在 /usr/share/spin-kickstarts/ 中找到。
设置 SELinux 为 permissive 模式
为了 livecd-creator , SELinux 应该在 permissive 模式下工作. 创建 live cd 或 dvd 之前,先在 root 用户下运行下面命令.
setenforce 0
在 64-bit 机器上制作 32-bit 定制 ISO
如果您用的是 x86_64 的机器,但是想做一个 32-bit ISO镜像, 请在 livecd-creator 命令之前添加:
setarch i686 livecd-creator [...]
例: 定制 Fedora 桌面版 Live CD
注意,由于 lived-creator 的工作方式,无法在安装过程中选择一套不同的包或不同的文件系统. 假设您用的是 fedora-live-desktop.ks 配置文件, 然后运行下列命令:
livecd-creator \ --config=/usr/share/doc/livecd-tools-<version>/livecd-fedora-desktop.ks \ --fslabel=Fedora-LiveCD --cache=/var/cache/live
或
livecd-creator \ --config=/usr/share/spin-kickstarts/fedora-livecd-desktop.ks \ --fslabel=Fedora-LiveCD --cache=/var/cache/live
这样就会创建一个名叫 "Fedora-LiveCD" 的 Live CD.
名字是用 --fs-label 指定的,用于:
- 在ext3 和 iso9660 文件系统中做为文件系统标签 (因此, 它作为 CD 的名字在桌面上可见)
- 在 isolinux bootloader 中.
如果您有可用的本地库,并且不想等待下载包, 只需要修改配置文件中列出的 URL,让其指向您的本地库.
例: 一个准系统 Live CD
命令
livecd-creator \ --config=/usr/share/doc/livecd-tools-<version>/livecd-fedora-minimal.ks --cache=/var/cache/live
将创建一个可以引导至登录提示符的 live CD .
用 KVM 或 qemu 测试您的 Live CD
在 root 下运行:
qemu-kvm -m 512 -cdrom filename.iso
如果您没有 KVM , 可以用 qemu 代替
qemu -m 512 --cdrom filename.iso
用您的 Live CD 镜像的名字替换 filename.iso .
Live 镜像安装
对于 Fedora 7, 它已经支持从一个 live 镜像进行安装. 要使用这个功能, 请点击桌面上的 Install to Hard Drive 条目,或者运行
/usr/bin/liveinst
如果你没有这个图标的话.
Live 镜像媒介的验证
live 镜像可以整合验证自己的功能. 要做到这一点, 您需要在创建镜像的系统和镜像上同时安装 isomd5sum. 这是为了能够使用 implantisomd5 和 checkisomd5 工具. 这些工具可以将 md5sum 嵌入 iso9660 镜像的应用空间. 这就可以在挂载真正的根文件系统之前进行验证.
在 USB 媒介中使用 Live 镜像
USB 接口越来越普遍,是一种使用 live 镜像的好方法. 您可以获取一个 live CD or DVD iso 镜像,并将其改造,使其可以用于 USB 接口设备. 为此, 要用 livecd-iso-to-disk 脚本:
/usr/bin/livecd-iso-to-disk /path/to/live.iso /dev/sdb1
将 /dev/sdb1 替换为您想要挂载 live 镜像的分区. 这不是一个有破坏性的过程; USB 接口设备中的当前数据将被保存.
其他可用的信息请看 How to create and use Live USB.
其他资源
- Fedora Classroom 覆盖了 creating Fedora remixes.
- 如果您正在发布您的定制版,您需要关心 trademark usage and GPL responsibilities.