wiki:FreeBSD10_Guide

Version 26 (modified by huub, 10 years ago) ( diff )

--

Nodefactory based on FreeBSD-10


Scope

  • based on FreeBSD-10.1 (until release use 10-STABLE
  • ubound replaces bind
  • implement latest version of lvrouted (auto update default route)
  • update captive portal
  • cleanup packages
  • possibly replace thttpd (light version of apache?)

A. Setup a FreeBSD host


Warning: 1) Make sure /usr is at least 5GB in size, as building images requires quite some space. 2) Make sure you install the 32bit i386 release of FreeBSD also when your system does support amd64, as cross compiling can give some nasty surprises. Tip: use a separate hard disk, mounted on /usr/obj to speed up the compilation process.


Get yourself a fresh i386 freebsd host with ports and subversion installed as follows:

A.1. Run the basic CD installer

The procedure below has been tested with 10.0 (standard developer install - no ports -, e.g. with default partitioning will fit our needs). Installing FreeBSD is outside the scope of this document, take a look into ​the FreeBSD handbook Chapter 2 Installing FreeBSD if you do not know the details.

After installation and reboot apply update:

build# freebsd-update fetch
build# freebsd-update install
build# reboot

Please do mind that all commands below need to be executed as root, because of the many mounts and unmounts done in various phases. It maybe convenient to permit ssh root login (modify /etc/ssh/sshd_config accordingly).

Internet connection is required.

Set correct date/time, e.g: build# ntpdate 0.nl.pool.ntp.org

(You may also wish to add ntpd_enable="YES" to /etc/rc.conf)

A.2 Install Subversion and Ports

Subversion is installed as a package:

build# pkg install subversion

Tip: The package management tool is not yet installed on your system. So answer yes to the prompt: "Do you want to fetch and install it now? [y/N]:"

Check out a copy of the ports tree (this will take a couple of minutes).

build# svn checkout https://svn0.eu.FreeBSD.org/ports/head /usr/ports

Certificate information ...... answer p to prompt: (R)eject, accept (t)emporarily or accept (p)ermanently?

A.3 set some useful variables

Alter the shell configuration file:/root/.cshrc:

Ensure ftp is set to passive mode, to avoid potential firewall issues:
build# echo 'setenv FTP_PASSIVE_MODE YES' >> /root/.cshrc

Set a default password for the images that you will produce
build# echo 'setenv CFG_ROOT_PASSWORD DefaultPassword12!' >> /root/.cshrc
 
Define your nanobsd (svn) working directory:
NOTE: All commands at later stages will refer to this so you better get it right!
build# echo 'setenv R /root/nanobsd' >> /root/.cshrc

Next load your file (or login again): build# source /root/.cshrc

A.4. install ocaml

Warning: to be sorted out! To compile lvrouted you need ocaml support, without X11, without TOOLBOX:

build# make -C /usr/ports/devel/ocaml-findlib install clean WITHOUT="TOOLBOX X11 TK" BATCH=YES build# make -C /usr/ports/dns/bind-tools/ install clean BATCH=yes #(required for nagios-plugins in FreeBSD10)

A.5. OPTIONAL, every developer has his own preferences, these are mine

build# make -C /usr/ports/editors/vim-lite install clean BATCH=yes build# make -C /usr/ports/security/sudo install clean BATCH=yes build# make -C /usr/ports/sysutils/screen install clean BATCH=yes

A.6. get latest sources

build# svn co ​svn://svn0.eu.FreeBSD.org/base/stable/10 /usr/src

B. Build environment

B.1 Download the environment from the Wireless Leiden svn repository

build# svn checkout https://svn.wirelessleiden.nl/svn/code/hybrid/branches/releng-10/nanobsd $R
build# cd $R

Note: Certificate information ...... answer p to prompt: (R)eject, accept (t)emporarily or accept (p)ermanently? if svn is not found: svn is in /usr/local/bin, alternatively log out and in, or use rehash in a csh shell to make it available.

B.2. Compile all required packages using

build# $R/tools/package-build.sh

Note: See TracWiki for help on using the wiki.