From 0df9b3dab1c8142500b1653cea1ecfa46700edb1 Mon Sep 17 00:00:00 2001 From: Weezer Su Date: Tue, 7 Feb 2017 15:26:38 -0600 Subject: [PATCH] Add kernel option into preseed According to suggestion, add the kernel option in the preseed file, leave it empty to get the lastest kernel, or specify the kernel number. Change-Id: Ie5b8f62a89ef9eb51954f0452becbaa9e81ee973 --- multi-node-aio/README.rst | 2 ++ multi-node-aio/setup-cobbler.sh | 10 ++++++++++ .../ubuntu-server-14.04-unattended-cobbler-cinder.seed | 5 ++++- .../ubuntu-server-14.04-unattended-cobbler-infra.seed | 5 ++++- ...ubuntu-server-14.04-unattended-cobbler-logging.seed | 5 ++++- ...ubuntu-server-14.04-unattended-cobbler-network.seed | 5 ++++- ...u-server-14.04-unattended-cobbler-nova_compute.seed | 5 ++++- .../ubuntu-server-14.04-unattended-cobbler-swift.seed | 5 ++++- 8 files changed, 36 insertions(+), 6 deletions(-) diff --git a/multi-node-aio/README.rst b/multi-node-aio/README.rst index 4f4dcd5e..509cf8d1 100644 --- a/multi-node-aio/README.rst +++ b/multi-node-aio/README.rst @@ -145,6 +145,8 @@ Instruct the system to run the OSA playbooks, if you want to deploy other OSA po Instruct the VM to use the selected image, eg. ubuntu xenial: ``DEFAULT_IMAGE=${DEFAULT_IMAGE:-16.04}`` +Install the specified kernel, eg 3.13.0-34 if you want to deploy Juno release. + ``DEFAULT_KERNEL=${DEFAULT_KERNEL:-3.13.0-34}`` Re-kicking the VMs ------------------ diff --git a/multi-node-aio/setup-cobbler.sh b/multi-node-aio/setup-cobbler.sh index 3b033a9a..ae4e436b 100755 --- a/multi-node-aio/setup-cobbler.sh +++ b/multi-node-aio/setup-cobbler.sh @@ -20,6 +20,15 @@ source functions.rc # The default image for VMs, change it to 16.04 if you want to use xenial as operation system. DEFAULT_IMAGE="${DEFAULT_IMAGE:-"$(lsb_release -sd | awk '{print $2}')"}" +# The default kernel for Image, leave it empty will install the lastest kernel. +DEFAULT_KERNEL="${DEFAULT_KERNEL:-}" + +if [ -z "$DEFAULT_KERNEL" ]; then + DEFAULT_KERNEL=linux-image-generic +else + DEFAULT_KERNEL="linux-image-$DEFAULT_KERNEL-generic" +fi + # Install cobbler wget -qO - http://download.opensuse.org/repositories/home:/libertas-ict:/cobbler26/xUbuntu_14.04/Release.key | apt-key add - add-apt-repository "deb http://download.opensuse.org/repositories/home:/libertas-ict:/cobbler26/xUbuntu_14.04/ ./" @@ -83,6 +92,7 @@ for seed_file in $(ls -1 templates/pre-seeds); do sed -i "s|__DEVICE_NAME__|${DEVICE_NAME}|g" "/var/lib/cobbler/kickstarts/${seed_file#*'/'}" sed -i "s|__SSHKEY__|${SSHKEY}|g" "/var/lib/cobbler/kickstarts/${seed_file#*'/'}" sed -i "s|__DEFAULT_NETWORK__|${DEFAULT_NETWORK}|g" "/var/lib/cobbler/kickstarts/${seed_file#*'/'}" + sed -i "s|__DEFAULT_KERNEL__|${DEFAULT_KERNEL}|g" "/var/lib/cobbler/kickstarts/${seed_file#*'/'}" done # Restart services again and configure autostart diff --git a/multi-node-aio/templates/pre-seeds/ubuntu-server-14.04-unattended-cobbler-cinder.seed b/multi-node-aio/templates/pre-seeds/ubuntu-server-14.04-unattended-cobbler-cinder.seed index 469d328f..397fe474 100644 --- a/multi-node-aio/templates/pre-seeds/ubuntu-server-14.04-unattended-cobbler-cinder.seed +++ b/multi-node-aio/templates/pre-seeds/ubuntu-server-14.04-unattended-cobbler-cinder.seed @@ -22,6 +22,9 @@ # Note: options passed to the installer will be added automatically. d-i debian-installer/add-kernel-opts string $kernel_options_post +### Base system installation +d-i base-installer/kernel/image string __DEFAULT_KERNEL__ + ############# # # Networking @@ -290,4 +293,4 @@ d-i preseed/late_command string \ ############# # Reboot after the install is finished. -finish-install finish-install/reboot_in_progress note \ No newline at end of file +finish-install finish-install/reboot_in_progress note diff --git a/multi-node-aio/templates/pre-seeds/ubuntu-server-14.04-unattended-cobbler-infra.seed b/multi-node-aio/templates/pre-seeds/ubuntu-server-14.04-unattended-cobbler-infra.seed index 3b4e5b17..230444f2 100644 --- a/multi-node-aio/templates/pre-seeds/ubuntu-server-14.04-unattended-cobbler-infra.seed +++ b/multi-node-aio/templates/pre-seeds/ubuntu-server-14.04-unattended-cobbler-infra.seed @@ -22,6 +22,9 @@ # Note: options passed to the installer will be added automatically. d-i debian-installer/add-kernel-opts string $kernel_options_post +### Base system installation +d-i base-installer/kernel/image string __DEFAULT_KERNEL__ + ############# # # Networking @@ -284,4 +287,4 @@ d-i preseed/late_command string \ ############# # Reboot after the install is finished. -finish-install finish-install/reboot_in_progress note \ No newline at end of file +finish-install finish-install/reboot_in_progress note diff --git a/multi-node-aio/templates/pre-seeds/ubuntu-server-14.04-unattended-cobbler-logging.seed b/multi-node-aio/templates/pre-seeds/ubuntu-server-14.04-unattended-cobbler-logging.seed index e67c5ca5..2ee42788 100644 --- a/multi-node-aio/templates/pre-seeds/ubuntu-server-14.04-unattended-cobbler-logging.seed +++ b/multi-node-aio/templates/pre-seeds/ubuntu-server-14.04-unattended-cobbler-logging.seed @@ -22,6 +22,9 @@ # Note: options passed to the installer will be added automatically. d-i debian-installer/add-kernel-opts string $kernel_options_post +### Base system installation +d-i base-installer/kernel/image string __DEFAULT_KERNEL__ + ############# # # Networking @@ -285,4 +288,4 @@ d-i preseed/late_command string \ ############# # Reboot after the install is finished. -finish-install finish-install/reboot_in_progress note \ No newline at end of file +finish-install finish-install/reboot_in_progress note diff --git a/multi-node-aio/templates/pre-seeds/ubuntu-server-14.04-unattended-cobbler-network.seed b/multi-node-aio/templates/pre-seeds/ubuntu-server-14.04-unattended-cobbler-network.seed index 3b4e5b17..230444f2 100644 --- a/multi-node-aio/templates/pre-seeds/ubuntu-server-14.04-unattended-cobbler-network.seed +++ b/multi-node-aio/templates/pre-seeds/ubuntu-server-14.04-unattended-cobbler-network.seed @@ -22,6 +22,9 @@ # Note: options passed to the installer will be added automatically. d-i debian-installer/add-kernel-opts string $kernel_options_post +### Base system installation +d-i base-installer/kernel/image string __DEFAULT_KERNEL__ + ############# # # Networking @@ -284,4 +287,4 @@ d-i preseed/late_command string \ ############# # Reboot after the install is finished. -finish-install finish-install/reboot_in_progress note \ No newline at end of file +finish-install finish-install/reboot_in_progress note diff --git a/multi-node-aio/templates/pre-seeds/ubuntu-server-14.04-unattended-cobbler-nova_compute.seed b/multi-node-aio/templates/pre-seeds/ubuntu-server-14.04-unattended-cobbler-nova_compute.seed index 3769b03b..e76e44dd 100644 --- a/multi-node-aio/templates/pre-seeds/ubuntu-server-14.04-unattended-cobbler-nova_compute.seed +++ b/multi-node-aio/templates/pre-seeds/ubuntu-server-14.04-unattended-cobbler-nova_compute.seed @@ -22,6 +22,9 @@ # Note: options passed to the installer will be added automatically. d-i debian-installer/add-kernel-opts string $kernel_options_post +### Base system installation +d-i base-installer/kernel/image string __DEFAULT_KERNEL__ + ############# # # Networking @@ -292,4 +295,4 @@ d-i preseed/late_command string \ ############# # Reboot after the install is finished. -finish-install finish-install/reboot_in_progress note \ No newline at end of file +finish-install finish-install/reboot_in_progress note diff --git a/multi-node-aio/templates/pre-seeds/ubuntu-server-14.04-unattended-cobbler-swift.seed b/multi-node-aio/templates/pre-seeds/ubuntu-server-14.04-unattended-cobbler-swift.seed index 8746987c..281bf43a 100644 --- a/multi-node-aio/templates/pre-seeds/ubuntu-server-14.04-unattended-cobbler-swift.seed +++ b/multi-node-aio/templates/pre-seeds/ubuntu-server-14.04-unattended-cobbler-swift.seed @@ -22,6 +22,9 @@ # Note: options passed to the installer will be added automatically. d-i debian-installer/add-kernel-opts string $kernel_options_post +### Base system installation +d-i base-installer/kernel/image string __DEFAULT_KERNEL__ + ############# # # Networking @@ -309,4 +312,4 @@ d-i preseed/late_command string \ ############# # Reboot after the install is finished. -finish-install finish-install/reboot_in_progress note \ No newline at end of file +finish-install finish-install/reboot_in_progress note