分类: LINUX
2012-12-04 16:52:06
要使用livecd-creator制作iso,首先先安装工具:
1. yum install livecd-tools
2. yum install spin-kickstarts
3. 详细见官方网站:
4. Kickstarts配置详细见:http://blog.csdn.net/kakane/article/details/7715800
配置文件修改安装完成后,在/usr/share/doc/live-tools-x-x/有一个ks文件livecd-fedora-min-
imal.ks,根据livecd-fedora-minimal.ks的配置文件进行修改,增加了root密码,和liveuser密码(密码都为:bupt123),添加自己一个hello world小程序。在liveuser下面(具体ks文件)。
echo '#include
int main(){
printf("hello world\n");
return 0;
}' >> /home/liveuser/hello.c
gcc -o /home/liveuser/hello /home/liveuser/hello.c
我们iso的定制,是制作最小的,无界面的fedora17,只有210MB(可能还有再减小的余地)。因为它主要取决ks文件的配置。如果你懂ks文件的配置,那么你至少已经省去一半的麻烦,主要是学习kickstart的配置文件,进行更改,和源的配置,后面将详细讲解ks文件的有关配置。本文是在livecd-fedora-minimal.ks基础上进行更改的,详细内容(Ks文件见附件)
开始执行6. 稍等片刻,就可以看见当前目录生成了:fedora-mini.iso文件,这就是我们制作成功的livecd。
7. U盘分区,使用Uhelper进行分区。(软件见附件)
8. 我使用windows下的工具用生成的iso制作u启动系统(工具LinuxLive USB Creator 2.8.13见附件)
9. 打开u盘,更改syslinux下的syslinux.conf文件。如下:
timeout 1
label live
menu label Staring Operating System
kernel vmlinuz0
append initrd=initrd0.img root=UUID=587C-4D09 rootfstype=vfat ro liveimg quiet rhgb rd.luks=0 rd.md=0 rd.dm=0
menu default
menu end
以上步骤,如果正确无误就完成了定制化最小iso的制作。
如果想存放自己的文件,可以再ks文件配置项中这样写
%post--nochroot
cp /path/yourfile $INSTALL_ROOT/home/youruser/
%end
遇到的问题:
常见的错误:
错误一:
installing package rdate-1.4-19.fc17.i686 needs 961MB on the / filesystem
installing package vconfig-1.9-10.fc17.i686 needs 961MB on the / filesystem
installing package rsh-0.17-68.fc17.i686 needs 961MB on the / filesystem
installing package ethtool-2:3.2-2.fc17.i686 needs 962MB on the / filesystem
installing package b43-fwcutter-015-2.fc17.i686 needs 962MB on the / filesystem
installing package setserial-2.17-28.fc17.i686 needs 962MB on the / filesystem
installing package dosfstools-3.0.12-2.fc17.i686 needs 962MB on the / filesystem
installing package dos2unix-5.3.3-1.fc17.i686 needs 962MB on the / filesystem
installing package rdist-1:6.1.5-53.fc17.i686 needs 963MB on the / filesystem
installing package bridge-utils-1.5-3.fc17.i686 needs 963MB on the / filesystem
installing package zip-3.0-4.fc17.i686 needs 964MB on the / filesystem
installing package eject-2.1.5-22.fc17.i686 needs 964MB on the / filesystem
installing package symlinks-1.4-5.fc17.i686 needs 964MB on the / filesystem
installing package finger-0.17-44.fc17.i686 needs 964MB on the / filesystem
installing package tree-1.6.0-4.fc17.i686 needs 964MB on the / filesystem
Error creating Live CD : Unable to install: Could not run transaction.
Unmounting directory /var/tmp/imgcreate-QqHeN3/install_root
Losetup remove /dev/loop0
解决办法:
在所配置的ks文件中,错误原因是part / --size 1000 所给的值太小,改大一些就可以解决。如下修改下面:
lang en_US.UTF-8
keyboard us
timezone US/Eastern
auth --useshadow --enablemd5
selinux --enforcing
#firewall --disabled
part / --size 4024
错误二:
Removing password for user root.
passwd: Success
Note: Forwarding request to 'systemctl enable NetworkManager.service'.
error reading information on service network: No such file or directory
Note: Forwarding request to 'systemctl disable sshd.service'.
rm '/etc/systemd/system/multi-user.target.wants/sshd.service'
Unmounting directory /var/tmp/imgcreate-qUhrVj/install_root
Losetup remove /dev/loop1
Traceback (most recent call last):
File
"/bin/livecd-creator", line 221, in
sys.exit(main())
File "/bin/livecd-creator", line 205, in main
creator.configure()
File "/usr/lib/python2.7/site-packages/imgcreate/creator.py", line 728, in configure
kickstart.XConfig(self._instroot).apply(ksh.xconfig)
File "/usr/lib/python2.7/site-packages/imgcreate/kickstart.py", line 244, in apply
f = open(self.path("/etc/inittab"), "rw+")
IOError: [Errno 2] No such file or directory: '/var/tmp/imgcreate-qUhrVj/install_root/etc/inittab'
解决办法:
这是fedora的selinux问题,只需关闭selinux 就可以解决。
强调:最主要的是学习kickstarts配置文件,这个我是弄了好长时间,如果要定制livecd,ks文件配置是最重要的,读者好好理解学习才可以。上面只是一些步骤和我用到的工具
要成为海贼王的男人2015-08-11 09:46:07
fuxunhao2006:2.mkdir /mnt/iso
mount -o loop -t iso9660 /path/you.iso /mnt/iso
LZ问下这个you.iso 是那个?
您好。这个你理解了吗?
回复 | 举报fuxunhao20062013-03-07 11:11:35
LZ:按照上面的步骤生成的iso,将iso放入虚拟机启动出现下面请看是上面问题
[ok] started show plymouth boot screen
[ok] Reached target Basic System
dracut-initqueue[180]:mount: unknown filesystem type iso9660
dracut-initqueue[180]:Warning
dracut-initqueue[180]:Warining: dracut FATAL:Failed to mount block device of live image
dracut-initqueue[180]:Warning: dracut: Refusing
fuxunhao20062013-03-01 16:13:30
2.mkdir /mnt/iso
mount -o loop -t iso9660 /path/you.iso /mnt/iso
LZ问下这个you.iso 是那个?