From be6ca702112c66f1787d8b95698f68af9c3110e9 Mon Sep 17 00:00:00 2001 From: Roger Luethi Date: Mon, 16 Jun 2014 17:51:51 +0200 Subject: [PATCH] Add distro-specific boot libraries This changeset adds two files (one for Ubuntu 12.04.4 LTS amd64 server, one for Fedora 20 x86_64) containing the distribution specific boot code. This includes the URL for the installation ISO image, the location of the distribution-specific preseed or kickstart files, the boot arguments, and the sequence of keys needed to get the installer to take our boot arguments. The preseed or kickstart file to use is selected based on the VM_ACCESS variable. In the case of Fedora, VM memory is increased to 1024 MB to allow a smooth install. Partial-Bug: 1312764 Implements: blueprint openstack-training-labs Change-Id: Idaf8b859e2b58036948f1a3ad077d797b3757d61 --- labs/lib/osbash/lib.fedora-20-x86_64 | 42 +++++++++++++++ .../osbash/lib.ubuntu-12.04.4-server-amd64 | 52 +++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 labs/lib/osbash/lib.fedora-20-x86_64 create mode 100644 labs/lib/osbash/lib.ubuntu-12.04.4-server-amd64 diff --git a/labs/lib/osbash/lib.fedora-20-x86_64 b/labs/lib/osbash/lib.fedora-20-x86_64 new file mode 100644 index 00000000..8a129307 --- /dev/null +++ b/labs/lib/osbash/lib.fedora-20-x86_64 @@ -0,0 +1,42 @@ +# Fedora 20 x86_64 + +# Default scripts for all Fedora base disks +: ${BASE_INSTALL_SCRIPTS:=scripts.fedora} + +# Give Fedora 20 installer sufficient RAM +VM_BASE_MEM=1024 + +#------------------------------------------------------------------------------- +# Booting the operating system installer +#------------------------------------------------------------------------------- + +readonly ISO_URL=http://mirror.switch.ch/ftp/mirror/fedora/linux/releases/20/Fedora/x86_64/iso/Fedora-20-x86_64-DVD.iso + +readonly _KS_ssh=http://git.openstack.org/cgit/openstack/training-guides/plain/labs/lib/osbash/netboot/ks-ssh.cfg +readonly _KS_vbadd=http://git.openstack.org/cgit/openstack/training-guides/plain/labs/lib/osbash/netboot/ks-vbadd.cfg +readonly _KS_all=http://git.openstack.org/cgit/openstack/training-guides/plain/labs/lib/osbash/netboot/ks-all.cfg + +readonly _BOOT_ARGS="linux ks=%s" + +function vbox_distro_start_installer { + local VM_NAME=$1 + + # pick a _KS_* file + local KICKSTART=_KS_$VM_ACCESS + + echo "Using $KICKSTART ${!KICKSTART}" + + local BOOT_ARGS=$(printf "$_BOOT_ARGS" "${!KICKSTART}") + + vbox_kbd_escape_key + + vbox_sleep 1 + + echo "Pushing boot command line" + vbox_kbd_string_input "$VM_NAME" "$BOOT_ARGS" + + echo "Initiating boot sequence" + vbox_kbd_enter_key +} + +# vim: set ai ts=4 sw=4 et ft=sh: diff --git a/labs/lib/osbash/lib.ubuntu-12.04.4-server-amd64 b/labs/lib/osbash/lib.ubuntu-12.04.4-server-amd64 new file mode 100644 index 00000000..a5af5eea --- /dev/null +++ b/labs/lib/osbash/lib.ubuntu-12.04.4-server-amd64 @@ -0,0 +1,52 @@ +# Ubuntu 12.04.4 LTS amd64 server + +# Default scripts for all Ubuntu installs +: ${BASE_INSTALL_SCRIPTS:=scripts.ubuntu} + +#------------------------------------------------------------------------------- +# Booting the operating system installer +#------------------------------------------------------------------------------- + +readonly ISO_URL=http://releases.ubuntu.com/12.04/ubuntu-12.04.4-server-amd64.iso + +readonly _PS_ssh=http://git.openstack.org/cgit/openstack/training-guides/plain/labs/lib/osbash/netboot/preseed-ssh.cfg +readonly _PS_vbadd=http://git.openstack.org/cgit/openstack/training-guides/plain/labs/lib/osbash/netboot/preseed-vbadd.cfg +readonly _PS_all=http://git.openstack.org/cgit/openstack/training-guides/plain/labs/lib/osbash/netboot/preseed-all.cfg + +readonly _BOOT_ARGS="/install/vmlinuz + noapic + preseed/url=%s + debian-installer=en_US + auto=true + locale=en_US + hostname=osbash + fb=false + debconf/frontend=noninteractive + keyboard-configuration/modelcode=SKIP + initrd=/install/initrd.gz + console-setup/ask_detect=false" + +function vbox_distro_start_installer { + local VM_NAME=$1 + + # pick a _PS_* file + local PRESEED=_PS_$VM_ACCESS + + echo "Using $PRESEED ${!PRESEED}" + + local BOOT_ARGS=$(printf "$_BOOT_ARGS" "${!PRESEED}") + + vbox_kbd_escape_key + vbox_kbd_escape_key + vbox_kbd_enter_key + + vbox_sleep 1 + + echo "Pushing boot command line" + vbox_kbd_string_input "$VM_NAME" "$BOOT_ARGS" + + echo "Initiating boot sequence" + vbox_kbd_enter_key +} + +# vim: set ai ts=4 sw=4 et ft=sh: