Skip to content
This repository was archived by the owner on May 6, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions freebsd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ install-box-amd64-virtualbox: freebsd-amd64-virtualbox.box
install-box-i386-virtualbox: freebsd-i386-virtualbox.box
vagrant box add -f --name mcandre/freebsd-i386 --provider virtualbox freebsd-i386-virtualbox.box

freebsd-amd64-virtualbox.box: freebsd-amd64.json http/p *.sh Vagrantfile
freebsd-amd64-virtualbox.box: freebsd-amd64.json http/p-amd64 *.sh Vagrantfile
PACKER_LOG=1 packer build -force -only virtualbox-iso freebsd-amd64.json

freebsd-i386-virtualbox.box: freebsd-i386.json http/p *.sh Vagrantfile
freebsd-i386-virtualbox.box: freebsd-i386.json http/p-i386 *.sh Vagrantfile
PACKER_LOG=1 packer build -force -only virtualbox-iso freebsd-i386.json

clean: clean-packer clean-boxes clean-vagrant clean-artifacts
Expand Down
2 changes: 1 addition & 1 deletion freebsd/freebsd-amd64.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"<enter><wait>",
"mdmfs -s 100m md1 /tmp<enter><wait>",
"dhclient -p /tmp/dhclient.pid -l /tmp/dhclient.lease em0<enter><wait5>",
"fetch -o /tmp/p http://{{ .HTTPIP }}:{{ .HTTPPort }}/p<enter><wait5>",
"fetch -o /tmp/p http://{{ .HTTPIP }}:{{ .HTTPPort }}/p-amd64<enter><wait5>",
"bsdinstall script /tmp/p<enter>",
"<wait10><wait10><wait10><wait10><wait10><wait10>",
"reboot<enter>"
Expand Down
2 changes: 1 addition & 1 deletion freebsd/freebsd-i386.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"<enter><wait>",
"mdmfs -s 100m md1 /tmp<enter><wait>",
"dhclient -p /tmp/dhclient.pid -l /tmp/dhclient.lease em0<enter><wait5>",
"fetch -o /tmp/p http://{{ .HTTPIP }}:{{ .HTTPPort }}/p<enter><wait5>",
"fetch -o /tmp/p http://{{ .HTTPIP }}:{{ .HTTPPort }}/p-i386<enter><wait5>",
"bsdinstall script /tmp/p<enter>",
"<wait10><wait10><wait10><wait10><wait10><wait10>",
"reboot<enter>"
Expand Down
File renamed without changes.
31 changes: 31 additions & 0 deletions freebsd/http/p-i386
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
DISTRIBUTIONS="kernel.txz base.txz"

for device in vtbd0 ada0 da0; do
if [ -e "/dev/${device}" ]; then
PARTITIONS="$device"
break
fi
done

#!/bin/sh

# Enable DHCP for default network adapter
echo 'nameserver 8.8.8.8' >/etc/resolv.conf &&
adapter="$(ifconfig -l | cut -d' ' -f1)" &&
sysrc "ifconfig_${adapter}"="dhcp"

# Configure NTP
ASSUME_ALWAYS_YES=yes pkg update &&
pkg install -y ntp &&
sysrc ntpd_enable="YES" &&
sysrc ntpdate_enable="YES"

# Configure vagrant user for sudo
pkg install -y sudo &&
echo 'vagrant' | pw useradd vagrant -h 0 -m &&
pw group mod wheel -m vagrant &&
echo 'Defaults:vagrant !requiretty' >>/usr/local/etc/sudoers &&
echo '%wheel ALL=(ALL) NOPASSWD: ALL' >>/usr/local/etc/sudoers

# Enable SSH server
sysrc sshd_enable="YES"