FreeBSD 7 and the FreeBSD installer
24 Oct 2007Note: This article is half-finished, but I wanted to get my draft out there. I'll finish up the rest in the next 48-72 hours.
After reading about the FreeBSD Graphical Installer here I was immediately tempted by the inclusion of the recently ported ZFS. I quickly decided I would give the experimental package a whirl, and decided I would document and chronicle my adventures so others could try it out as well.
Background / First Steps
Initially I assumed the new graphical installer was included in the "FreeBSD-Current" nightly build -- so I browsed the FreeBSD snapshot site: here and downloaded the most recent build for my architecture which ended up being "7.0-CURRENT-200710-i386-disc1.iso".
This assumption turned out to be incorrect, the FreeBSD Graphical Installer (finstall) has not yet been merged in to the main CVS repository, and much to my dismay it is in the "experimental" perforce repository here. I've already written on why I think FreeBSD is making a bad choice using a proprietary version control package in the article: "Feebsd and perforce? Just say no!" My initial suspicion was confirmed, since there is no anonymous access to the perforce repository I was forced to download the "finistall" project file by file through the web interface. I can understand the need to have a separate "unstable" repository, but there is no good reason I can think of that it should be managed by perforce, thus excluding the weekend tinkerer like me.
There are three directories in the perforce repository: 1) "installer/" which contains the PyGTK graphical component, this is what end users will interact with directly, 2) "pybackend/" this contains the supporting code for the graphical component, this what actually performs the configurations selected by the user via the graphical user interface, and finally 3) "makeimage/" which contains the python scripts used to generate live cd iso's with the finstall enabled. This last directory is what we are looking for, specifically the "makeimage.py" script.
Building the Live CD
The script requires an existing system to bootstrap into the live CD -- I used the FreeBSD Current ISO listed above in the first section. The install went smoothly, as usual, which is a promising sign for the pending 7.0 release.
Initially I only downloaded revision 12 of the makeimage.py script here and a copy of maptree.py here -- however I realized I needed the whole tree, and since it is in the qusi-exlusive perforce tree I was forced to download the files one by one through the web interface. See tarball of "finstall perforce directory" in the resources section for the same files I've used in this document.
A quick glance through makeimage.py tells me I'll need to install python (since it is a python script) and cdrtools to create the image. I'll also need to run the script at root at certain points, so be prepared and double check you have root access on your machine.
I first used portsnap to update my ports tree, with the following two commands for my freshly installed system:
portsnap fetch
portsnap extract
cd /usr/ports/lang/python; make install && make clean
(I accepted the default configuration options)
cd /usr/ports/sysutils/cdrtools; make install && make clean
(Again, I accepted the default configuration options)
cd /usr/ports/ftp/wget; make install && make clean
mkdir /usr/local/finstall
chmod -R a+x *.py
cvsup -g -L 2 standard-supfile
cd /usr/src
time make buildworld (Took 80min for me)
make buildkernel KERNCONF=GENERIC
pkg_add -r xorgpkg_add -r xfce
pkg_add -r vim
pkg_add -r py-gtk
pkg_add -r firefox
pkg_add -r thunderbird
pkg_add -r strace
pkg_add -r unixbench
pkg_add -r bonnie++
Now that we have all the packages we need on our system we can run the makeimage script that will actually generate the FreeBSD finstall LiveCD.
./makeimage.py -d /usr/local/finstall -i FREEBSD7-FINSTALL.iso -f -p pkglist
After makeimage.py finishes the console is a little "wacky" (yes, that is a technical term). Just type exit, and re-login and you should be fine.
Running finstall
Unfortunately the finstall livecd I built my self doesn't exactly work (yet...) . It boots, but moused sort of half freezes at one point during the boot -- though hitting enter seems to refresh the screen and I'm able to login as the "install" user the paths to the startxfce start script are different on my livecd and the one Ivan produced, thus causing it to fail. If I correct this manually, and then run startx, the desktops are not configured the same. Basically mine doesn't work.
But I'm willing to believe it is something I have done incorrectly during my tweaking, and will re-visit this in a couple of days.
Ivan Voras finstall presentation (PDF)
Portsnap Documentation (FreeBSD.org)
Tar ball of finstall perforce directory (Tarball)