Subject: [alpine-devel] [PATCH abuild 1/4] buildlab: fix chroot umounting

From: Eivind Uggedal <[email-masked]>
Date: Mon, 6 May 2019 21:47:44 +0000

Before this change running buildlab would
umount your system's proper non bind mounted
/dev, /proc, and /sys!
---
 buildlab.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/buildlab.in b/buildlab.in
index b5129ff17270..e0d64d665380 100644
--- a/buildlab.in
+++ b/buildlab.in
@@ -100,7 +100,7 @@ do_chroot_action() {
 	chroot "$path" /bin/sh /.chroot-action.sh
 	rm "$path"/.chroot-action.sh
 
-	do_chroot_close
+	do_chroot_close "$path"
 }
 
 update_chroot() {
-- 
2.20.1

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Eivind Uggedal <[email-masked]>
Date: Mon, 6 May 2019 21:47:45 +0000

This change makes buildlab actually able to
install packages when a chroot is created.
---
 buildlab.in | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/buildlab.in b/buildlab.in
index e0d64d665380..073400851749 100644
--- a/buildlab.in
+++ b/buildlab.in
@@ -119,7 +119,9 @@ prepare_chroot() {
 
 	msg "Setting up repositories for mirror $mirror with version $version at $path..."
 
-	mkdir -p "$path"/etc/apk
+	mkdir -p "$path"/etc/apk/keys
+	cp /etc/apk/keys/[email-masked]*.pub \
+		"$path"/etc/apk/keys/
 	echo "http://$mirror/alpine/$version/main" >> "$path"/etc/apk/repositories
 	echo "http://$mirror/alpine/$version/testing" >> "$path"/etc/apk/repositories
 
-- 
2.20.1

---

---

From: Eivind Uggedal <[email-masked]>
Date: Mon, 6 May 2019 21:47:46 +0000

Let's party with buildlab like its 2015.
---
 buildlab.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/buildlab.in b/buildlab.in
index 073400851749..f06a68266a48 100644
--- a/buildlab.in
+++ b/buildlab.in
@@ -123,6 +123,7 @@ prepare_chroot() {
 	cp /etc/apk/keys/[email-masked]*.pub \
 		"$path"/etc/apk/keys/
 	echo "http://$mirror/alpine/$version/main" >> "$path"/etc/apk/repositories
+	echo "http://$mirror/alpine/$version/community" >> "$path"/etc/apk/repositories
 	echo "http://$mirror/alpine/$version/testing" >> "$path"/etc/apk/repositories
 
 	if [ ! -z "$enablecache" ]; then
-- 
2.20.1

---

---

From: Eivind Uggedal <[email-masked]>
Date: Mon, 6 May 2019 21:47:47 +0000

Without this the abuild user won't be able
to create tmp files (and not build anything).
---
 buildlab.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/buildlab.in b/buildlab.in
index f06a68266a48..b77d1becc5d7 100644
--- a/buildlab.in
+++ b/buildlab.in
@@ -136,6 +136,7 @@ prepare_chroot() {
 	mkdir -p "$path"/var/lock
 	mkdir -p "$path"/var/cache/apk
 	mkdir -p "$path"/tmp
+	chmod 1777 "$path"/tmp
 
 	mkdir -p "$path"/etc
 	cp /etc/resolv.conf "$path"/etc/resolv.conf
-- 
2.20.1

---