Create customized FreeBSD images for VMs

Hi,

I am looking for a simple way to create customized FreeBSD images to be then run on KVM/Qemu.
Basically I am looking for an equivalent of https://github.com/alpinelinux/alpine-make-vm-image and ideally I would rather not compile everything.

In my current understanding there are two tools which can be used for FreeBSD:
- With crochet https://github.com/freebsd/crochet
- With poudrier https://github.com/freebsd/poudriere (doing something like this https://github.com/jlduran/router)

Now trying to test my understanding by searching on the internet and github, it doesn't seems to be a popular way to achieve what I want.

My questions are:
- What am I missing here?
- How do you usually do that and could you point me to an example?

Many thanks
 
I am looking for a simple way to create customized FreeBSD images to be then run on KVM/Qemu.
Start reading release(7) and the scripts in /usr/src/release.
Old tool, don't use it anymore. Much of what crochet did has been integrated in the release building scripts.

- How do you usually do that and could you point me to an example?
After I updated the host I follow up with:
Code:
cd /usr/src/release
make -DNOPORTS -DNODOC -DKERNCONF="GENERIC" release
make -DNOPORTS -DNODOC -DKERNCONF="GENERIC" DESTDIR=/storage/release/14-stable install
That gets me a couple of nice images and FTP directory.
Code:
# ll /storage/release/14-stable/
total 4119662
-rw-r--r--  1 root wheel        462 Mar 17 13:56 CHECKSUM.SHA256
-rw-r--r--  1 root wheel        718 Mar 17 13:55 CHECKSUM.SHA512
-rw-r--r--  1 root wheel  442660864 Mar 17 01:02 FreeBSD-14.0-STABLE-amd64-bootonly.iso
-rw-r--r--  1 root wheel 1085493248 Mar 17 00:59 FreeBSD-14.0-STABLE-amd64-disc1.iso
-rw-r--r--  1 root wheel 1296617984 Mar 17 01:02 FreeBSD-14.0-STABLE-amd64-memstick.img
-rw-r--r--  1 root wheel  544559616 Mar 17 01:04 FreeBSD-14.0-STABLE-amd64-mini-memstick.img
drwxr-xr-x  2 root wheel         11 Mar 17 00:56 ftp/

In your case you can create Qemu images too, I suggest looking through Makefile.vm.
 
A quote from poudriere-image(8):
DESCRIPTION
Builds a filesystem image per the specified options.

WARNING: This feature is still considered ALPHA.

Also, Github Actions (mentioned in OP's inspiration references), is not free:
It basically amounts to Github renting out the processing power for the projects. Either keep your project small enough to fit into a limited time requirement that you can get for free, or use your own hardware to precompile, then upload.

Poudriere can get plenty complicated when you dig into what settings you can tune. I had to design my own Poudriere workflow, go back and correct nearly everything, but at least I can say that Poudriere is a pretty coherent single tool around which a reasonably complete workflow can be designed. And it's a bit easier than running around trying to collect different tools that may or may not line up very neatly.
 
Back
Top