# customizing a freebsd installation image



## aimeec1995 (Sep 23, 2017)

Is it hard to customize a freebsd installation image? 
What if I want it to come with certain things in rc.conf? Would I just add those to the rc.conf in the image? How would I unpack then repack an .img file for this purpose?


----------



## skywhi (Sep 23, 2017)

Hi, 

You have to tell us for which purpose you will need a custom install image. Because if the only thing that you want is to update the default configuration on a handful of machines, I could suggest that you store the files in a distant repo (git or something). After a fresh install you retrieve the files and just copy them with a small shell script.


----------



## Phishfry (Sep 23, 2017)

You can see from this thread where I modify /boot/loader.conf on a FreeBSD memstick installer.
https://forums.freebsd.org/threads/59450
There is no reason you could not add things to your installer /etc/rc.conf especially to get unsupported devices recognised.

Simply write the freebsd.img to a memstick and boot up off it and go to LiveCD mode and modify the files as needed.

You could also mount it after you write the image out and modify from the host.

The FreeBSD Crochet project allows you to write customized images easily.
GenericI386 board file works for x86.


----------



## aimeec1995 (Sep 24, 2017)

Phishfry said:


> You can see from this thread where I modify /boot/loader.conf on a FreeBSD memstick installer.
> https://forums.freebsd.org/threads/59450
> There is no reason you could not add things to your installer /etc/rc.conf especially to get unsupported devices recognised.
> 
> ...



Thanks!


----------



## aimeec1995 (Sep 25, 2017)

so im not able to modify it like that apparently
it always returns the error: read only filesystem, doesn't matter if i mount root as rw


----------



## Beastie (Sep 25, 2017)

Follow these steps but lose all read-only parameters and options (*-o readonly* and *-r*).

Of course, you may choose the "hard" way:

https://www.freebsd.org/doc/en/articles/releng/release-build.html
release(7)
HTH.


----------



## Phishfry (Sep 25, 2017)

Instead of mounting the image why not write it to usb and mount the proper slice and edit or add files.


----------



## Beastie (Sep 25, 2017)

Well, every time you need a new one, you'll have to redo all the changes. It's not efficient. But if you change the image itself (or create a brand new one), you do so once and for all.


----------

