Skip to content

Instantly share code, notes, and snippets.

@DanielO
Created February 4, 2016 11:28
Show Gist options
  • Save DanielO/3f3006f735a1c05e4a6c to your computer and use it in GitHub Desktop.
Save DanielO/3f3006f735a1c05e4a6c to your computer and use it in GitHub Desktop.
sudo pkg install isc-dhcp43-server atftp
sudo sh -c 'cat >/usr/local/etc/dhcpd.conf' <<EOF
default-lease-time 600;
max-lease-time 7200;
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;
subnet 10.0.2.0 netmask 255.255.255.0 {
}
subnet 172.16.10.0 netmask 255.255.255.0 {
range 172.16.10.20 172.16.10.50;
filename "/boot/pxeboot";
next-server 172.16.10.1;
option root-path "172.16.10.1:/src/onefs/crash";
}
EOF
sudo sh -c 'cat >/etc/rc.conf' <<EOF
ifconfig_em1="172.16.10.1/24"
dhcpd_enable="YES"
dhcpd_ifaces="em1"
atftpd_enable="YES"
atftpd_flags="--daemon --verbose=5 --pidfile /var/run/atftpd.pid --logfile /var/log/atftpd.log --bind-address=172.16.10.1 /src/onefs/crash"
nfs_server_enable="YES"
EOF
sudo sh -c 'cat >>/etc/exports' <<EOF
/src -alldirs -maproot=0:0 -network 172.16.10.1 -mask 255.255.255.0
EOF
sudo mkdir /craash
sudo cp -pRP /boot /crash
cd /usr/src
make -j 8 buildkernel KERNFAST=1
make installkernel DESTDIR=/crash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment