~comcloudway/builds.sr.ht

8e60d987a9181f997fd51dbed4d442bf4a5ca67e — emersion 5 years ago 103a533
images/freebsd: fix current

freebsd-update doesn't work on CURRENT.

Additionally, this also makes freebsd-update display its info and
error messages. PAGER is disabled because we don't want to see a
list of files affected by the upgrade.
M images/freebsd/11.x/genimg => images/freebsd/11.x/genimg +1 -0
@@ 1,5 1,6 @@
#!/bin/sh
arch="${1:-amd64}"
export release="11.2-RELEASE"
export dist_base="https://download.freebsd.org/ftp/releases/$arch/$release"
export ports_base="https://download.freebsd.org/ftp/snapshots/$arch/11.2-STABLE"
exec ../genimg "$@"

M images/freebsd/12.x/genimg => images/freebsd/12.x/genimg +1 -0
@@ 1,5 1,6 @@
#!/bin/sh
arch="${1:-amd64}"
export release="12.0-RELEASE"
export dist_base="https://download.freebsd.org/ftp/releases/$arch/$release"
export ports_base="https://download.freebsd.org/ftp/snapshots/$arch/12.0-STABLE"
exec ../genimg "$@"

M images/freebsd/current/genimg => images/freebsd/current/genimg +2 -1
@@ 1,5 1,6 @@
#!/bin/sh
arch="${1:-amd64}"
export release="13.0-CURRENT"
export ports_base="https://download.freebsd.org/ftp/snapshots/$arch/$release"
export dist_base="https://download.freebsd.org/ftp/snapshots/$arch/$release"
export ports_base="$dist_base"
exec ../genimg "$@"

M images/freebsd/genimg => images/freebsd/genimg +10 -6
@@ 1,10 1,10 @@
#!/bin/sh -eux

echo "$release" >/dev/null # fail on -u if unset
echo "$dist_base" >/dev/null # fail on -u if unset
echo "$ports_base" >/dev/null # fail on -u if unset
arch="${1:-amd64}"

dist_base="https://download.freebsd.org/ftp/releases/$arch/$release"
dist_files="kernel.txz base.txz"
dist_dir="/usr/freebsd-dist/$arch/$release"



@@ 67,11 67,15 @@ FreeBSD: {
}
EOF

/usr/sbin/freebsd-update -b /mnt \
	--currently-running "$release" \
	--not-running-from-cron \
	fetch install \
	>/dev/null
# freebsd-update is only supported for RELEASE
if [ "${release%-RELEASE}" != "$release" ]
then
	env PAGER=true /usr/sbin/freebsd-update \
		-b /mnt \
		--currently-running "$release" \
		--not-running-from-cron -F \
		fetch install
fi

env ASSUME_ALWAYS_YES=YES pkg -c /mnt bootstrap -f
# TODO: remove bash