From Fedora Project Wiki

(stage2= is needed for direct boot)
(clarify virt-install approach)
Line 8: Line 8:
<ul>
<ul>
<li>'''Option #1 - using a virt-install''':  
<li>'''Option #1 - using a virt-install''':  
{{admon/caution|This currently doesn't work|This approach is currently broken due to [https://bugzilla.redhat.com/show_bug.cgi?id{{=}}819465 bug 819465]}}
{{admon/caution|A bug involved|Due to [https://bugzilla.redhat.com/show_bug.cgi?id{{=}}967531 bug 967531] you kickstart need to contain <code>url --mirrorlist{{=}}http://mirrors.fedoraproject.org/metalink?repo{{=}}fedora-{{FedoraVersionNumber|next|short}}&arch{{=}}x86_64</code> (change architecture) line for this approach to work.}}
Use <code>--initrd-inject &lt;kickstart&gt;</code> and <code>--extra-args "ks=file:/&lt;kickstart&gt;"</code> command line arguments. An example command would look like this (you need to change the ''location'' at least):
Use <code>--initrd-inject &lt;kickstart&gt;</code> and <code>--extra-args "ks=file:/&lt;kickstart&gt;"</code> command line arguments. An example command would look like this (you need to change the ''location'' at least):
<pre>virt-install --name FedoraTest --ram 1024 --disk pool=default,size=10 --location http://dl.fedoraproject.org/pub/alt/stage/17-Alpha.RC4/Fedora/x86_64/os/ --initrd-inject ks.cfg --extra-args "ks=file:/ks.cfg"</pre></li>
<pre>virt-install --name FedoraTest --ram 1024 --disk pool=default,size=10 --location http://dl.fedoraproject.org/pub/alt/stage/19-Alpha.RC4/Fedora/x86_64/os/ --initrd-inject ks.cfg --extra-args "ks=file:/ks.cfg"</pre></li>
<li>'''Option #2 - modifying ramdisk manually''':
<li>'''Option #2 - modifying ramdisk manually''':
<ol>
<ol>

Revision as of 11:47, 27 May 2013

Description

This test will verify that anaconda can load a kickstart file from a file:// path. This is a typical case for when the kickstart file is located in the initrd.img.


How to test

  1. Prepare a valid kickstart file. For help creating a kickstart file, examine the file /root/anaconda-ks.cfg on a previously installed system. This file contains the kickstart instructions used to install that system. For additional guidance on kickstart syntax, see Anaconda/Kickstart
  2. Now you need to place your kickstart file inside the ramdisk. You can either do that manually, or use --initrd-inject option of Package-x-generic-16.pngpython-virtinst tool, if you use it:
    • Option #1 - using a virt-install:
      Stop (medium size).png
      A bug involved
      Due to bug 967531 you kickstart need to contain url --mirrorlist=http://mirrors.fedoraproject.org/metalink?repo=fedora-40&arch=x86_64 (change architecture) line for this approach to work.

      Use --initrd-inject <kickstart> and --extra-args "ks=file:/<kickstart>" command line arguments. An example command would look like this (you need to change the location at least):

      virt-install --name FedoraTest --ram 1024 --disk pool=default,size=10 --location http://dl.fedoraproject.org/pub/alt/stage/19-Alpha.RC4/Fedora/x86_64/os/ --initrd-inject ks.cfg --extra-args "ks=file:/ks.cfg"
    • Option #2 - modifying ramdisk manually:
      1. Download the installer initial ramdisk. The ramdisk is typically called images/pxeboot/initrd.img
      2. Place the kickstart file into the root directory of the installer initial ramdisk using the cpio command.
        echo ks.cfg | cpio -c -o >> initrd.img
      3. Boot into the installer kernel (vmlinuz) and the modified initial ramdisk (initrd.img) using any available means (PXE, virt-install, virt-manager, etc)
      4. At the bootloader prompt, provide a location for the kickstart file at the boot prompt. Using the example above:
        ks=file:///ks.cfg 

        You also need to provide stage2= boot option for Anaconda to start correctly.

Expected Results

  1. Confirm the ks.cfg is included in the initial ramdisk. The user-space commands to inspect the Fedora 16 initrd.img contents are not yet available. The only way to ensure the provided ks.cfg is used is to boot the installer
  2. The installer successfully initiates a kickstart install in accordance with the instructions supplied by the ks.cfg file included in the initial ramdisk. To ensure the kickstart file is properly loaded, inspect the anaconda.log for a lines similar to the following:
    15:44:56,189 INFO loader: kernel command line:
    15:44:56,189 INFO loader:     ks=file:///ks.cfg
    ...
    15:44:59,274 INFO loader: getting kickstart file
    15:44:59,274 INFO loader: setting up kickstart
    ...
    15:44:59,906 INFO loader: doing kickstart... setting it up
    
  3. The installer should honor the kickstart commands provided in the ks.cfg file
  4. If sufficient commands are provided to fully automate an installation, the installer must not prompt for user input.