From 4375b689ffa0f2f37c04fef7c25aaf9473ba8582 Mon Sep 17 00:00:00 2001 From: Michael Polenchuk Date: Wed, 29 Mar 2017 11:14:30 +0400 Subject: [fuel-plugin] Set default grub entry for kernel JIRA: KVMFORNFV-77 Change-Id: Ibb764cd5fa9822d337ce6f948bff8213c1caa7eb Signed-off-by: Paul Vaduva Signed-off-by: Michael Polenchuk (cherry picked from commit e797a9f954797949f676a46f5c9ceb31874f919a) --- .../deployment_scripts/puppet/manifests/kvm-install.pp | 13 +++++++++++++ fuel-plugin/pre_build_hook | 8 ++++++++ 2 files changed, 21 insertions(+) diff --git a/fuel-plugin/deployment_scripts/puppet/manifests/kvm-install.pp b/fuel-plugin/deployment_scripts/puppet/manifests/kvm-install.pp index fba3e38ce..a723574d1 100644 --- a/fuel-plugin/deployment_scripts/puppet/manifests/kvm-install.pp +++ b/fuel-plugin/deployment_scripts/puppet/manifests/kvm-install.pp @@ -6,6 +6,14 @@ case $::operatingsystem { $kernel_kit = ["linux-headers-${version}", "linux-image-${version}"] $kernel_src = "/usr/src/linux-headers-${version}" $kernel_src_link = "/lib/modules/${version}/build" + + shellvar { 'GRUB_DEFAULT': + ensure => present, + target => '/etc/default/grub', + value => "Advanced options for Ubuntu>Ubuntu, with Linux ${version}", + quoted => 'double', + notify => Exec['update_grub'], + } } default: { fail("Unsupported operating system: ${::osfamily}/${::operatingsystem}") @@ -21,6 +29,11 @@ if $kvm_settings['use_kvm'] { $ensure_link = 'absent' } +exec { 'update_grub': + command => '/usr/sbin/update-grub', + refreshonly => true, +} + package { $kernel_kit: ensure => $ensure_pkg, before => File[$kernel_src_link], diff --git a/fuel-plugin/pre_build_hook b/fuel-plugin/pre_build_hook index a3c883283..7d9aa155f 100755 --- a/fuel-plugin/pre_build_hook +++ b/fuel-plugin/pre_build_hook @@ -4,6 +4,10 @@ set -eux BUILD_FOR=${BUILD_FOR:-ubuntu} DIR="$(dirname `readlink -f $0`)" +MODULES="${DIR}/deployment_scripts/puppet/modules" + +SHELLVAR_VERSION='2.2.1' +SHELLVAR_URL="https://github.com/hercules-team/augeasproviders_shellvar/archive/${SHELLVAR_VERSION}.tar.gz" function build_pkg { case $1 in @@ -25,3 +29,7 @@ for system in $BUILD_FOR do build_pkg $system done + +rm -rf ${MODULES}/shellvar +mkdir -p ${MODULES}/shellvar +wget -qO- ${SHELLVAR_URL} | tar -C ${MODULES}/shellvar --strip-components=1 -zxvf - -- cgit 1.2.3-korg