From Fedora Project Wiki

No edit summary
(Updated for ticket#208)
Line 3: Line 3:
This test will verify that anaconda can load a kickstart file from a {{filename|file://}} path.  This is a typical case for when the kickstart file is located in the {{filename|initrd.img}}.
This test will verify that anaconda can load a kickstart file from a {{filename|file://}} path.  This is a typical case for when the kickstart file is located in the {{filename|initrd.img}}.
|actions=
|actions=
# Prepare a valid kickstart file. For help creating a kickstart file, examine the file {{filename|/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]]
<ol>
# Download the installer initial ramdisk.  The ramdisk is typically called {{filename|images/pxeboot/initrd.img}}
<li> Prepare a valid kickstart file. For help creating a kickstart file, examine the file {{filename|/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]]
# Place the kickstart file into the root directory of the installer initial ramdisk using the {{command|pax}} command.  For example,  
<li> Download the installer initial ramdisk.  The ramdisk is typically called {{filename|images/pxeboot/initrd.img}}
## Untar the ramdisk: <pre>zcat initrd.img > initrd.cpio</pre>
<li> Place the kickstart file into the root directory of the installer initial ramdisk using the {{command|pax}} command.  For example,  
## Add the kickstart file: <pre>pax -w -a -f initrd.cpio ks.cfg</pre>
<ol>
## Compress the image: <pre>gzip -c initrd.cpio > initrd.img</pre>
  <li> Decompress the ramdisk: <pre>xz -c -d initrd.img > initrd.cpio</pre>
# Boot into the installer using any available means
{{admon/note|Gzip compressed ramdisk?|Older installer ramdisk images were compressed using [https://secure.wikimedia.org/wikipedia/en/wiki/Gzip gzip] compression.  The {{command|file}} command can be used to determine how the ramdisk is compressed. 
# At the bootloader prompt, provide a location for the kickstart file at the boot prompt.  Using the example above: <pre>linux ks=file:///ks.cfg </pre>
<pre>
file images/pxeboot/initrd.img
  images/pxeboot/initrd.img: gzip compressed data, from Unix, last modified: Thu Oct 21 14:29:08 2010, max compression
</pre>
The {{command|zcat}} command can be used to uncompress gzip compressed ramdisk images.  The following example demonstrates decompressing a gzip compressed ramdisk image.
<pre>zcat initrd.img > initrd.cpio</pre>}}
  <li> Add the kickstart file: <pre>pax -w -a -f initrd.cpio ks.cfg</pre>
  <li> Re-compress the image: <pre>xz --check=crc32 -9 -c initrd.cpio > initrd.img</pre>
{{admon/note|Gzip compressed ramdisk?|As noted earlier, older installer ramdisk images were compressed using [https://secure.wikimedia.org/wikipedia/en/wiki/Gzip gzip] compression.  To create a gzip compressed initial ramdisk, use the {{command|gzip}} command as noted below.
<pre>gzip -c initrd.cpio > initrd.img</pre>}}
<li> Boot into the installer using any available means
<li> At the bootloader prompt, provide a location for the kickstart file at the boot prompt.  Using the example above: <pre>linux ks=file:///ks.cfg </pre>
</ol>
|results=
|results=
<ol>
<ol>
<li> Confirm the ks.cfg is included in the initial ramdisk.</li>
<li> Confirm the ks.cfg is included in the initial ramdisk.
<pre>zcat initrd.img | pax | grep ks.cfg
<pre>xz -c -d initrd.img | cpio -it | grep ks.cfg
ks.cfg </pre>
  ks.cfg </pre>
</li>
</li>
<li> The ks.cfg is successfully obtained from the specified location</li>
<li> The installer successfully initiates a kickstart install in accordance with the instructions supplied by the {{filename|ks.cfg}} file included in the initial ramdisk.  To ensure the kickstart file is properly loaded, inspect the {{filename|anaconda.log}} for a lines similar to the following:
<li> The install should proceed in accordance with the directives in the ks.cfg file</li>
<pre>
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
</pre>
<li> The install should proceed in accordance with the directives in the {{filename|ks.cfg}} file</li>
</ol>
</ol>
}}
}}


[[Category:Kickstart Delivery]]
[[Category:Kickstart Delivery]]

Revision as of 15:49, 28 June 2011

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. Download the installer initial ramdisk. The ramdisk is typically called images/pxeboot/initrd.img
  3. Place the kickstart file into the root directory of the installer initial ramdisk using the pax command. For example,
    1. Decompress the ramdisk:
      xz -c -d initrd.img > initrd.cpio
      Note.png
      Gzip compressed ramdisk?
      Older installer ramdisk images were compressed using gzip compression. The file command can be used to determine how the ramdisk is compressed.
      file images/pxeboot/initrd.img
        images/pxeboot/initrd.img:  gzip compressed data, from Unix, last modified: Thu Oct 21 14:29:08 2010, max compression
      

      The zcat command can be used to uncompress gzip compressed ramdisk images. The following example demonstrates decompressing a gzip compressed ramdisk image.

      zcat initrd.img > initrd.cpio
    2. Add the kickstart file:
      pax -w -a -f initrd.cpio ks.cfg
    3. Re-compress the image:
      xz --check=crc32 -9 -c initrd.cpio > initrd.img
      Note.png
      Gzip compressed ramdisk?
      As noted earlier, older installer ramdisk images were compressed using gzip compression. To create a gzip compressed initial ramdisk, use the gzip command as noted below.
      gzip -c initrd.cpio > initrd.img
    4. Boot into the installer using any available means
    5. At the bootloader prompt, provide a location for the kickstart file at the boot prompt. Using the example above:
      linux ks=file:///ks.cfg 

    Expected Results

    1. Confirm the ks.cfg is included in the initial ramdisk.
      xz -c -d initrd.img | cpio -it | grep ks.cfg
        ks.cfg 
    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 install should proceed in accordance with the directives in the ks.cfg file