Skip to content

Instantly share code, notes, and snippets.

@ww898
Last active February 13, 2024 23:13
Show Gist options
  • Save ww898/b375d9ae2aa7edaca4ef584dc06c4454 to your computer and use it in GitHub Desktop.
Save ww898/b375d9ae2aa7edaca4ef584dc06c4454 to your computer and use it in GitHub Desktop.
Setup FreeBSD 14.0 x64
pkg update
pkg upgrade
pkg install --yes nano tmux htop mc git openjdk17 node
tee -a '/etc/fstab' <<EOF
fdesc /dev/fd fdescfs rw 0 0
proc /proc procfs rw 0 0
EOF
mount -t fdescfs fdesc /dev/fd
mount -t procfs proc /proc
cd
pw useradd builduser -m -s /usr/sbin/nologin
curl -fLO https://github.com/ChristopherHX/github-act-runner/releases/download/v0.6.7/binary-freebsd-amd64.tar.gz
mkdir /usr/local/github-runner
cd /usr/local/github-runner
tar xzvf ~/binary-freebsd-amd64.tar.gz
chown -R root:wheel .
cd /home/builduser
/usr/local/github-runner/github-act-runner configure
tee '/usr/local/etc/rc.d/github-runner' <<EOF
#!/bin/sh
# PROVIDE: github_runner
# REQUIRE: LOGIN DAEMON NETWORKING
# KEYWORD: shutdown
. /etc/rc.subr
name="github_runner"
rcvar="github_runner_enable"
load_rc_config github_runner
pidfile="/var/run/github_runner.pid"
github_runner_chdir=/home/builduser
command="/usr/sbin/daemon"
command_args="-u builduser -P \${pidfile} -r -o /var/log/github_runner.log /usr/local/github-runner/github-act-runner run"
run_rc_command "\$1"
EOF
chmod +x /usr/local/etc/rc.d/github-runner
echo "github_runner_enable=\"YES\"" | tee -a /etc/rc.conf
/usr/local/etc/rc.d/github-runner start
# Install .NET
pkg install --yes libunwind icu libinotify krb5 terminfo-db openssl111
cd
curl -fLO https://github.com/sec/dotnet-core-freebsd-source-build/releases/download/7.0.403-x64-native/dotnet-sdk-7.0.403-freebsd-x64.tar.gz
curl -fLO https://github.com/sec/dotnet-core-freebsd-source-build/releases/download/8.0.101-x64-native/dotnet-sdk-8.0.101-freebsd-x64.tar.gz
mkdir /usr/local/dotnet
cd /usr/local/dotnet
tar xzf ~/dotnet-sdk-7.0.403-freebsd-x64.tar.gz
tar xzf ~/dotnet-sdk-8.0.101-freebsd-x64.tar.gz
chown -R root:wheel .
ln -s /usr/local/dotnet/dotnet /usr/local/bin/dotnet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment