+ -
当前位置:首页 → 问答吧 → 请问该如何把我制作好的LFS系统做成iso?

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

时间:2007-09-01

来源:互联网

请问该如何把我制作好的LFS系统做成iso?方便下次直接安装时,就像安装一个发行版一样。也可以与朋友们分享一下我的劳动成果啊。

作者: kk526   发布时间: 2007-09-01

好像有点麻烦的,查查livecd的做法,曾经看到过比较详细的文档

作者: harmony.relax   发布时间: 2007-09-01

如果只是自己用的话,最简单的就是直接打包后刻盘备份,以后可以借助任意发行版的 LiveCD 重新安装

作者: brhyh   发布时间: 2007-09-01

刚才查看了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/liv...ages/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的镜像包,应该怎么生成呢?是否有工具?

作者: kk526   发布时间: 2007-09-01

到精华区看看兄弟们的心血结晶吧!

作者: d00m3d   发布时间: 2007-09-01

对不起版主,麻烦给个地址,我怎么找不到。现在我也安装完成lfs,也想实现该功能。
将通过lfs制作的操作系统,作也安装盘,可方便的安装其它机子上使用。

作者: life_31   发布时间: 2008-12-25

http://imghch.com/doc/bk02.html

作者: ServerOnly   发布时间: 2008-12-28

您很懒的话,可以考虑一下
http://packages.debian.org/sid/bootcd

作者: 聚焦深空   发布时间: 2008-12-29

谢谢两位。谢谢。

作者: life_31   发布时间: 2008-12-29

http://blog.chinaunix.net/u/13265/showart.php?id=477664
http://blog.chinaunix.net/u2/81513/showart_1308328.html

作者: figured69   发布时间: 2008-12-31

回复四楼的问题:root.ext2的镜像文件,应该怎样生成?使用什么工具?

下载软件并安装zisofs-tools:
代码:
cd /usr/local/src
wget http://www.kernel.org/pub/linux/util...s-1.0.8.tar.gz
tar xvf zisofs-tools-1.0.8.tar.gz
cd zisofs-tools-1.0.8
./configure && make && make install
制作root.ext2:
代码:
cd /mnt
dd if=/dev/zero of=root.ext2 bs=1M count=100
mkfs.ext2 root.ext2

ls -lh
mkdir -pv /mnt/iso
mount -o loop -t ext2 root.ext2 /mnt/iso
cd /mnt/iso
dd if=/dev/zero of=bigfile bs=1M count=50
ls -h bigfile
cd ..
umount /mnt/iso

mkzftree -F root.ext2 /tmp/root.ext2
ls -lh /tmp/root.ext2
rm -rvf root.ext2

mkzftree -F -u /tmp/root.ext2 root.ext2
ls -lh

注:
1、内核要支持透明压缩文件;
2、内核要支持loop设备;
3、不压缩的root.ext2类似与ISO文件,只是文件系统类型为ext2。

作者: lonelycloud   发布时间: 2009-01-05

热门下载

更多