# FreeBSD Automated Installation/Kernel Module Generation



## daBee (Mar 29, 2017)

Hi folks.

Well, having messed with PCs and Raspberry PI 2, considering a Pi Zero, and other potential OS installations, I'd like to inquire about automated Kernel module generations.  Essentially, how I can build an environment where an installer can be run (assuming FreeBSD) to install from a FreeBSD image to a chosen volume.  

Given IOT moving ahead, I'd like to be able to flash several SD cards for various applications.  Each one has to have their own individual attributes:

- static LAN IP number
- hostname
- root password

I would also like to modify and/or install the following:

- ntp.conf
- bash & .bash_profile
- pico
- curl
- rvm
- recognized Ruby
- various gems
- bash & Ruby scripts
- www default
- passenger & nginx

Now I'm new to this OS and have found something for Debian bulk generation (https://wiki.debian.org/ModuleAssistant) but I've not found anything for FreeBSD.  There are obvious issues with getting permissions to modify certain conf files, installing software packages (even through ports) with root access, etc.  

Is there such an application for this?  

Cheers


----------



## SirDice (Mar 29, 2017)

The FreeBSD installer really doesn't do much more than partition a disk, format it and extracting a handful of .txz files. So it's fairly easy to create a custom script that does all that. You might want to have a look at mfsBSD.


----------



## leebrown66 (Mar 29, 2017)

As SirDice said (I do this all the time).
kernel.txz and base.txz are all you really need:

1. Setup your disks (wipe, partition).
2. newfs your partition(s).
3. mount the root partition.
4. untar kernel.txz and base.txz into that mounted root partition.
5. chroot to the mounted root partition and execute newaliases.
6. make other changes by chrooting into the mounted root partition, ie package extraction, populating rc.conf, etc.
7. reboot into your fully configured system.


----------



## Phishfry (Mar 30, 2017)

I think that crochet fits the bill. The problem is it's mainly aimed at Arm builds.
https://github.com/freebsd/crochet
There is an GENERIC-x86 board file but its broken(see comments in script).
I always thought an amd64 board file would be nice.
So basically it allows you to add any packages you want. Plus there is an overlay directory to slipstream your own system configuration files.
The add packages-part just got fixed recently.


----------



## Oko (Mar 30, 2017)

SirDice said:


> The FreeBSD installer really doesn't do much more than partition a disk, format it and extracting a handful of .txz files. So it's fairly easy to create a custom script that does all that. You might want to have a look at mfsBSD.


I looked and it is not something I would use in the production environment.  So let me reformulate original question a bit. Could you please point me to the documentation/handbook which will show me how to do quick basic unattended FreeBSD installation using PXE boot so that I can get a working system which could be finished by my favorite orchestration software (Ansible if anybody cares). I should have no problem to install well over 500 machines in an hour or so. That is the industry standard. I use Stacki (Kickstart) on RedHat and OpenBSD has its own (very similar to Kickstart) unattended installer.

PC-BSD before it died had some scriptable PXE boot untended installation capabilities.


----------

