[lxc-devel] [PATCH] lxc-debian: Add hwaddr handling logic
Serge Hallyn
serge.hallyn at ubuntu.com
Thu Oct 24 00:20:46 UTC 2013
Quoting Stéphane Graber (stgraber at ubuntu.com):
> Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>
> ---
> templates/lxc-debian.in | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/templates/lxc-debian.in b/templates/lxc-debian.in
> index 4dd4910..645fe8d 100644
> --- a/templates/lxc-debian.in
> +++ b/templates/lxc-debian.in
> @@ -207,6 +207,13 @@ copy_configuration()
> hostname=$3
> arch=$4
>
> + # if there is exactly one veth network entry, make sure it has an
> + # associated hwaddr.
> + nics=`grep -e '^lxc\.network\.type[ \t]*=[ \t]*veth' $path/config | wc -l`
> + if [ $nics -eq 1 ]; then
> + grep -q "^lxc.network.hwaddr" $path/config || sed -i -e "/^lxc\.network\.type[ \t]*=[ \t]*veth/a lxc.network.hwaddr = 00:16:3e:$(openssl rand -hex 3| sed 's/\(..\)/\1:/g; s/.$//')" $path/config
> + fi
> +
> grep -q "^lxc.rootfs" $path/config 2>/dev/null || echo "lxc.rootfs = $rootfs" >> $path/config
> cat <<EOF >> $path/config
> lxc.tty = 4
> --
> 1.8.3.2
>
>
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel
More information about the lxc-devel
mailing list