From Fedora Project Wiki
No edit summary |
m (ks -> inst.ks) |
||
Line 10: | Line 10: | ||
<ul> | <ul> | ||
<li>'''Option #1 - using a virt-install''': | <li>'''Option #1 - using a virt-install''': | ||
Use <code>--initrd-inject <kickstart></code> and <code>--extra-args "ks=file:/<kickstart>"</code> command line arguments. An example command would look like this (you need to change the ''location'' at least): | Use <code>--initrd-inject <kickstart></code> and <code>--extra-args "inst.ks=file:/<kickstart>"</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 1024 --disk pool=default,size=10 --location http://dl.fedoraproject.org/pub/alt/stage/{{FedoraVersionNumber|next|short}}-Alpha-RC4/Fedora/x86_64/os/ --initrd-inject ks.cfg --extra-args "ks=file:/ks.cfg"}}</li> | {{#tag:pre|virt-install --name FedoraTest --ram 1024 --disk pool=default,size=10 --location http://dl.fedoraproject.org/pub/alt/stage/{{FedoraVersionNumber|next|short}}-Alpha-RC4/Fedora/x86_64/os/ --initrd-inject ks.cfg --extra-args "inst.ks=file:/ks.cfg"}}</li> | ||
<li>'''Option #2 - modifying ramdisk manually''': | <li>'''Option #2 - modifying ramdisk manually''': | ||
<ol> | <ol> | ||
Line 17: | Line 17: | ||
<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> | <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> | ||
<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> 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> At the bootloader prompt, provide a location for the kickstart file at the boot prompt. Using the example above: <pre>ks=file:///ks.cfg </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> | ||
You also need to provide <code>[[Anaconda/Options#stage2|stage2=]]</code> boot option for Anaconda to start correctly. | You also need to provide <code>[[Anaconda/Options#stage2|stage2=]]</code> boot option for Anaconda to start correctly. | ||
</ol> | </ol> |
Revision as of 12:12, 8 April 2015
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
- 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 - Now you need to place your kickstart file inside the ramdisk. You can either do that manually, or use
--initrd-inject
option of
tool, if you use it:python-virtinst
- Option #1 - using a 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 1024 --disk pool=default,size=10 --location http://dl.fedoraproject.org/pub/alt/stage/41-Alpha-RC4/Fedora/x86_64/os/ --initrd-inject ks.cfg --extra-args "inst.ks=file:/ks.cfg"
- Option #2 - modifying ramdisk manually:
- Download the installer initial ramdisk. The ramdisk is typically called
images/pxeboot/initrd.img
- 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
- Boot into the installer kernel (
vmlinuz
) and the modified initial ramdisk (initrd.img
) using any available means (PXE, virt-install, virt-manager, etc) - 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.
- Download the installer initial ramdisk. The ramdisk is typically called
- Option #1 - using a virt-install:
Use
Expected Results
- The
ks.cfg
should be appended to the initrd. The file presence is not shown bylsinitrd
(it can't display concatenated images). If you need to debug whether the file was included, boot the machine withrd.break=cmdline rd.shell
kernel command line argument and use shell to confirm the presence ofks.cfg
. - 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 theanaconda.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 - The installer should honor the kickstart commands provided in the
ks.cfg
file - If sufficient commands are provided to fully automate an installation, the installer must not prompt for user input.