# Building mfsBSD



## balanga (Dec 8, 2022)

I've been using mfsBSD for several years, but never mastered the art of buiding, so Thought I'd have another go after reading:-









						Remote Installation of the FreeBSD Operating System Without a Remote Console
					

Describes the remote installation of the FreeBSD operating system when the console of the remote system is unavailable




					docs.freebsd.org
				




where it says:

3.2. Building an mfsBSD Image​The process of building an mfsBSD image is pretty straightforward.


And it ends up with:

Next, build the bootable mfsBSD image:
# make BASE=DIST

When I run this I get

Cannot find  direcory "DIST/base"


What have I done wrong here?


```
DIST='/workdir/DIST'
echo $DIST
mkdir -p /workdir/DIST
cd  /workdir

pkg install -y git
git clone https://github.com/mmatuska/mfsbsd.git

fetch  -o - ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/12.3-RELEASE/kernel.txz | tar xf - -C DIST
fetch  -o - ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/12.3-RELEASE/base.txz | tar xf - -C DIST

cd mfsbsd

make BASE=$DIST
```


----------



## Jose (Dec 9, 2022)

balanga said:


> Cannot find  direcory "DIST/base"
> What have I done wrong here?


It's right there, just a few lines above that spot

```
# mkdir DIST
```
Maybe the Handbook's new wonky formatting threw you off. I keep hoping it gets better. It keeps not getting better.


----------



## T-Daemon (Dec 9, 2022)

Forget the article.

Major issue there is: There is no need to create a (DIST) directory and extract the base, kernel distribution sets inside it manually. No such procedure is to find in the mfsBSD documentation. When the build process is invoked, a mfsbsd/work/mfs directory is created, where the needed base and kernel components are extracted automatically.

Steps:


```
# mkdir -p /workdir/DIST  
# cd /workdir
# git clone <mfsbsd>
# fetch -o DIST ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/12.3-RELEASE/kernel.txz
# fetch -o DIST ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/12.3-RELEASE/base.txz
```
If needed make changes to the configuration for the targeted mfsBSD image, see mfsbsd/BUILD.md.

When there is no need for installed packages on the image, rename mfsbsd/tools/packages.sample, or when third party applications are needed, modify it to include/exclude packages.

Next, specify the directory where the base.txz and kernel.txz live by modifying `BASE?=    /cdrom/usr/freebsd-dist` in the Makefile, or set the environment to the make command:

For a iso image:

```
# make iso BASE=/workdir/DIST
```

For a memstick image (.img) remove the 'iso' target from the command.


----------



## balanga (Dec 9, 2022)

That seemed to work fine.

I'd just like to go through the targets of the three output images according to 









						mfsbsd/BUILD.md at master · mmatuska/mfsbsd
					

mfsBSD. Contribute to mmatuska/mfsbsd development by creating an account on GitHub.




					github.com
				




This is my understanding...

Disk image suitable for dd to dedicated device...

ISO should be bootable via PXE

compressed tar file for extraction to a partition so would be bootable via Grub....


???


----------



## balanga (Dec 9, 2022)

The 'tar' format, not 'compressed tar' as I mistakenly said above, works fine.

Now what I need to do is to hone the creation so mfsBSD boots up exactly as I want with the configuration and apps I want.


----------

