|
楼主 |
发表于 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的镜像包,应该怎么生成呢?是否有工具? |
|