# Custom FreeBSD-update-server - creating a custom OS image



## r00t (Mar 10, 2010)

Hi

I'm trying to create my own FreeBSD-update-server (http://www.freebsd.org/cgi/cvsweb.cgi/projects/freebsd-update-server/) so that I can automatically update all the machines on my network to the latest *customized* version of FreeBSD.

The custom version is simply a minimal install, a couple of ports and a custom (reduced) kernel. 

My problem is creating an ISO of this customized version. I've searched the forums, read the handbook and some other guides but all fail to explain how to REALLY do what I need to do. (or i missed it somehow)

The machine I'm using as the update server (and for compiling everything) already has a minimal install + custom kernel. Just need to know how to convert all this to an ISO so that I can easily use it on other machines (through the update system).

If I'm correct, this whole mechanism will allow me to update/upgrade any machine on the network simply by running freebsd-update on the target machine.

If you think I'm going in the wrong direction and that there's a better way to achieve this, I'm all ears! If you need more info I will also provide it.

Hope someone can help!
Thanks in advance!


----------



## SirDice (Mar 10, 2010)

r00t said:
			
		

> My problem is creating an ISO of this customized version. I've searched the forums, read the handbook and some other guides but all fail to explain how to REALLY do what I need to do. (or i missed it somehow)


Have a look at the scripts and Makefile in /usr/src/release/. The "make release" there will basically create a bootable install CD.


----------



## DutchDaemon (Mar 10, 2010)

I don't know about freebsd-update specifically, but release(7) should help.


----------



## jgh@ (Mar 11, 2010)

The only way to do this is with using the facility of "make release," as aforementioned.

What you are doing is something I've been doing for some time now, and have gained some expertise with it.

Everything NEEDS to be in the iso. As freebsd-update-server code will download the iso and do all patching and compiling from that iso.

I wrote up some documentation that was accepted into the Releng Document that may help.
http://www.freebsd.org/doc/en_US.ISO8859-1/articles/releng/release-build.html 
I added section specifics for using a custom kernel in 3.4.1

As far as the update server, you can look at this documentation I wrote:
http://people.freebsd.org/~manolis/patches/freebsd-update-server/
http://www.experts-exchange.com/art...BSD/Build-Your-Own-FreeBSD-Update-Server.html

You will need to make a couple of modifications to the freebsd-update-server software. The subroutines in build.subr regarding documentation and buildworld will need to be tuned. I have spoken with Colin about a bug in the buildworld routine that won't build on customized kernels, and it is something he will eventually look into. I have modified mine to work on custom kernels, but the real fix is to find out why it is ignoring it.

Above all, make sure your ISO actually works before building update code against it.


----------



## bsd10 (Sep 20, 2010)

If you make a release with additional ports or other programs, will they be automatically installed by the iso that is generated? Can you also get freebsd-update-server to update both the base system and the ports and other software?


----------



## tty3 (Sep 21, 2010)

> The problem with sysinstall is that it is severely limited in what, where and how it can install.
> 
> It is normally used to install pre-built distribution sets and packages from some other source (CD, DVD, FTP). It cannot install the result of a make buildworld.
> 
> ...



http://www.freebsd.org/doc/en/articles/fbsd-from-scratch/why.html


----------



## jgh@ (Feb 23, 2011)

jgh said:
			
		

> The only way to do this is with using the facility of "make release," as aforementioned.
> 
> What you are doing is something I've been doing for some time now, and have gained some expertise with it.
> 
> ...



My article was finally committed! This should help you build your own update server.
http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/index.html


----------



## DutchDaemon (Feb 23, 2011)

Any further discussion here: http://forums.freebsd.org/showthread.php?t=22016


----------

