fuel-agent/fuel_agent/objects/bootloader.py
Denis Egorenko aadfde20ca Fedora kernel install in ibp mode
Nailgun puts 'kernel_lt' flag in provisioning data and
if this flag is set, it is supposed that we need to install
kernel-lt package which is fedora kernel 3.10.
We assume both kernels are available in centos OS image:
2.6 and 3.10. We can just configure grub to boot with
one of those kernels. If flag 'kernel_lt' is NOT set, we
use 'vmlinuz-2.6' regexp for looking up for kernel file.
Otherwise we use default regexp 'vmlinuz' and sort available
kernels in backward direction, i.e. we use the newest available
kernel.

Co-Authored-By: Vladimir Kozhukalov <vkozhukalov@mirantis.com>
Change-Id: I1f7eee934440ce32d6e733c417e82f578b6d0c18
Partially-closes-bug: #1398643
2015-04-30 15:58:43 +03:00

30 lines
1.1 KiB
Python

# Copyright 2014 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
class Grub(object):
def __init__(self, version=None, kernel_params='',
kernel_name=None, kernel_regexp=None,
initrd_name=None, initrd_regexp=None):
self.version = version
self.kernel_params = kernel_params
self.kernel_name = kernel_name
self.initrd_name = initrd_name
self.kernel_regexp = kernel_regexp
self.initrd_regexp = initrd_regexp
def append_kernel_params(self, *kernel_params):
for kp in kernel_params:
self.kernel_params = '{0} {1}'.format(self.kernel_params, kp)