From Fedora Project Wiki

(1.5 GB RAM wasn't enough to download and run stage2, bump the requirements)
 
(21 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Template:Associated_release_criterion|Beta|kickstart-delivery}}
{{QA/Test_Case
{{QA/Test_Case
|description=
|description=
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}}.
|setup=
# Prepare a valid kickstart file.
#* You can use an example kickstart available from [[QA:Testcase Kickstart Http Server Ks Cfg]].
#* If you want to create your own kickstart, you can 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]].
|actions=
|actions=
<ol>
<ol>
<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]]
<li>You need to place your kickstart file inside the ramdisk. You can either use <code>--initrd-inject</code> option of {{package|virt-install}} tool, or do that manually:
<ul>
<li>'''Option #1 - using virt-install''':
Use <code>--initrd-inject &lt;kickstart&gt;</code> and <code>--extra-args "inst.ks=file:/&lt;kickstart&gt;"</code> command line arguments. An example command would look like this (you need to change the ''location'' at least):
{{#tag:pre|virt-install --name FedoraTest --ram 3000 --disk pool=default,size=10 --location http://dl.fedoraproject.org/pub/alt/stage/{{FedoraVersionNumber|next|short}}_Beta-1.6/Everything/x86_64/os/ --initrd-inject ks.cfg --extra-args "inst.ks=file:/ks.cfg"}}</li>
<li>'''Option #2 - modifying ramdisk manually''':
<ol>
<li> Download the installer initial ramdisk.  The ramdisk is typically called {{filename|images/pxeboot/initrd.img}}
<li> Download the installer initial ramdisk.  The ramdisk is typically called {{filename|images/pxeboot/initrd.img}}
<li> Place the kickstart file into the root directory of the installer initial ramdisk using the {{command|pax}} command.  For example,
<li> Place the kickstart file into the root directory of the installer initial ramdisk using the {{command|cpio}} command.  <pre>echo ks.cfg | cpio -c -o >> initrd.img</pre>
<ol>
<li> Boot into the installer kernel ({{filename|vmlinuz}}) and the modified initial ramdisk ({{filename|initrd.img}}) using any available means (PXE, virt-install, virt-manager, etc)
  <li> Decompress the ramdisk: <pre>xz -c -d initrd.img > initrd.cpio</pre>
<li> At the bootloader prompt, provide a location for the kickstart file at the boot prompt.  Using the example above: <pre>inst.ks=file:///ks.cfg </pre>
{{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. 
You also need to provide <code>[https://rhinstaller.github.io/anaconda/boot-options.html#inst-stage2 stage2=]</code> boot option for Anaconda to start correctly.
<pre>
</ol>
file images/pxeboot/initrd.img
</ul>
  images/pxeboot/initrd.img:  gzip compressed data, from Unix, last modified: Thu Oct 21 14:29:08 2010, max compression
</li>
</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>
</ol>
|results=
|results=
<ol>
<ol>
<li> Confirm the ks.cfg is included in the initial ramdisk.
<li> The {{filename|ks.cfg}} should be appended to the initrd. The file presence is '''not''' shown by <code>lsinitrd</code> (it can't display concatenated images). If you need to debug whether the file was included, boot the machine with <code>rd.break=cmdline rd.shell</code> kernel command line argument and use shell to confirm the presence of {{filename|ks.cfg}}.
<pre>xz -c -d initrd.img | cpio -it | grep ks.cfg
  ks.cfg </pre>
</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 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:
<pre>
<pre>
15:44:56,189 INFO loader: kernel command line:
INFO anaconda: Parsing kickstart: /run/install/ks.cfg
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>
</pre>
<li> The install should proceed in accordance with the directives in the {{filename|ks.cfg}} file</li>
<code>/run/install/ks.cfg</code> should contain your kickstart file</li>
<li> The installer should honor the kickstart commands provided in the {{filename|ks.cfg}} file </li>
<li> If sufficient commands are provided to fully automate an installation, the installer must not prompt for user input.</li>
</ol>
</ol>
}}
}}


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

Latest revision as of 08:08, 12 September 2019

Note.png
Associated release criterion
This test case is associated with the Fedora_40_Beta_Release_Criteria#kickstart-delivery release criterion. If you are doing release validation testing, a failure of this test case may be a breach of that release criterion. If so, please file a bug and nominate it as blocking the appropriate milestone, using the blocker bug nomination page.


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.

Setup

  1. Prepare a valid kickstart file.
    • You can use an example kickstart available from QA:Testcase Kickstart Http Server Ks Cfg.
    • If you want to create your own kickstart, you can 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.

How to test

  1. You need to place your kickstart file inside the ramdisk. You can either use --initrd-inject option of Package-x-generic-16.pngvirt-install tool, or do that manually:
    • Option #1 - using virt-install: Use --initrd-inject <kickstart> and --extra-args "inst.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 3000 --disk pool=default,size=10 --location http://dl.fedoraproject.org/pub/alt/stage/40_Beta-1.6/Everything/x86_64/os/ --initrd-inject ks.cfg --extra-args "inst.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:
        inst.ks=file:///ks.cfg 

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

Expected Results

  1. The ks.cfg should be appended to the initrd. The file presence is not shown by lsinitrd (it can't display concatenated images). If you need to debug whether the file was included, boot the machine with rd.break=cmdline rd.shell kernel command line argument and use shell to confirm the presence of 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:
    INFO anaconda: Parsing kickstart: /run/install/ks.cfg
    
    /run/install/ks.cfg should contain your kickstart file
  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.