diff options
Diffstat (limited to 'recipes-containers/lxc/files/Generate-lxc-restore-net-properly.patch')
-rw-r--r-- | recipes-containers/lxc/files/Generate-lxc-restore-net-properly.patch | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/recipes-containers/lxc/files/Generate-lxc-restore-net-properly.patch b/recipes-containers/lxc/files/Generate-lxc-restore-net-properly.patch new file mode 100644 index 00000000..5adb730c --- /dev/null +++ b/recipes-containers/lxc/files/Generate-lxc-restore-net-properly.patch | |||
@@ -0,0 +1,121 @@ | |||
1 | From e08f3573b3561f1f0490624f7ca95b7ccd8157cb Mon Sep 17 00:00:00 2001 | ||
2 | Message-Id: <e08f3573b3561f1f0490624f7ca95b7ccd8157cb.1435177418.git.Jim.Somerville@windriver.com> | ||
3 | From: Jim Somerville <Jim.Somerville@windriver.com> | ||
4 | Date: Wed, 24 Jun 2015 16:16:38 -0400 | ||
5 | Subject: [PATCH 1/1] Generate lxc-restore-net properly | ||
6 | |||
7 | It's a script that should be run through the configure | ||
8 | mechanism the same as the others. We simply rename it | ||
9 | to have a .in extension and add it to configure.ac . | ||
10 | |||
11 | Also, by generating the script from a .in file, it gets | ||
12 | placed into the build directory. This plays nice with | ||
13 | build systems that keep the src separate from the build | ||
14 | directory. Without this change, the install step won't | ||
15 | find the lxc-restore-net script as it still just resides | ||
16 | in the src directory and not in the build directory. | ||
17 | |||
18 | Upstream-Status: Not applicable. This script has already | ||
19 | been rearchitected out of existence by | ||
20 | cba98d127bf490b018a016b792ae05fd2d29c5ee: | ||
21 | "c/r: use criu option instead of lxc-restore-net | ||
22 | |||
23 | As of criu 1.5, the --veth-pair argument supports an additional parameter that | ||
24 | is the bridge name to attach to. This enables us to get rid of the goofy | ||
25 | action-script hack that passed bridge names as environment variables. | ||
26 | |||
27 | This patch is on top of the systemd/lxcfs mount rework patch, as we probably | ||
28 | want to wait to use 1.5 options until it has been out for a while and is in | ||
29 | distros. | ||
30 | |||
31 | Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com> | ||
32 | Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>" | ||
33 | |||
34 | Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com> | ||
35 | --- | ||
36 | configure.ac | 1 + | ||
37 | src/lxc/lxc-restore-net | 26 -------------------------- | ||
38 | src/lxc/lxc-restore-net.in | 26 ++++++++++++++++++++++++++ | ||
39 | 3 files changed, 27 insertions(+), 26 deletions(-) | ||
40 | delete mode 100755 src/lxc/lxc-restore-net | ||
41 | create mode 100755 src/lxc/lxc-restore-net.in | ||
42 | |||
43 | diff --git a/configure.ac b/configure.ac | ||
44 | index 574b2cd..4972803 100644 | ||
45 | --- a/configure.ac | ||
46 | +++ b/configure.ac | ||
47 | @@ -768,6 +768,7 @@ AC_CONFIG_FILES([ | ||
48 | src/lxc/legacy/lxc-ls | ||
49 | src/lxc/lxc.functions | ||
50 | src/lxc/version.h | ||
51 | + src/lxc/lxc-restore-net | ||
52 | src/python-lxc/Makefile | ||
53 | src/python-lxc/setup.py | ||
54 | |||
55 | diff --git a/src/lxc/lxc-restore-net b/src/lxc/lxc-restore-net | ||
56 | deleted file mode 100755 | ||
57 | index 6ae3c19..0000000 | ||
58 | --- a/src/lxc/lxc-restore-net | ||
59 | +++ /dev/null | ||
60 | @@ -1,26 +0,0 @@ | ||
61 | -#!/bin/sh | ||
62 | - | ||
63 | -set -e | ||
64 | - | ||
65 | -i=0 | ||
66 | -while true; do | ||
67 | - eval "bridge=\$LXC_CRIU_BRIDGE$i" | ||
68 | - eval "veth=\$LXC_CRIU_VETH$i" | ||
69 | - | ||
70 | - if [ -z "$bridge" ] || [ -z "$veth" ]; then | ||
71 | - exit 0 | ||
72 | - fi | ||
73 | - | ||
74 | - if [ "$CRTOOLS_SCRIPT_ACTION" = "network-lock" ]; then | ||
75 | - brctl delif $bridge $veth | ||
76 | - fi | ||
77 | - | ||
78 | - if [ "$CRTOOLS_SCRIPT_ACTION" = "network-unlock" ]; then | ||
79 | - brctl addif $bridge $veth | ||
80 | - ip link set dev $veth up | ||
81 | - fi | ||
82 | - | ||
83 | - i=$((i+1)) | ||
84 | -done | ||
85 | - | ||
86 | -exit 1 | ||
87 | diff --git a/src/lxc/lxc-restore-net.in b/src/lxc/lxc-restore-net.in | ||
88 | new file mode 100755 | ||
89 | index 0000000..6ae3c19 | ||
90 | --- /dev/null | ||
91 | +++ b/src/lxc/lxc-restore-net.in | ||
92 | @@ -0,0 +1,26 @@ | ||
93 | +#!/bin/sh | ||
94 | + | ||
95 | +set -e | ||
96 | + | ||
97 | +i=0 | ||
98 | +while true; do | ||
99 | + eval "bridge=\$LXC_CRIU_BRIDGE$i" | ||
100 | + eval "veth=\$LXC_CRIU_VETH$i" | ||
101 | + | ||
102 | + if [ -z "$bridge" ] || [ -z "$veth" ]; then | ||
103 | + exit 0 | ||
104 | + fi | ||
105 | + | ||
106 | + if [ "$CRTOOLS_SCRIPT_ACTION" = "network-lock" ]; then | ||
107 | + brctl delif $bridge $veth | ||
108 | + fi | ||
109 | + | ||
110 | + if [ "$CRTOOLS_SCRIPT_ACTION" = "network-unlock" ]; then | ||
111 | + brctl addif $bridge $veth | ||
112 | + ip link set dev $veth up | ||
113 | + fi | ||
114 | + | ||
115 | + i=$((i+1)) | ||
116 | +done | ||
117 | + | ||
118 | +exit 1 | ||
119 | -- | ||
120 | 1.8.3.2 | ||
121 | |||