[lxc-devel] [lxc/master] tools: fix lxc-upate-config

brauner on Github lxc-bot at linuxcontainers.org
Wed Sep 6 10:34:30 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 480 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170906/c12f2535/attachment.bin>
-------------- next part --------------
From b410f03308f46a0a2bd53bb6411f8791e09997e3 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Wed, 6 Sep 2017 12:33:19 +0200
Subject: [PATCH] tools: fix lxc-upate-config

- replace lxc.network.[i].ipv4 with lxc.net.[i].ipv4.address
- remove lxc.rootfs.backend lines

Closes #1790.

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 src/lxc/tools/lxc-update-config.in | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/lxc/tools/lxc-update-config.in b/src/lxc/tools/lxc-update-config.in
index 3a9defd11..b36927389 100644
--- a/src/lxc/tools/lxc-update-config.in
+++ b/src/lxc/tools/lxc-update-config.in
@@ -63,8 +63,10 @@ sed -i \
 -e 's/\([[:blank:]*]\|#*\)\(lxc\.init_uid\)\([[:blank:]*]\|=\)/\1lxc\.init\.uid\3/g' \
 -e 's/\([[:blank:]*]\|#*\)\(lxc\.init_gid\)\([[:blank:]*]\|=\)/\1lxc\.init\.gid\3/g' \
 -e 's/\([[:blank:]*]\|#*\)\(lxc\.limit\)\([[:blank:]*]\|=\)/\1lxc\.prlimit\3/g' \
+-e 's/\([[:blank:]*]\|#*\)\(lxc\.network\)\(\.[[:digit:]*]\)\(\.ipv4\)/\1lxc\.net\3\4\.address/g' \
 -e 's/\([[:blank:]*]\|#*\)\(lxc\.network\)\(\.[[:digit:]*]\)/\1lxc\.net\3/g' \
 -e 's/\([[:blank:]*]\|#*\)\(lxc\.network\)\([[:blank:]*]\|=\)/\1lxc\.net\3/g' \
+-e '/\([[:blank:]*]\|#*\)\(lxc\.rootfs\.backend\)\([[:blank:]*]\|=\)/d' \
 	"${CONFIGPATH}"
 
 # Finally, deal with network definitions of the following form:
@@ -84,6 +86,7 @@ set +e
 TMPFILE=$(mktemp -p "${PWD}" XXXXXXXXXX)
 cp "${CONFIGPATH}" "${TMPFILE}"
 
+ROOTFS_BACKEND=""
 LINE_NUM=0
 IDX=-1
 while read -r LINE; do


More information about the lxc-devel mailing list