For discussion of Alpine Linux development and developer support

6 3

[alpine-devel] [PATCH abuild] buildlab fixes

Eivind Uggedal
Details
Message ID
<20190506214747.26486-1-eu@eju.no>
Sender timestamp
1557179263
DKIM signature
missing
Download raw message
Last time I worked on Alpine (4 years ago) I used LXC for building/testing
against given release versions or edge. Seems LXC has deprecated all
the things that made it great, so I came over the buildlab script
in the abuild repo and thought it would be a simple solution for my
needs.

A few minutes later I had a non-working empty chroot directory without a
rootfs due to missing signing keys. To my amasement all
my important virtual filesystems on the host had been umounted as
well...

This series of patches makes buildlab (barely) work for building packages
against edge from a 3.9 host without hosing your system.

Maybe the script should be dropped altogether if noone has used it. If
not, I might send future patches to improve the workflow somewhat
and fix the non-working cache copying/setup.



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Chloe Kudryavtsev
Details
Message ID
<46948120-9fb6-28d1-b504-bad6f77bdcd8@toastin.space>
In-Reply-To
<20190506214747.26486-1-eu@eju.no> (view parent)
Sender timestamp
1557181573
DKIM signature
missing
Download raw message
On 5/6/19 5:47 PM, Eivind Uggedal wrote:
> Last time I worked on Alpine (4 years ago) I used LXC for building/testing
> against given release versions or edge. Seems LXC has deprecated all
> the things that made it great, so I came over the buildlab script
> in the abuild repo and thought it would be a simple solution for my
> needs.
> 
> A few minutes later I had a non-working empty chroot directory without a
> rootfs due to missing signing keys. To my amasement all
> my important virtual filesystems on the host had been umounted as
> well...
> 
> This series of patches makes buildlab (barely) work for building packages
> against edge from a 3.9 host without hosing your system.
> 
> Maybe the script should be dropped altogether if noone has used it. If
> not, I might send future patches to improve the workflow somewhat
> and fix the non-working cache copying/setup.

Looks good to me on first glance.
I'll try and take some time to test if it works on my edge-based builder 
sometime this week.
You might need to wait some time for adoption, since 3.10 is coming up 
and everyone is busy with that.

That said, it would be very nice if you got chroot-based builds working 
well :)


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---

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

Eivind Uggedal
Details
Message ID
<20190506214747.26486-2-eu@eju.no>
In-Reply-To
<20190506214747.26486-1-eu@eju.no> (view parent)
Sender timestamp
1557179264
DKIM signature
missing
Download raw message
Patch: +1 -1
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
@@ -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:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---

[alpine-devel] [PATCH abuild 2/4] buildlab: copy host signing keys

Eivind Uggedal
Details
Message ID
<20190506214747.26486-3-eu@eju.no>
In-Reply-To
<20190506214747.26486-1-eu@eju.no> (view parent)
Sender timestamp
1557179265
DKIM signature
missing
Download raw message
Patch: +3 -1
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
@@ -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/alpine-devel@lists.alpinelinux.org-*.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



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---

[alpine-devel] [PATCH abuild 3/4] buildlab: add community repo

Eivind Uggedal
Details
Message ID
<20190506214747.26486-4-eu@eju.no>
In-Reply-To
<20190506214747.26486-1-eu@eju.no> (view parent)
Sender timestamp
1557179266
DKIM signature
missing
Download raw message
Patch: +1 -0
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
@@ -123,6 +123,7 @@ prepare_chroot() {
 	cp /etc/apk/keys/alpine-devel@lists.alpinelinux.org-*.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



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---

[alpine-devel] [PATCH abuild 4/4] buildlab: proper permissions for chroot/tmo

Eivind Uggedal
Details
Message ID
<20190506214747.26486-5-eu@eju.no>
In-Reply-To
<20190506214747.26486-1-eu@eju.no> (view parent)
Sender timestamp
1557179267
DKIM signature
missing
Download raw message
Patch: +1 -0
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
@@ -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



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Natanael Copa
Details
Message ID
<20190605220025.116bedba@ncopa-desktop.copa.dup.pw>
In-Reply-To
<20190506214747.26486-1-eu@eju.no> (view parent)
Sender timestamp
1559764825
DKIM signature
missing
Download raw message
On Mon,  6 May 2019 21:47:43 +0000
Eivind Uggedal <eu@eju.no> wrote:

> Last time I worked on Alpine (4 years ago) I used LXC for building/testing
> against given release versions or edge. Seems LXC has deprecated all
> the things that made it great, so I came over the buildlab script
> in the abuild repo and thought it would be a simple solution for my
> needs.

Have you seen abuild-rootbld?

It will set up a lightweight container using bubblewrap and do the
build in there.

  apk add abuild-rootbld
  abuild rootbld

It will also work if you check out 3.*-stable.

-nc


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---