u/fuel: Bump & rebase for MaaS fabrics fix
[armband.git] / patches / opnfv-fuel / 0013-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 JIRA: ARMBAND-330
28
29 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
30 ---
31  mcp/config/states/virtual_control_plane | 12 +++++++++++-
32  1 file changed, 11 insertions(+), 1 deletion(-)
33
34 diff --git a/mcp/config/states/virtual_control_plane b/mcp/config/states/virtual_control_plane
35 index 298a9de..c07d342 100755
36 --- a/mcp/config/states/virtual_control_plane
37 +++ b/mcp/config/states/virtual_control_plane
38 @@ -39,9 +39,12 @@ salt -C 'kvm* or cmp*' file.replace $debian_ip_source \
39  salt -C 'kvm*' pkg.install bridge-utils
40  salt -C '*' state.apply opnfv.adduser
41  salt -C 'kvm*' state.apply linux.network
42 -salt -C 'cmp*' state.apply linux.system
43 +salt -C 'kvm* or cmp*' state.apply linux.system
44  salt -C 'cmp*' state.apply linux.network || true
45  salt -C 'kvm*' state.apply armband.salt_minion || true
46 +# NOTE(armband): Should be later moved to reclass as system.kernel.version
47 +salt -C 'kvm* or cmp*' pkg.install \
48 +  linux-image-generic-hwe-16.04-edge,linux-headers-generic-hwe-16.04-edge
49  salt -C 'kvm* or cmp*' system.reboot
50  wait_for 90 "! salt -C 'kvm* or cmp*' test.ping | " \
51    "tee /dev/stderr | grep -Fq 'Not connected'"
52 @@ -84,3 +87,10 @@ wait_for 10 "salt -C 'E@^(?!cfg01|mas01|kvm|cmp00).*' ssh.set_auth_key ${SUDO_US
53  # Disable proxy dhcp routes after installation
54  salt -C 'prx*' file.write /etc/dhcp/dhclient-enter-hooks.d/no-default-route \
55    args='unset new_routers'
56 +
57 +# NOTE(armband): Should be later moved to reclass as system.kernel.version
58 +salt -C 'E@^(?!cfg01|mas01|kvm|cmp00).*' pkg.install \
59 +  linux-image-generic-hwe-16.04-edge,linux-headers-generic-hwe-16.04-edge
60 +salt -C 'E@^(?!cfg01|mas01|kvm|cmp00).*' system.reboot
61 +wait_for 90 "! salt -C 'E@^(?!cfg01|mas01|kvm|cmp00).*' test.ping | " \
62 +  "tee /dev/stderr | grep -Fq 'Not connected'"