LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 6634|回复: 10

请问该如何把我制作好的LFS系统做成iso?

[复制链接]
发表于 2007-9-1 00:01:36 | 显示全部楼层 |阅读模式
请问该如何把我制作好的LFS系统做成iso?方便下次直接安装时,就像安装一个发行版一样。也可以与朋友们分享一下我的劳动成果啊。
发表于 2007-9-1 00:14:46 | 显示全部楼层
好像有点麻烦的,查查livecd的做法,曾经看到过比较详细的文档
回复 支持 反对

使用道具 举报

发表于 2007-9-1 00:58:04 | 显示全部楼层
如果只是自己用的话,最简单的就是直接打包后刻盘备份,以后可以借助任意发行版的 LiveCD 重新安装
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-9-1 01:50:43 | 显示全部楼层
刚才查看了lfscd-remastering-howto.txt,得到了一些启发。
从上面知道了在一个root.ext2基础上,修改并重新生成iso的过程。

Chroot to the filesystem:
        chroot $WORK/root

In the chroot, change the current directory to /build, and install any
additional packages you want. Modify other files as necessary.

Get the initramfs files as a zip archive from
        http://wiki.linuxfromscratch.org ... /packages/initramfs

Unzip the archive. Remove the "include $(ROOT)/scripts/functions" line from the
Makefile. Generate the initramfs image for your CD:
        make compile-stage2 VERSION="x86-6.3-custom"

(you can replace the "x86-6.3-custom" with your own string). This produces the
initramfs_data.cpio.gz file in the current directory. If this directory is not
"/build", copy it to /build:
        cp initramfs_data.cpio.gz /build

Exit from the chroot and clean up the mounts:
        exit
        umount $WORK/root/dev/shm
        umount $WORK/root/dev/pts
        umount $WORK/root/sys
        umount $WORK/root/proc
        umount $WORK/root/build
        rmdir $WORK/root/build

Clean up bash history:
        rm $WORK/root/root/.bash_history

You may also want to remove other history files.

If you, by mistake, created and removed some files, the sectors previously
occupied by those files begin to contain non-zero data. Such sectors are
useless, but they don't compress well. Zero them out:
        dd if=/dev/zero of=$WORK/root/zeroes

This command will print a message that the disk is full. This is not an error.
Then, remove the file that fills the filesystem:
        rm $WORK/root/zeroes

Now you can unmount the root.ext2 file:
        umount $WORK/root
        sync

The "sync" command is needed due to a bug in the loop driver in some kernels
that leads to a filesystem with errors otherwise.

Now make the directory structure for your LiveCD:
        mkdir $WORK/iso

Copy the directory structure from the original LiveCD:
        cp -r /media/cdrom/*/ $WORK/iso

Replace the stock initramfs image with your own:
        cp $WORK/build/initramfs_data.cpio.gz \
            $WORK/iso/boot/isolinux/iniramfs_data.cpio.gz

Recompress the root.ext2 file:
        mkzftree -F $WORK/root.ext2 $WORK/iso/root.ext2

Recreate the CD image:
        cd $WORK/iso ; mkisofs -z -R -l --allow-leading-dots -D -o \
        ../lfslivecd-x86-6.3-custom.iso -b boot/isolinux/isolinux.bin \
        -c boot/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table \
        -V "lfslivecd-x86-6.3-custom" ./

Burn and test. Have a fun.

有了一个大比较模糊的思路:
1. 把当前整个系统做成一个类似于root.ext2的包
2. 制作自己的initramfs image
3. 制作iso镜像

现在我的问题是,这个root.ext2的镜像包,应该怎么生成呢?是否有工具?
回复 支持 反对

使用道具 举报

发表于 2007-9-1 08:17:44 | 显示全部楼层
到精华区看看兄弟们的心血结晶吧!
回复 支持 反对

使用道具 举报

发表于 2008-12-25 11:18:19 | 显示全部楼层
对不起版主,麻烦给个地址,我怎么找不到。现在我也安装完成lfs,也想实现该功能。
将通过lfs制作的操作系统,作也安装盘,可方便的安装其它机子上使用。
回复 支持 反对

使用道具 举报

发表于 2008-12-27 20:24:44 | 显示全部楼层
回复 支持 反对

使用道具 举报

发表于 2008-12-28 19:37:15 | 显示全部楼层
您很懒的话,可以考虑一下
http://packages.debian.org/sid/bootcd
回复 支持 反对

使用道具 举报

发表于 2008-12-29 10:31:58 | 显示全部楼层
谢谢两位。谢谢。
回复 支持 反对

使用道具 举报

发表于 2008-12-31 10:28:17 | 显示全部楼层
回复 支持 反对

使用道具 举报

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

本版积分规则

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