On 02/03/2010 02:54 PM, Li Ming wrote:
On 02/02/2010 03:59 AM, James Laska wrote:
Yeah, having to uncompress the ISO image would be messy. I think we'll likely employ a different mechanism for storing the kickstart file if we use virt-install --cdrom. We can either use ks=http:// or ks=hd:sda1:/ks.cfg. The former would probably be simpler, but I think it would activate networking and that interferes with the use case of a DVD or CD install. If possible, I'd be curious if we can write the ks.cfg file to the virt-disk prior to running the command virt-install.
I spoke to Richard Jones on IRC about this. Richard has been developing libguestfs (http://libguestfs.org - a library for accessing virtual disk images). He suggested that guestfs (aka python-libguestfs) could be used to accomplish this and provided a sample python snippet that might help accomplish what you'd need (see attached python file). This looks promising, might be worth exploring as a way to provide the ks.cfg to the guest without needing to modify the initrd.img.
Your attached script works!!, I tried today,after a small modification, it can help to create an extra virtual disk and put the ks in the additional virtual disk, after the VM boots up, can read the ks from /dev/vdb1. It's so great, thanks for the information. I will add this function to dvd_install.py for the local ks file.
I add this function to dvd_install.py, the script supports both local kickstart file and remote http/ftp kickstart file now.More details please download and run :
http://git.fedorahosted.org/git/autoqa.git?p=autoqa.git;a=tree;f=tests/anaco...
like I can run :
mount -o loop F12gaDVD.iso /media ./dvd_install.py -k /var/www/html/ks.cfg -a i386 -d /media
Thanks Liam