Add copyright header to patch files
[armband.git] / patches / opnfv-fuel / cross-bootstrap / 0005-mcagent-Increase-max-shell-command-timeout-to-2h.patch
1 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
2 : Copyright (c) 2017 Enea AB, Cavium 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: Thu, 9 Jun 2016 21:37:48 +0200
11 Subject: [PATCH] mcagent: Increase max shell command timeout to 2h
12
13 Since `execute_shell_command` mcagent is used for building the target
14 image and the timeout provided in the astute task is just respected on
15 the Astute level (on mcollective level this timeout is actually a
16 minumum between value provided and ddl value) we need to increase it
17 for Armband operation.
18
19 Because Armband builds the target image via `qemu-debootstrap`, it can
20 take more than 1 hour to finish the building. Therefore aside of
21 increasing the timeout in the Astute task, the maximum timeout value
22 for mcagent has to be increased.
23
24 [ Alexandru Avadanii ]
25 Repackaged, based on Stan's `fuel-astute` patch.
26
27 Signed-off-by: Stanislaw Kardach <stanislaw.kardach@cavium.com>
28 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
29 ---
30  .../f_bootstrap/post-scripts/80_prepare_cross_builds.sh    | 14 ++++++++++++++
31  1 file changed, 14 insertions(+)
32
33 diff --git a/build/f_isoroot/f_bootstrap/post-scripts/80_prepare_cross_builds.sh b/build/f_isoroot/f_bootstrap/post-scripts/80_prepare_cross_builds.sh
34 index 01eb2e2..12f66e6 100755
35 --- a/build/f_isoroot/f_bootstrap/post-scripts/80_prepare_cross_builds.sh
36 +++ b/build/f_isoroot/f_bootstrap/post-scripts/80_prepare_cross_builds.sh
37 @@ -26,6 +26,20 @@ if which dpkg > /dev/null 2>&1; then
38        echo "Error starting systemd-binfmt!"
39        exit 1
40      fi
41 +
42 +    # Cross-build timeout adjustments
43 +    #
44 +    # Since `execute_shell_command` mcagent is used for building the target
45 +    # image and the timeout provided in the astute task is just respected on
46 +    # the Astute level (on mcollective level this timeout is actually a
47 +    # minumum between value provided and ddl value) we need to increase it
48 +    # for cross-build operations.
49 +
50 +    # Building the target image via `qemu-debootstrap` can take more than
51 +    # 1 hour. Therefore aside of increasing the timeout in the Astute task,
52 +    # the maximum timeout value for mcagent has to be increased (use 2h).
53 +    sed -i.bak -r 's/^(\s+:timeout\s*=>)\s*[[:digit:]]+$/\1 7200/' \
54 +      /usr/libexec/mcollective/mcollective/agent/execute_shell_command.ddl
55    fi
56  fi
57