Creating a bootable ISO image with FreeSBIE is really a simple task, thanks to the ncurses GUI and to the tunable “launch it and wait ‘til the end” option. There are two ways to build a FreeSBIE Live CD: using the scripts one by one or using the dialog(1) GUI. Before starting, please check that you have everything.
root access or privileges via sudosysutils/cdrtools installedWell, using the scripts to build an LiveCD is nothing more than launching them in numerical order from 0.rmdir.sh to 8.1.mkiso.sh or 8.2.mkflash.sh.
Before you start launching them, you need to create the config.sh
script containing global variables that will be used to build the image.
Here’s a table containing variables names and descriptions.
| Variable | Description |
|---|---|
| FREESBIEBASEDIR | The directory where the directory tree for your live CD will be created (e.g. /usr/local/livefs) |
| FREESBIEISODIR | The directory where, just before creating the
ISO
image, $FREESBIEBASEDIR will be copied. Please note the
$FREESBIEISODIR will be modified during the
ISO
image creating process, while $FREESBIEBASEDIR will not. |
| LOCALDIR | The directory containing FreeSBIE scripts (e.g.
/home/foobar/freesbie) |
| PATHISO | Name and path of the future
ISO
Image (e.g. $LOCALDIR/FreeSBIE.iso) |
| SRCDIR | Path to the main FreeBSD src directory
(e.g /usr/src) |
| MAKE | Which make should be used. Set this to
make and you’ll be ok |
| MAKEJ | Parallism flag for $MAKE: maximum jobs
that $MAKE may have running at any one time. Default is
-j3. |
| MAKEOPT | Any flags you would pass to $MAKE |
| BATCH_MODE | (optional) Set this if you would like the scripts to be launched by the shell one after the other |
| ARCH | The architecture of your machine (e.g.
i386 or amd64) |
| MINIMAL | Set this to YES if you would like to
build a minimal FreeSBIE image, suitable for a flash card |
| BSDINSTALLER | Set this to YES if you would like
to have the BSDInstaller on your FreeSBIE system |
| PKG_FILE | (optional) Set this to the path of a file containing a list of the packages to be installed on your FreeSBIE system, formatted like pkg_info(1) output |
| NO_BUILDWORLD | (optional) When running with BATCH_MODE variable set, skip the buildworld phase. Be sure you know what you’re doing, otherwise installworld script might fail |
Please remember that variables are specified in the following way:
NAME="VALUE"
Now that you have your config.sh file, you can start launching the
scripts in numeric order in the following way:
./SCRIPTNAME
You probably want to know what each script does (knowing what your system does is the first sysadmin rule ;) ) so here you have a brief description of each script.
| Script | Use |
|---|---|
0.rmdir.sh | Cleans
$FREESBIEBASEDIR and $FREESBIEISODIR |
1.mkdir.sh | Creates
$FREESBIEBASEDIR and the base directory tree using mtree(8) |
2.buildworld.sh | Builds the world using
$LOCALDIR/files/make.conf as make.conf file |
3.installworld.sh | Installs the world in
$FREESBIEBASEDIR. |
4.kernel.sh | Builds the kernel using
$LOCALDIR/files/FREESBIE.$ARCH as configuration file. If you
declared $MINIMAL in config.sh you are asked
whether you want to edit the configuration file. |
5.patchfiles.sh | Copies files and scripts needed for the boot of the FreeSBIE LiveCD. It also offers you to choose whether to install some scripts useful for hardware recognition and user preferences saving. |
6.packages.sh | Builds a list of the packages
installed in your system and displays a menu where you can choose the ones
you want to include in your LiveCD. Once you’re finished with the
selection, this scripts will install the selected packages in
$FREESBIEBASEDIR. Please note that you can execute this script
as ./6.packages.sh //FILE// where FILE is a file containing the list of packages you want to inclued in the LiveCD, one package per line. |
7.customuser.sh | Installs known workarounds to
make some packages work. Installs the BSDInstaller if you declared
BSDINSTALLER in the config.sh file. Merge
$LOCALDIR/files/custom content in $FREESBIEBASEDIR/. |
8.preparefs.sh | It copies $FREESBIEBASEDIR to $FREESBIEISODIR, then creates the MFS root image for booting the LiveCD and creates compressed loop filesystem of /usr and /var directories. They will be uncompressed and mounted at boot-time. |
81.mkiso.sh | If you didn’t define $MINIMAL in config.sh, you should use this script to create the $PATHISO file (aka the ISO image). |
82.mkflash.sh | If you did define $MINIMAL in config.sh you should use this script to create the image and copy it to the live filesystem on the flash card. |
FreeSBIE comes with a useful dialog(1) based GUI. You just have to launch
./freesbie
from the directory containing the scripts and then select each step in order from the top to the bottom.