使用mfsbsd制作FreeBSD内存盘系统
项目github地址:https://github.com/mmatuska/mfsbsd
项目主页:http://mfsbsd.vx.sk/
root password for all images: mfsroot
All images have mfsbsd.autodhcp set - all network cards are configured for DHCP.
mfsBSD
Copyright (c) 2007-2016 Martin Matuska
Version 2.3
Description
This is a set of scripts that generates a bootable image, ISO file or boot files only, that create a working minimal installation of FreeBSD. This minimal installation gets completely loaded into memory.
The image may be written directly using dd(1) onto any bootable block device, e.g. a hard disk or a USB stick e.g. /dev/da0, or a bootable slice only, e.g. /dev/ada0s1
Build-time requirements
- FreeBSD 10 or higher installed, tested on i386 or amd64
- Base and kernel from a FreeBSD 10 or higher distribution (release or snapshots, e.g mounted CDROM disc1 or ISO file)
Runtime requirements
- a minimum of 512MB system memory
Other information
See BUILD and INSTALL for building and installation instructions.
Project homepage: http://mfsbsd.vx.sk
This project is based on the ideas of the depenguinator project: http://www.daemonology.net/depenguinator/
mfsBSD building instructions
Copyright (c) 2007-2016 Martin Matuska
Configuration
Read hints in the sample configuration files in the conf/ directory, copy these files to files without .sample ending and make modifications to suit your needs.
Additional packages and files
If you want any packages installed, copy the .tbz files that should be automatically installed into the packages/ directory.
Add any additional files into the customfiles/ directory. These will be copied recursively into the root of the boot image.
WARNING: Your image should not exceed MFSROOT_MAXSIZE in total. Please adjust the variable for larger images.
Distribution or custom world and kernel
You may choose to build from a FreeBSD distribution (e.g. CDROM), or by using make buildworld / buildkernel from your own world and kernel configuration.
To use a distribution (e.g. FreeBSD cdrom), you need access to it (e.g. a mounted FreeBSD ISO via mdconfig) and use BASE=/path/to/distribution
To use your own but already built world and kernel, use CUSTOM=1 If you want this script to do make buildworld and make buildkernel for you, use BUILDWORLD=1 and BUILDKERNEL=1
Creating images
You may create three types of output: disc image for use by dd(1), ISO image or a simple .tar.gz file
##Examples
- disc image
make PKG_STATIC=/usr/local/sbin/pkg-static BASE=/cdrom/usr/freebsd-dist make PKG_STATIC=/usr/local/sbin/pkg-static BASE=/cdrom/10.2-RELEASE make PKG_STATIC=/usr/local/sbin/pkg-static CUSTOM=1 BUILDWORLD=1 BUILDKERNEL=1
- bootable ISO file:
make iso PKG_STATIC=/usr/local/sbin/pkg-static BASE=/cdrom/usr/freebsd-dist make iso PKG_STATIC=/usr/local/sbin/pkg-static BASE=/cdrom/10.2-RELEASE make iso PKG_STATIC=/usr/local/sbin/pkg-static CUSTOM=1 BUILDWORLD=1 BUILDKERNEL=1
- .tar.gz file:
make tar PKG_STATIC=/usr/local/sbin/pkg-static BASE=/cdrom/usr/freebsd-dist make tar PKG_STATIC=/usr/local/sbin/pkg-static BASE=/cdrom/10.2-RELEASE make tar PKG_STATIC=/usr/local/sbin/pkg-static CUSTOM=1 BUILDWORLD=1 BUILDKERNEL=1
- roothack edition:
make iso PKG_STATIC=/usr/local/sbin/pkg-static CUSTOM=1 BUILDWORLD=1 BUILDKERNEL=1 ROOTHACK=1
- special edition (with FreeBSD distribution):
make iso PKG_STATIC=/usr/local/sbin/pkg-static BASE=/cdrom/11.0-RELEASE RELEASE=11.0-RELEASE ARCH=amd64
- GCE-compatible .tar.gz file:
make gce PKG_STATIC=/usr/local/sbin/pkg-static BASE=/cdrom/11.0-RELEASE make gce PKG_STATIC=/usr/local/sbin/pkg-static CUSTOM=1 BUILDWORLD=1 BUILDKERNEL=1
mfsBSD installation (deployment) instructions
Copyright (c) 2007-2015 Martin Matuska
Build
For customized build please see the BUILD file
Deploy
Scenario 1
You have a linux server without console access and want to install FreeBSD on this server.
- modify your configuration files (do this properly, or no ssh access)
- create an image file (e.g. make PKG_STATIC=/usr/local/sbin/pkg-static BASE=/cdrom/11.0-RELEASE)
- write image with dd to the bootable harddrive of the linux server
- reboot
- ssh to your machine and enjoy :)
Scenario 2
You want a rescue CD-ROM with a minimal FreeBSD installation that doesn‘t need to remain in the tray after booting.
- modify your configuration files
- create an iso image file (e.g. make iso PKG_STATIC=/usr/local/sbin/pkg-static BASE=/cdrom/11.0-RELEASE)
- burn ISO image onto a writable CD
- boot from the CD and enjoy :)
Scenario 3
You want a rescue partition on your FreeBSD system so you can re-partition all harddrives remotely.
- modify your configuration files
- create an .tar.gz file (e.g. make tar PKG_STATIC=/usr/local/sbin/pkg-static BASE=/cdrom/11.0-RELEASE)
- create your UFS partition with sysinstall or gpart (e.g. ada0p2)
- create a filesystem on the partition (e.g. newfs /dev/ada0p2)
- mount the partition and extract your .tar.gz file on it
- configure a bootmanager (e.g. gpart bootcode -b /poot/pmbr -p /boot/gptboot -i 1 ada0)
- boot from your rescue system and enjoy :)
原文地址:https://www.cnblogs.com/lsgxeva/p/8641628.html