defconf INSTALL_TEMPLATE "$installdir/templates/install.xml" \
"<file>" "libvirt template for initial install"
+defconf INSTALL_KERNEL_OPTIONS "@uto" \
+ "<options>" "installer kernel command-line options"
+
defconf BOOT_TEMPLATE "$installdir/templates/bootbase.xml" \
"<file>" "libvirt template for \"bootbase\" command"
echo "$installdir/templates/RHEL${RHEL_VERSION%%.*}.services"
}
+rhel_get_install_kernel_options ()
+{
+ case "$RHEL_VERSION" in
+ (7.*) echo "ks=hd:LABEL=KICKSTART inst.stage2=hd:LABEL=RHEL-${RHEL_VERSION}\\\\x20Server.${RHEL_ARCH}" ;;
+ (*) echo "ks=floppy" ;;
+ esac
+}
+
+rhel_get_install_ks_device_xml ()
+{
+ if [ ${RHEL_VERSION%%.*} -le 6 ] ; then
+ cat <<EOF
+ <disk type='file' device='floppy'>
+ <source file='@@PWD@@/tmp/floppy.img'/>
+ <target dev='fda'/>
+ <readonly/>
+ </disk>
+EOF
+ else
+ cat <<EOF
+ <disk type='file' device='disk'>
+ <source file='@@PWD@@/tmp/floppy.img'/>
+ <target dev='@@SYSTEM_DISK_PREFIX@@b' bus='@@SYSTEM_DISK_TYPE@@'/>
+ <driver name='qemu' type='raw'/>
+ </disk>
+EOF
+ fi
+}
+
rhel_post_config_hook ()
{
if [ "$ISO" = "@uto" ] ; then
if [ "$RHEL_SERVICES" = "@uto" ] ; then
RHEL_SERVICES=$(rhel_get_services) || exit $?
fi
+
+ if [ "$INSTALL_KERNEL_OPTIONS" = "@uto" ] ; then
+ INSTALL_KERNEL_OPTIONS=$(rhel_get_install_kernel_options) || exit $?
+ fi
+
+ if [ "$INSTALL_KS_DEVICE_TEMPLATE" = "@uto" ] ; then
+ INSTALL_KS_DEVICE_TEMPLATE=$(rhel_get_install_ks_device_xml) || exit $?
+ fi
}
register_hook post_config_hooks rhel_post_config_hook
defconf KS_DONE_MESSAGE "you may safely reboot your system|System halted." \
"<string>" "string indicating kickstart install is complete"
+defconf INSTALL_KS_DEVICE_TEMPLATE "@uto"
+
##############################
defconf CREATE_BASE_TIMEOUT 3600 \
<type>hvm</type>
<kernel>@@PWD@@/tmp/vmlinuz</kernel>
<initrd>@@PWD@@/tmp/initrd.img</initrd>
- <cmdline>console=ttyS0,115200 ks=floppy</cmdline>
+ <cmdline>console=ttyS0,115200 selinux=0 @@INSTALL_KERNEL_OPTIONS@@</cmdline>
</os>
<features>
<acpi/>
<target dev='hdc' bus='ide'/>
<readonly/>
</disk>
- <disk type='file' device='floppy'>
- <source file='@@PWD@@/tmp/floppy.img'/>
- <target dev='fda'/>
- <readonly/>
- </disk>
+@@INSTALL_KS_DEVICE_TEMPLATE@@
@@@NETWORK_TEMPLATE@@@
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' listen='127.0.0.1'/>