这篇东东是小强让我看的,得益匪浅呀。
原文出处:http://forums.fedoraforum.org/showthread.php?t=174916
- # I copy these files to /home and make adjustments there so the originals don't get hosed.
- livecd-fedora-8-base-desktop.ks
- livecd-fedora-8-kde.ks
- livecd-creator /
- --config=/home/livecd-fedora-8-kde.ks /
- --fslabel=Fedora-8-LiveCD-KDE
- # Mount the livecd iso so we can make some changes
- mkdir /home/iso
- mount -t iso9660 -o loop /home/Fedora-8-LiveCD-KDE.iso /home/iso
- # Check /home/iso for these files and folders
- GPL
- isolinux
- LiveOS
- README
- # You need to load the squashfs module
- (echo '#!/bin/sh'; echo 'modprobe squashfs') /
- > /etc/sysconfig/modules/squashfs.modules
- chmod +x /etc/sysconfig/modules/squashfs.modules
- # You can enable the squashfs module without rebooting with this command:
- modprobe squashfs
- # Install squashfs-tools
- yum install squashfs-tools
- # The contents of the iso root filesystem is located in the file squashfs.img
- # Unpack squashfs.img to a folder called squashfs-root
- unsquashfs /home/iso/LiveOS/squashfs.img
- # Mount the /home/squashfs-root/LiveOS/ext3fs.img to a folder with the command:
- mkdir /home/livecd-root
- mount -o loop,rw /home/squashfs-root/LiveOS/ext3fs.img /home/livecd-root
- # Make some changes, For example:
- # Adding yum repos to the livecd environment
- rpm -ihv http:
- fedora/8/i386/livna-release-8-1.noarch.rpm --root /home/livecd-root/
- rpm -ihv http:
- RPMS.freshrpms/freshrpms-release-1.1-1.fc.noarch.rpm --root /home/livecd-root/
- # Make a list of installed packages so you have a better idea
- # of what needs to be installed or removed
- rpm -qa --root /home/livecd-root/ | sort >list.txt
- # Add or remove packages with the yum package manager
- yum install gimp --installroot=/home/livecd-root
- yum remove ktorrent --installroot=/home/livecd-root
- yum clean all --installroot=/home/livecd-root
- updatedb -U /home/livecd-root
- # Copy your desktop settings to the livecd environment
- rm -rf /home/livecd-root/etc/skel
- mkdir /home/livecd-root/etc/skel
- rsync -av --exclude='.thunderbird' /home/fred/ /home/livecd-root/etc/skel
- chown -R root:root /home/livecd-root/etc/skel//.
- # Unmount the ext3fs.img and make a new squashfs.img
- umount /home/livecd-root
- mksquashfs squashfs-root squashfs.img
- # Create a folder called build for making the new iso image
- mkdir /home/build
- rsync -av --exclude='squashfs.img' /home/iso/ /home/build
- mv /home/squashfs.img /home/build/LiveOS
- umount /home/iso
- # When making a new iso image the cd volume label
- # needs to match the isolinux.cfg entry
- # ( root=CDLABEL=Fedora-8-LiveCD-KDE )
- cd /home/build
- mkisofs -R -l -L -D -b isolinux/isolinux.bin -c isolinux/boot.catalog -o /home/Modified-Fedora-8-LiveCD-KDE.iso -no-emul-boot -boot-load-size 4 -boot-info-table -V "Fedora-8-LiveCD-KDE" .