From f23af5893668fb63b6a1b52fca6fe896ed177ccb Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sat, 22 Jun 2024 22:35:31 -0400 Subject: [PATCH] Add a script to build and install FreeBSD. --- build_and_install.bash | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 build_and_install.bash diff --git a/build_and_install.bash b/build_and_install.bash new file mode 100755 index 00000000000..250fc51ba7c --- /dev/null +++ b/build_and_install.bash @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +# +# Build and install FreeBSD +set -euo pipefail +IFS=$'\n\t' +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +function main { + local existing_packages + cd /bridge/git/freebsd_amp_hwpstate + + doas git config --global --add safe.directory /bridge/git/freebsd_amp_hwpstate + + mymake buildworld buildkernel + mymake packages + + existing_packages=$(doas pkg info -g 'FreeBSD-*' | sed -E 's/\.snap.*//g') + while read p; do + echo /usr/obj/bridge/git/freebsd_amp_hwpstate/repo/FreeBSD:15:amd64/15.snap*/"$p".snap*.pkg + done <<<"$existing_packages" | xargs echo doas pkg install --yes +} + +function mymake { + # REPODIR=/tmp/repo + doas make SRCCONF=/bridge/git/machine_setup/ansible/roles/poudriere/files/currentznver4_src.conf __MAKE_CONF=/bridge/git/machine_setup/ansible/roles/poudriere/files/poudriere.d/currentznver4-default-framework-make.conf KERNCONF=GENERIC-NODEBUG -j "$(sysctl -n hw.ncpu)" "${@}" + +} + +main "${@}"