Starting a poudboot rc service for building when the poudriere vm launches.

This commit is contained in:
Tom Alexander 2022-12-10 18:42:02 -05:00
parent 60c4d66f1c
commit 9be646f943
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
4 changed files with 78 additions and 5 deletions

View File

@ -0,0 +1,23 @@
#!/bin/sh
# /usr/local/etc/rc.d/poudboot
#
# REQUIRE: FILESYSTEM kld
# PROVIDE: poudboot
# AFTER: netif
. /etc/rc.subr
name=poudboot
rcvar=${name}_enable
start_cmd="${name}_start"
stop_cmd="${name}_stop"
load_rc_config $name
poudboot_start() {
/usr/local/bin/poudboot start
}
poudboot_stop() {
/usr/local/bin/poudboot stop
}
run_rc_command "$1"

View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
#
# Run poudriere at system boot. Useful for virtual machines so launching the VM also kicks off a build.
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
COMMAND="$1"
shift 1
if [ "$COMMAND" = "start" ]; then
echo "foo"
elif [ "$COMMAND" = "stop" ]; then
echo "bar"
else
echo "baz"
fi

View File

@ -0,0 +1,17 @@
# Disable CPUTYPE optimizations when compiling gcc48 because tigerlake is not included in gcc4.8
#
# Disable CPUTYPE optimizations when compiling ripgrep because the build is failing https://github.com/BurntSushi/ripgrep/issues/1721
#
# Disable CPUTYPE optimizations for firefox due to failing build.
#
# Example from bottom of /usr/share/examples/etc/make.conf
.if ${.CURDIR:N*/lang/gcc48*} && ${.CURDIR:N*/lang/gcc10*} && ${.CURDIR:N*/textproc/ripgrep*} && ${.CURDIR:N*/www/firefox*}
# Disabling tigerlake optimizations because qemu's TCG does not support avx512
#
#CPUTYPE?=tigerlake
CPUTYPE?=x86-64-v3
.endif
OPTIMIZED_CFLAGS=YES
BUILD_OPTIMIZED=YES
WITH_CPUFLAGS=YES
BUILD_STATIC=YES

View File

@ -66,17 +66,33 @@
# - src: poudriere.d # - src: poudriere.d
# dest: /usr/local/etc/ # dest: /usr/local/etc/
- name: Install scripts
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0755
owner: root
group: wheel
loop:
- src: poudboot.bash
dest: /usr/local/bin/poudboot
- name: Get ports tree list - name: Get ports tree list
command: poudriere ports -ln command: poudriere ports -ln
register: ports_tree_list register: ports_tree_list
changed_when: false changed_when: false
check_mode: no check_mode: no
# - name: Fetch a ports tree
# command: poudriere ports -c
# args:
# creates: /usr/local/poudriere/ports/default
- name: Configure the ports tree - name: Configure the ports tree
command: poudriere ports -c -m null -M /usr/local/portshaker/trees/main -p default command: poudriere ports -c -m null -M /usr/local/portshaker/trees/main -p default
when: '"default" not in ports_tree_list.stdout_lines' when: '"default" not in ports_tree_list.stdout_lines'
- name: Install rc script
copy:
src: "files/{{ item.src }}"
dest: "/usr/local/etc/rc.d/{{ item.dest|default(item.src) }}"
owner: root
group: wheel
mode: 0755
loop:
- src: poudboot