6a131c20d91c0db87373138a75c054ecced2de4a
[armband.git] / patches / opnfv-fuel / 0014-baremetal-linux-image-generic-hwe-16.04-edge.patch
1 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
2 : Copyright (c) 2017 Enea AB and others.
3 :
4 : All rights reserved. This program and the accompanying materials
5 : are made available under the terms of the Apache License, Version 2.0
6 : which accompanies this distribution, and is available at
7 : http://www.apache.org/licenses/LICENSE-2.0
8 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
9 From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
10 Date: Sun, 5 Nov 2017 21:02:17 +0100
11 Subject: [PATCH] baremetal: linux-image-generic-hwe-16.04-edge
12
13 The Salt way to pin the kernel version is via its reclass model, by
14 defining system.kernel.version. However, this only works with
15 explicit kernel package names and not with meta package names
16 (e.g. linux-image-4.13.0-9916-generic is expected instead of
17       linux-image-generic-hwe-16.04-edge, which would break the
18 `linux_kernel_old_absent` state).
19
20 For now, let's explicitly call `pkg.install` for the kernel and
21 headers packages, using the meta package name to ensure automatic
22 fallback to Ubuntu packages if Armband repos are missing,
23 respectively to automatically pick up new kernel package names
24 in case of meta + kernel packages bump later.
25
26 JIRA: ARMBAND-280
27
28 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
29 ---
30  mcp/config/states/virtual_control_plane | 5 ++++-
31  1 file changed, 4 insertions(+), 1 deletion(-)
32
33 diff --git a/mcp/config/states/virtual_control_plane b/mcp/config/states/virtual_control_plane
34 index 298a9de..f569ba2 100755
35 --- a/mcp/config/states/virtual_control_plane
36 +++ b/mcp/config/states/virtual_control_plane
37 @@ -39,9 +39,12 @@ salt -C 'kvm* or cmp*' file.replace $debian_ip_source \
38  salt -C 'kvm*' pkg.install bridge-utils
39  salt -C '*' state.apply opnfv.adduser
40  salt -C 'kvm*' state.apply linux.network
41 -salt -C 'cmp*' state.apply linux.system
42 +salt -C 'kvm* or cmp*' state.apply linux.system
43  salt -C 'cmp*' state.apply linux.network || true
44  salt -C 'kvm*' state.apply armband.salt_minion || true
45 +# NOTE(armband): Should be later moved to reclass as system.kernel.version
46 +salt -C 'kvm* or cmp*' pkg.install \
47 +  linux-image-generic-hwe-16.04-edge,linux-headers-generic-hwe-16.04-edge
48  salt -C 'kvm* or cmp*' system.reboot
49  wait_for 90 "! salt -C 'kvm* or cmp*' test.ping | " \
50    "tee /dev/stderr | grep -Fq 'Not connected'"