[virt-tools-list] virt-install: Getting initrd 'injection' to work...

Cole Robinson crobinso at redhat.com
Wed Oct 27 18:40:33 UTC 2010


On 10/21/2010 06:02 PM, Martin Ellis wrote:
> Hi all,
> 
> I've been trying to use preseeding [1] to automate installations of Debian-
> based VMs. I'd been using an HTTP server to provide the configuration file,
> but then found the following feature in the virt-tools changelog:
> 
>   "New virt-install --initrd-inject option, which enables installation using a _local_ kickstart file"
> 
> I don't know anything about Kickstart, but adding a file to the initrd is exactly what I need.
> Unfortunately, the feature doesn't work for me.
> 
> I had a look at the patch that introduced this feature [2], and noticed
> that it was using cpio -c when repacking the initrd.
> The -c option means "ASCII cpio archive (pre-SVR4 or odc)".
> 
> I've only been able to get the feature to work if I change it to use the
> 'newc' format, by replacing -c with -Hnewc.
> Using -Hnewc gives "ASCII cpio archive (SVR4 with no CRC)"
> 
> While I was looking, I also noticed that the initrd gets unpacked, and
> then repacked again with the new files.  A more efficient way to do
> this is to simply append a new (compressed) cpio archive onto the end
> of the original initrd.  This works because Linux allows a sequence of
> (optionally compressed) cpio archives concatenated together [3].
> 
> I've attached a patch addresses both issues.
> 
> Martin
> 
> [1] http://d-i.alioth.debian.org/manual/en.i386/apb.html
> [2] http://hg.fedorahosted.org/hg/python-virtinst/rev/74bc3757b247
> [3] http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6-stable.git;a=blob_plain;f=Documentation/early-userspace/buffer-format.txt;hb=HEAD
> 
> 

Thanks, applied now:

http://hg.fedorahosted.org/hg/python-virtinst/rev/577ad9c285b5

- Cole




More information about the virt-tools-list mailing list