Shell Building mfsBSD using FreeBSD 15.0

I'm trying to build mfsbsd based on FreeBSD 15.0 using


I assume this should work.

Without changing the Makefile, I've set BASE by export BASE=/tmp/FreeBSD which containd base.txz and kernel.txz and then ran make.

Is this sufficient?

This is how it finished:-

Code:
Current: ./usr/share/locale/en_AU.ISO8859-15/LC_COLLATE (25308 bytes)
 done
Removing selected files from distribution ... done
Copying out cdboot and EFI loader ... done
Installing configuration scripts and files ...pwd_mkdb: flock: No locks available
pw: passwd file update: Inappropriate ioctl for device
*** Error code 74

Stop.
make: stopped making "all" in /net/0/projects/mfsbsd/3/mfsbsd
Any idea about what needs to be done?
 
Is the build directory perhaps a NFS mounted file system? The error messages and directory name /net sounds suspiciously like that.
Installing configuration scripts and files ...pwd_mkdb: flock: No locks available
pw: passwd file update: Inappropriate ioctl for device
*** Error code 74


Stop.
make: stopped making "all" in /net/0/projects/mfsbsd/3/mfsbsd

errno(2)
Rich (BB code):
     74 EPROGUNAVAIL RPC prog. not avail. The requested program is not
             registered on the remote host.
 
Is the build directory perhaps a NFS mounted file system? The error messages and directory name /net sounds suspiciously like that.

Yes, I was using a network drive since I didn't have much spare space locally, but I have cleared some space now and run the process again locally.

Here's what I get this time:-

Script started on Thu Dec 11 13:45:12 2025
Command: make
Extracting base and kernel ... done
Removing selected files from distribution ... done
Copying out cdboot and EFI loader ...cp: /tmp/wrk/mfsbsd/work/mfs/rw/boot/loader_4th.efi: No such file or directory
cp: /tmp/wrk/mfsbsd/work/mfs/rw/boot/loader_lua.efi: No such file or directory
*** Error code 1

Stop.
make: stopped making "all" in /tmp/wrk/mfsbsd

Command exit status: 1
Script done on Thu Dec 11 13:45:25 2025

I was using FreeBSD 11.2 amd64 in this case.

I'm not sure if the Makefile is specific to any version of FreeBSD.
 
Can I suggest another method. Use poudriere image. It is the greatest thing since swiss cheese.
They have a MFS type build and it works nice. You have to have 2M RAM minimum in my opinion and that's with a striped down build.

Just skip the package building at first and build you an MFS Image with Poudriere Image on FreeBSD 15.0-RELEASE.
There have been alot of changes to FreeBSD in this release but I bet you can still build images with poudriere.

Goto: Image Building with Poudriere

You don't want type -t USB build.
You want usb+mfs

pkg install poudriere
 
You might need to tinker around with your size of MFS image. Klarna lists 10G there for type USB and that might be big for USB+MFS.
Roughly consider double the amount of RAM from MFS image. If you produce a 4GB MFS image you should have 8GB RAM Minimum.

There are settings for everything. Poudriere is nothing but a set of scripts. Modify for you taste.
 
Looks like an permission issue
Here's what I get this time:-
Code:
 *** Error code 1
errno(2)
Rich (BB code):
     1 EPERM Operation not permitted. An attempt was made to perform an
             operation limited to processes with appropriate privileges or to
             the owner of a file or other resources.
Make sure the owner of /tmp/wrk/mfsbsd and recursive directories is the same the as command executing user, or perform all command operations as "root".

I'm not sure if the Makefile is specific to any version of FreeBSD.
I don't believe that's the issue.

On my system, it builds fine on 14.3 and 15.
 
I just want to create a 15.0 version of https://mfsbsd.vx.sk/files/images/14/amd64/mfsbsd-se-14.2-RELEASE-amd64.img .

Do I use this?

make tar BASE=/cdrom/usr/freebsd-dist
No, "tar" is not the target to create .img images.

To get .img, simply execute make BASE=/parth/to/dist_files

BASE= is the path to the distribution files (kernel.txz, base.txz), or FreeBSD source targets:
CUSTOM=1 allone: install from a completed buildworld buildkernel source in the work mfsbsd build directory.
CUSTOM=1 BUILDWORLD=1 BUILDKERNEL=1: build world/kernel and install from source in the work mfsbsd build directory.

All target images and BASE sources are explained in mfsbsd/BUILD.md, and use scenarios in mfsbsd/INSTALL.md.

I did a quick test on 15.0-RELEASE, unfortunatelly there seems to be a openssl problem, the build terminates with errors:
Code:
/tmp/mfsBSD/mfsbsd15 # make BASE=../freebsd-dist15
Extracting base and kernel ... done
Removing selected files from distribution ... done
Copying out cdboot and EFI loader ... done
Installing configuration scripts and files ... done
Generating SSH host keys ... done
Configuring boot environment ...x ./
x ./linker.hints
x ./kernel
 done
Creating EFI boot image ...Creating `/tmp/mfsBSD/mfsbsd15/work/cdboot/efiboot.img'
/tmp/mfsBSD/mfsbsd15/work/cdboot/efiboot.img: 4039 sectors in 4039 FAT12 clusters (512 bytes/cluster)
BytesPerSec=512 SecPerClust=1 ResSectors=1 FATs=2 RootDirEnts=512 Sectors=4096 Media=0xf0 FATsecs=12 SecPerTrack=63 Heads=255 HiddenSecs=0
Populating `/tmp/mfsBSD/mfsbsd15/work/cdboot/efiboot.img'
Image `/tmp/mfsBSD/mfsbsd15/work/cdboot/efiboot.img' complete
 done
Installing pkgng ... done
Installing user packages ...
Compressing root ...

 done
echo roothack.full: /lib/libc.a  >> .depend
/local/bin/ccache cc  -O2 -pipe   -g -gz=zlib -MD  -MF.depend.roothack.o -MTroothack.o -std=gnu17 -Wno-format-zero-length -nobuiltininc -idirafter /lib/clang/19/include -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Wnested-externs -Wold-style-definition -Wno-pointer-sign -Wdate-time -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-error=unused-but-set-parameter -Wno-error=cast-function-type-mismatch  -Qunused-arguments     -c /tmp/mfsBSD/mfsbsd15/tools/roothack/roothack.c -o roothack.o
cc -O2 -pipe -g -gz=zlib -std=gnu17 -Wno-format-zero-length -nobuiltininc -idirafter /lib/clang/19/include -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Wnested-externs -Wold-style-definition -Wno-pointer-sign -Wdate-time -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-error=unused-but-set-parameter -Wno-error=cast-function-type-mismatch -Qunused-arguments  -Wl,-zrelro -static    -o roothack.full roothack.o  -larchive -lbz2 -lz -llzma -lcrypto -lbsdxml -lmd -lprivatezstd
ld: error: undefined symbol: pthread_create
>>> referenced by thread_posix.c
>>>               thread_posix.o:(ossl_crypto_thread_native_spawn) in archive /lib/libcrypto.a
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
make[1]: stopped making "all" in /tmp/mfsBSD/mfsbsd15/tools/roothack
*** Error code 1

Stop.
make: stopped making "all" in /tmp/mfsBSD/mfsbsd15

Images are built fine on 14.3-RELEASE still. Default image packages from mfsbsd/tools/packages.sample can be excluded from building by renaming the file.
 
I came up with this simple script

sh:
version='14.3'
BASE=/tmp/FreeBSD
mkdir -p $BASE 
LOGDIR=/var/log/build
mkdir -p $LOGDIRE 
cd   $BASE 
if [ !  -f "kernel.txz" ]; then
    fetch https://download.freebsd.org/releases/amd64/amd64/$version-RELEASE/kernel.txz
    fetch https://download.freebsd.org/releases/amd64/amd64/$version-RELEASE/base.txz
    git clone https://github.com/mmatuska/mfsbsd
fi
cd mfsbsd
mv tools/packages.sample tools/packages.sample.org
time script $LOGDIR/mfsbsd-build_$(date +"%y%m%d%H%M").log  make BASE=$BASE

Does this look as if it should work.

I get errors which are shown in /var/log/build/mfsbsd-build_*.log

echo roothack.full: /usr/lib/libc.a >> .depend
cc -O2 -pipe -g -gz=zlib -MD -MF.depend.roothack.o -MTroothack.o -std=gnu17 -Wno-format-zero-length -nobuiltininc -idirafter /usr/lib/clang/19/include -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Wnested-externs -Wold-style-definition -Wno-pointer-sign -Wdate-time -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-error=unused-but-set-parameter -Wno-error=cast-function-type-mismatch -Qunused-arguments -c /tmp/FreeBSD/mfsbsd/tools/roothack/roothack.c -o roothack.o
cc -O2 -pipe -g -gz=zlib -std=gnu17 -Wno-format-zero-length -nobuiltininc -idirafter /usr/lib/clang/19/include -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Wnested-externs -Wold-style-definition -Wno-pointer-sign -Wdate-time -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-error=unused-but-set-parameter -Wno-error=cast-function-type-mismatch -Qunused-arguments -Wl,-zrelro -static -o roothack.full roothack.o -larchive -lbz2 -lz -llzma -lcrypto -lbsdxml -lmd -lprivatezstd
ld: [0;31merror: [0mundefined symbol: pthread_create
>>> referenced by thread_posix.c:48 (/usr/src/crypto/openssl/crypto/thread/arch/thread_posix.c:48)
>>> thread_posix.o:(ossl_crypto_thread_native_spawn) in archive /usr/lib/libcrypto.a
cc: [0;1;31merror: [0m[1mlinker command failed with exit code 1 (use -v to see invocation)[0m
*** Error code 1

Stop.
make[1]: stopped making "all" in /tmp/FreeBSD/mfsbsd/tools/roothack
*** Error code 1

Stop.
make: stopped making "all" in /tmp/FreeBSD/mfsbsd

Command exit status: 1
Script done on Sun Dec 14 12:44:19 2025
 
Back
Top