Overview of mfsBSD
mastermd) subsystem. This makes it suitable for running from removable media like SD cards or USB keys.repository·master·Indexed 20 days ago
https://github.com/mmatuska/mfsbsdA toolset for creating minimal, memory-resident FreeBSD installations. mfsBSD generates bootable images (ISO, disk images, or tarballs) that load the entire OS into RAM via the memory disk (md) subsystem. It includes mfsBSD-mini for creating small images from existing systems and supports deployment to removable media, Google Compute Engine, and remote servers. Requires FreeBSD 11 or higher and a minimum of 512MB of system RAM at runtime.
md) subsystem. This makes it suitable for running from removable media like SD cards or USB keys.mfsBSD-mini is a set of scripts designed to generate a small, bootable image (ISO file or tar archive) from an existing, installed FreeBSD system. The resulting image is designed to be loaded completely into memory.
Once generated, the image can be written directly to a bootable block device (such as a hard disk or USB stick, e.g., /dev/da0) or to a specific bootable partition (e.g., /dev/ada0p2) using the dd(1) utility.
dd if=your_image.iso of=/dev/da0mfsBSD allows you to build images from different sources:
If you have a FreeBSD distribution (e.g., from a mounted ISO), specify the path using the BASE variable:
make BASE=/path/to/distribution
CUSTOM=1.make buildworld and make buildkernel steps for you, set BUILDWORLD=1 and BUILDKERNEL=1 respectively.mfsBSD can generate several types of bootable artifacts depending on your target deployment:
.tar.gz archives.To create a rescue CD-ROM containing a minimal FreeBSD installation that can be ejected after booting:
make iso BASE=/cdrom/usr/freebsd-dist).make iso BASE=/cdrom/usr/freebsd-distTo deploy FreeBSD onto a remote Linux server where you lack physical or console access, follow these steps. Warning: Ensure your configuration files (especially network and SSH settings) are correctly modified before proceeding, otherwise you will lose remote access to the machine.
make BASE=/cdrom/usr/freebsd-dist).dd command.make BASE=/cdrom/usr/freebsd-distmfsBSD uses sample configuration files located in the conf/ directory. To customize your build, copy these files to new files that do not have the .sample extension and modify them as needed.
By default, the root password is set to mfsroot. You can change this using the following make variables:
ROOTPW: Set a plain text password.ROOTPW_HASH: Set a pre-hashed password.You can control how root accesses the system via SSH using the PERMIT_ROOT_LOGIN variable:
PERMIT_ROOT_LOGIN=no: Disables remote root login.PERMIT_ROOT_LOGIN=without-password: Disallows password authentication for root. If using this, you must add your SSH keys to conf/authorized_keys to maintain access.# Example of setting a custom root password and disabling password login
make ROOTPW=mysecretpassword PERMIT_ROOT_LOGIN=without-passwordTo build mfsBSD images, your build environment must meet the following criteria:
i386, amd64, and arm64).base.txz and kernel.txz from a FreeBSD 11 or higher distribution, or use a FreeBSD 11-based (or newer) FreeBSD source tree.To set up a rescue partition on an existing FreeBSD system that allows for remote hard drive re-partitioning:
.tar.gz archive (e.g., using make tar BASE=/cdrom/usr/freebsd-dist).bsdinstall or gpart (e.g., ada0p2).newfs /dev/ada0p2)..tar.gz file onto it.gpart bootcode).make tar BASE=/cdrom/usr/freebsd-dist
newfs /dev/ada0p2
gpart bootcode -b /poot/pmbr -p /boot/gptboot -i 1 ada0To build the mfsBSD-mini images, you must run the preparation command from the main mfsBSD directory.
Ensure you have met the necessary build-time and runtime requirements for the main mfsBSD project before executing this command.
make prepare-miniYou can include extra software and files in your mfsBSD boot image using specific directories:
.txz files) into the packages/ directory to have them automatically installed.customfiles/ directory. These will be copied recursively into the root of the boot image.Important: Ensure your total image size does not exceed the MFSROOT_MAXSIZE value. If your image is too large, adjust MFSROOT_MAXSIZE in your configuration.
Use the following command patterns to generate different types of mfsBSD outputs:
make BASE=/path/to/distmake iso BASE=/path/to/distmake tar BASE=/path/to/distmake gce BASE=/path/to/distmake iso CUSTOM=1 BUILDWORLD=1 BUILDKERNEL=1 ROOTHACK=1make iso BASE=/path/to/release RELEASE=11.0-RELEASE TARGET=amd64# Example: Building a bootable ISO using a custom world and kernel
make iso CUSTOM=1 BUILDWORLD=1 BUILDKERNEL=1