diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2013-10-24 13:39:19 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2013-10-24 13:46:42 +0200 |
commit | c2c01c0d47d32e99583273d3cb2df0a7253358e9 (patch) | |
tree | 1e11307acec01c1aa9649020d9925d320888323e /main/lxc/0001-lxc-alpine-add-hwaddr-for-a-single-macvlan-interface.patch | |
parent | 98a0ca23f55dd89aa8c59e212d61ce131a320d12 (diff) | |
download | aports-c2c01c0d47d32e99583273d3cb2df0a7253358e9.tar.bz2 aports-c2c01c0d47d32e99583273d3cb2df0a7253358e9.tar.xz |
main/lxc: add various fixes for alpine template and improve init.d messages
ref #2293
Diffstat (limited to 'main/lxc/0001-lxc-alpine-add-hwaddr-for-a-single-macvlan-interface.patch')
-rw-r--r-- | main/lxc/0001-lxc-alpine-add-hwaddr-for-a-single-macvlan-interface.patch | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/main/lxc/0001-lxc-alpine-add-hwaddr-for-a-single-macvlan-interface.patch b/main/lxc/0001-lxc-alpine-add-hwaddr-for-a-single-macvlan-interface.patch new file mode 100644 index 0000000000..432c86c341 --- /dev/null +++ b/main/lxc/0001-lxc-alpine-add-hwaddr-for-a-single-macvlan-interface.patch @@ -0,0 +1,36 @@ +From 75b5535282453b3442a41df4a3ba6d3058cd6e48 Mon Sep 17 00:00:00 2001 +From: Natanael Copa <ncopa@alpinelinux.org> +Date: Wed, 4 Sep 2013 17:01:09 +0200 +Subject: [PATCH] lxc-alpine: add hwaddr for a single macvlan interface + +We already add harware address for a single veth interface. Do the same +with a single macvlan interface. + +Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> +Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com> +--- + templates/lxc-alpine.in | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/templates/lxc-alpine.in b/templates/lxc-alpine.in +index 2ab10bb..05aec74 100644 +--- a/templates/lxc-alpine.in ++++ b/templates/lxc-alpine.in +@@ -173,9 +173,11 @@ lxc.network.flags = up + EOF + fi + +- # if there is exactly one veth network entry, make sure it has an +- # associated mac address. +- nics=$(grep -e '^lxc\.network\.type[ \t]*=[ \t]*veth' $path/config | wc -l) ++ # if there is exactly one veth or macvlan network entry, make sure ++ # it has an associated mac address. ++ nics=$(awk -F '[ \t]*=[ \t]*' \ ++ '$1=="lxc.network.type" && ($2=="veth" || $2=="macvlan") {print $2}' \ ++ $path/config | wc -l) + if [ "$nics" -eq 1 ] && ! grep -q "^lxc.network.hwaddr" $path/config; then + # see http://sourceforge.net/tracker/?func=detail&aid=3411497&group_id=163076&atid=826303 + hwaddr="fe:$(dd if=/dev/urandom bs=8 count=1 2>/dev/null |od -t x8 | \ +-- +1.8.4.1 + |