~sircmpwn/sr.ht-dev

builds.sr.ht: OpenBSD -current support and syspatch enablement v1 PROPOSED

~oranenj
This patchset adds openbsd/current, and also includes a minor patch that
runs syspatch by default on stable builds so that they get the latest
patches.

I ran builds for the 6.8 and current using the existing 6.8
image:
https://builds.sr.ht/~oranenj/job/433429
https://builds.sr.ht/~oranenj/job/433430

At this point -current
doesn't seem to require running the build in bootstrap mode

Jarkko Oranen (3):
  Use short version based on $openbsd_version instead of hardcoding set
    filenames
  OpenBSD:current
  openbsd: run syspatch on amd64 by default

 images/openbsd/6.7/genimg        |  3 +--
 images/openbsd/6.8/genimg        |  3 +--
 images/openbsd/current/functions |  1 +
 images/openbsd/current/genimg    |  8 +++++++
 images/openbsd/genimg            | 37 ++++++++++++++++++++++++++------
 5 files changed, 41 insertions(+), 11 deletions(-)
 create mode 120000 images/openbsd/current/functions
 create mode 100755 images/openbsd/current/genimg

-- 
2.30.1
#433483 alpine.yml success
#433484 archlinux.yml success
#433485 debian.yml success
Why is this desirable? As far as I can tell, it introduces some hacks
which we cannot expect to be reliable.


Ah, one more small thing: maybe the commit message can be improved a bit.
Maybe something like "openbsd: add current"?
builds.sr.ht
builds.sr.ht/patches: SUCCESS in 3m21s

[OpenBSD -current support and syspatch enablement][0] from [~oranenj][1]

[0]: https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/20402
[1]: mailto:oranenj@iki.fi

✓ #433483 SUCCESS builds.sr.ht/patches/alpine.yml    https://builds.sr.ht/~sircmpwn/job/433483
✓ #433484 SUCCESS builds.sr.ht/patches/archlinux.yml https://builds.sr.ht/~sircmpwn/job/433484
✓ #433485 SUCCESS builds.sr.ht/patches/debian.yml    https://builds.sr.ht/~sircmpwn/job/433485
What is syspatch for? I'm not familiar with OpenBSD.


Is there a reason why this is not enabled on all architectures? Is it
only available on amd64?
I'd rather not add releases which are not well-supported for downstream
use by the upstream distributor - in this case, it doesn't seem like
OpenBSD current is very conducive to downstream use. Am I wrong? FreeBSD
current causes us a lot of headaches.

Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/20402/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH builds.sr.ht 1/3] Use short version based on $openbsd_version instead of hardcoding set filenames Export this patch

~oranenj
From: Jarkko Oranen <oranen@iki.fi>

This is in preparation for -current support
---
 images/openbsd/6.7/genimg |  3 +--
 images/openbsd/6.8/genimg |  3 +--
 images/openbsd/genimg     | 30 ++++++++++++++++++++++++------
 3 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/images/openbsd/6.7/genimg b/images/openbsd/6.7/genimg
index cf67d6e..51eec5a 100755
--- a/images/openbsd/6.7/genimg
+++ b/images/openbsd/6.7/genimg
@@ -2,8 +2,7 @@
export arch="${1:-amd64}"
export openbsd_version="6.7"
# QEMU requires xbase
export openbsd_sets="base67.tgz comp67.tgz xbase67.tgz xshare67.tgz"
export openbsd_sets="base comp xbase xshare"
export openbsd_kernel="bsd.mp"
export openbsd_installurl="https://cdn.openbsd.org/pub/OpenBSD"
export openbsd_public_key="openbsd-67-base.pub"
exec ../genimg "$@"
diff --git a/images/openbsd/6.8/genimg b/images/openbsd/6.8/genimg
index c381d54..d6b7281 100755
--- a/images/openbsd/6.8/genimg
+++ b/images/openbsd/6.8/genimg
@@ -2,8 +2,7 @@
export arch="${1:-amd64}"
export openbsd_version="6.8"
# QEMU requires xbase
export openbsd_sets="base68.tgz comp68.tgz xbase68.tgz xshare68.tgz"
export openbsd_sets="base comp xbase xshare"
export openbsd_kernel="bsd.mp"
export openbsd_installurl="https://cdn.openbsd.org/pub/OpenBSD"
export openbsd_public_key="openbsd-68-base.pub"
exec ../genimg "$@"
diff --git a/images/openbsd/genimg b/images/openbsd/genimg
index 3e02ff0..0e7d83a 100755
--- a/images/openbsd/genimg
+++ b/images/openbsd/genimg
@@ -3,17 +3,29 @@
: "$openbsd_sets"
: "$openbsd_kernel"
: "$openbsd_installurl"
: "$openbsd_public_key"

image_size="16g"
run_syspatch="${run_syspatch:-NO}"
image_packages="bash git"
snapshot="${snapshot:-NO}"
pkg_add_params=""
snapshot="NO"

if [ "$openbsd_version" = "current" ]; then
	snapshot="YES"
fi

if [ "$snapshot" = "YES" ]; then
	# hackish, but should work
	short_version="$(ftp -Vo- "$openbsd_installurl/snapshots/${arch}/index.txt" | grep -Eo 'install[0-9]+.img' | grep -Eo '[0-9]+')"
else
	short_version="$(echo $openbsd_version | tr -d .)"
fi

openbsd_public_key="openbsd-${short_version}-base.pub"

openbsd_bootstrap="${openbsd_bootstrap:-NO}"
# Force bootstrap mode when cross-building, unless we're building snapshots
if [ "$(uname -r)" != "$openbsd_version" ] && [ "$snapshot" = "NO" ]; then
if [ "$(uname -r)" != "$openbsd_version" ] && [ "$snapshot" != "YES" ]; then
  openbsd_bootstrap=YES
fi

@@ -40,13 +52,19 @@ cd_workdir() {
}

cd_workdir
for f in $openbsd_sets $openbsd_kernel SHA256.sig SHA256

set_files=""
for s in $openbsd_sets; do
	set_files="$set_files ${s}${short_version}.tgz"
done

for f in $set_files $openbsd_kernel SHA256.sig SHA256
do
	test -f "$f" || ftp "${openbsd_installurl}/${mirror_dir}/${arch}/${f}"
done

signify -Cp /etc/signify/"$openbsd_public_key" \
	-x SHA256.sig $openbsd_sets $openbsd_kernel
	-x SHA256.sig $set_files $openbsd_kernel

# Create image that will host the filesystem
rm -f root.img
@@ -59,7 +77,7 @@ EOF
disklabel -w -A -T /tmp/partitions vnd0

# prepare root filesystem under /mnt
for f in $openbsd_sets
for f in $set_files
do
	tar -zxphf "$f" -C /mnt
done
-- 
2.30.1
Why is this desirable? As far as I can tell, it introduces some hacks
which we cannot expect to be reliable.

[PATCH builds.sr.ht 2/3] OpenBSD:current Export this patch

~oranenj
From: Jarkko Oranen <oranen@iki.fi>

---
 images/openbsd/current/functions | 1 +
 images/openbsd/current/genimg    | 8 ++++++++
 2 files changed, 9 insertions(+)
 create mode 120000 images/openbsd/current/functions
 create mode 100755 images/openbsd/current/genimg

diff --git a/images/openbsd/current/functions b/images/openbsd/current/functions
new file mode 120000
index 0000000..c0b5bcc
--- /dev/null
+++ b/images/openbsd/current/functions
@@ -0,0 +1 @@
../functions
\ No newline at end of file
diff --git a/images/openbsd/current/genimg b/images/openbsd/current/genimg
new file mode 100755
index 0000000..3e52bd3
--- /dev/null
+++ b/images/openbsd/current/genimg
@@ -0,0 +1,8 @@
#!/bin/sh
export arch="${1:-amd64}"
export openbsd_version="current"
# QEMU requires xbase
export openbsd_sets="base comp xbase xshare"
export openbsd_kernel="bsd.mp"
export openbsd_installurl="https://cdn.openbsd.org/pub/OpenBSD"
exec ../genimg "$@"
-- 
2.30.1
Ah, one more small thing: maybe the commit message can be improved a bit.
Maybe something like "openbsd: add current"?

[PATCH builds.sr.ht 3/3] openbsd: run syspatch on amd64 by default Export this patch

~oranenj
From: Jarkko Oranen <oranen@iki.fi>

---
 images/openbsd/genimg | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/images/openbsd/genimg b/images/openbsd/genimg
index 0e7d83a..de7dcce 100755
--- a/images/openbsd/genimg
+++ b/images/openbsd/genimg
@@ -5,11 +5,16 @@
: "$openbsd_installurl"

image_size="16g"
run_syspatch="${run_syspatch:-NO}"
image_packages="bash git"
pkg_add_params=""
snapshot="NO"

if [ "$arch" = "amd64" ]; then
	run_syspatch="${run_syspatch:-YES}"
else
	run_syspatch="${run_syspatch:-NO}"
fi

if [ "$openbsd_version" = "current" ]; then
	snapshot="YES"
fi
-- 
2.30.1
builds.sr.ht
builds.sr.ht/patches: SUCCESS in 3m21s

[OpenBSD -current support and syspatch enablement][0] from [~oranenj][1]

[0]: https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/20402
[1]: mailto:oranenj@iki.fi

✓ #433483 SUCCESS builds.sr.ht/patches/alpine.yml    https://builds.sr.ht/~sircmpwn/job/433483
✓ #433484 SUCCESS builds.sr.ht/patches/archlinux.yml https://builds.sr.ht/~sircmpwn/job/433484
✓ #433485 SUCCESS builds.sr.ht/patches/debian.yml    https://builds.sr.ht/~sircmpwn/job/433485
What is syspatch for? I'm not familiar with OpenBSD.
Is there a reason why this is not enabled on all architectures? Is it
only available on amd64?