general/other Building VM image as Non-BSD Host and run in qemu

Hello guys! I would like to dig into the world of FreeBSD, but unfortunately I'm bound to a Macbook M1 device.
So I will have to use virtual machines for using and working on FreeBSD.
(If this is the wrong category for my problem, I'm sorry, I thought that here it fitted best)

First of all I tried if running the ARM64 port of FreeBSD inside a VM works on M1.
Using this https://gist.github.com/ctsrc/a1f57933a2cde9abc0f07be12889f97f it was only a matter of minute to get it running.

My next step was to build BSD from source, which turned out to be a little challenge but still solvable.
(https://wiki.freebsd.org/BuildingOnNonFreeBSD).

Now I have buildworld and buildkernel in a directory but no clue how to actually create a VM image from that.
Is it even possible to create a image which I can just startup in qemu like the one I downloaded in the first gist?

I looked at multiple websites but the only promising one was this https://adventurist.me/posts/0283

Since I replaced make with ./tools/build/make.py in the build process I tried replacing it here to, where it just said, that bmake isn't capable of doing vm-release/install or whatever.
My next guess would have been to create a image file which is formated with zfs and call installworld, distribution and installkernel on it, but I wasn't able to properly do that.

So I decided to ask here how someone would create a vm image from self compiled sources on a non bsd host.

Thanks in advance :)
 
According to this slide on page 17, I just would have to run env MAKEOBJDIRPREFIX=/Users/lockna/freebsd/obj time ../tools/build/make.py -j4 installworld TARGET=arm64 TARGET_ARCH=aarch64 DESTDIR=/Users/lockna/freebsd/destdir -DNO_ROOT from within the src/release directory.
But essentially I get this error
bmake[2]: "/Users/lockna/freebsd/src/Makefile.inc1" line 574: warning: "MAKEFLAGS= CPUTYPE=dummy /Users/lockna/freebsd/obj/bmake-install/bin/bmake -f /dev/null -m /Users/lockna/freebsd/src/share/mk MK_AUTO_OBJ=no -V CPUTYPE" exited on a signal bmake[2]: "/Users/lockna/freebsd/src/Makefile.inc1" line 577: CPUTYPE global should be set with ?=.

I tried setting the CPUTYPE to native, aarch64, arm64 (as env variable) or setting it in the Makefile using ?=. When setting it in the makefile it was always dummy. So, that's that
 
Back
Top