[lxc-devel] [distrobuilder/master] Chroot fixes

monstermunchkin on Github lxc-bot at linuxcontainers.org
Fri Aug 16 18:39:14 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 310 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190816/c3c8aeb1/attachment.bin>
-------------- next part --------------
From d82fe7ac53793f3bf438973a4aaacfddcec2c063 Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.hipp at canonical.com>
Date: Fri, 16 Aug 2019 20:30:57 +0200
Subject: [PATCH 1/2] sources: Exit chroot properly in Alpine

Signed-off-by: Thomas Hipp <thomas.hipp at canonical.com>
---
 sources/alpine-http.go | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sources/alpine-http.go b/sources/alpine-http.go
index 3b4055e..71ea61a 100644
--- a/sources/alpine-http.go
+++ b/sources/alpine-http.go
@@ -105,11 +105,13 @@ func (s *AlpineLinuxHTTP) Run(definition shared.Definition, rootfsDir string) er
 
 		err = shared.RunCommand("sed", "-i", "-e", "s/v[[:digit:]]\\.[[:digit:]]/edge/g", "/etc/apk/repositories")
 		if err != nil {
+			exitChroot()
 			return err
 		}
 
 		err = shared.RunCommand("apk", "upgrade", "--update-cache", "--available")
 		if err != nil {
+			exitChroot()
 			return err
 		}
 

From 4af2b8fcc98d23406bab2a268c15ece3c8dd3d9f Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.hipp at canonical.com>
Date: Fri, 16 Aug 2019 20:37:15 +0200
Subject: [PATCH 2/2] sources: Exit chroot properly in Ubuntu

Signed-off-by: Thomas Hipp <thomas.hipp at canonical.com>
---
 sources/ubuntu-http.go | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sources/ubuntu-http.go b/sources/ubuntu-http.go
index 501a567..a4e172b 100644
--- a/sources/ubuntu-http.go
+++ b/sources/ubuntu-http.go
@@ -188,6 +188,7 @@ func (s *UbuntuHTTP) runCoreVariant(definition shared.Definition, rootfsDir stri
 	apt-get install -y busybox-static fuse util-linux squashfuse
 	`)
 	if err != nil {
+		exitChroot()
 		return err
 	}
 


More information about the lxc-devel mailing list