Add a script to build and install FreeBSD.

This commit is contained in:
Tom Alexander 2024-06-22 22:35:31 -04:00
parent 7861102ef9
commit f23af58936
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
1 changed files with 29 additions and 0 deletions

29
build_and_install.bash Executable file
View File

@ -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 "${@}"