summaryrefslogtreecommitdiffstats
path: root/config.d
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2014-06-16 15:57:44 +1000
committerMartin Schwenke <martin@meltin.net>2014-06-25 20:46:15 +1000
commit66750ab53da7d9aa1a035eb6829fefff25fcb01c (patch)
tree2f8596426caf89bdb3477543921d248ffa25ca3c /config.d
parentd1e570f74343c4c3021f22133770f76c16884056 (diff)
downloadautocluster-66750ab53da7d9aa1a035eb6829fefff25fcb01c.tar.gz
autocluster-66750ab53da7d9aa1a035eb6829fefff25fcb01c.tar.xz
autocluster-66750ab53da7d9aa1a035eb6829fefff25fcb01c.zip
RHEL 7 needs different boot options to support kickstart
It no longer supports ks=floppy and needs inst.stage2 to point to the DVD image. Label the "floppy" as "KICKSTART" regardless of the version - this does no harm. If running RHEL >= 7 then set up the kickstart "floppy" as a hard disk in libvirt and have the kernel command-line point to the label. Also set inst.stage2 so it can find root device to install from. Signed-off-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'config.d')
-rw-r--r--config.d/00base.defconf42
1 files changed, 42 insertions, 0 deletions
diff --git a/config.d/00base.defconf b/config.d/00base.defconf
index 0765778..b41632d 100644
--- a/config.d/00base.defconf
+++ b/config.d/00base.defconf
@@ -62,6 +62,9 @@ defconf NODE_TEMPLATE "$installdir/templates/node.xml" \
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"
@@ -418,6 +421,35 @@ rhel_get_services ()
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
@@ -447,6 +479,14 @@ rhel_post_config_hook ()
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
@@ -502,6 +542,8 @@ defconf KS_KERNEL_OPTS "rhgb console=tty1 console=ttyS0,19200 nodmraid nompath"
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 \