Create FreeBSD system custom installation ISO

Source: Internet
Author: User
The idea of creating a custom FreeBSD system to install ISOFreeBSDISO originated from the repetitive configuration work after installing the system, which wasted time and experience. Www.2cto.com began to search for information and found that there was almost no such information available in China... the idea of creating a custom FreeBSD system to install ISO FreeBSD ISO originated from the repetitive configuration work after the system was installed, which wasted time and experience. Www.2cto.com began searching for information and found that there was almost no such information in China. Finally, I learned the rough process from a foreigner's article! The structure of the FreeBSD system is relatively simple. its directory files are basically divided into two categories: 1. the basic system is installed in a location other than/usr/local. 2. install it in the/usr/local path through pkg_add or using the port tree make install. The basic system directly decompress the package and put it in the corresponding directory of the new system. then we can modify the content of the package, directly replace the original content with the modified and customized configuration content, so the newly installed system is exactly the same as the configured system, achieving installation and configuration step by step, improving efficiency, at the same time, repetitive work is also avoided. (As this article is being reviewed in the future, some steps may not be listed after some time.) 1. load the downloaded ISO file to the template system configured in one day, create a storage path for the template system, for example,/var/custom-iso. copy all files in ISO to the directory. Www.2cto.com replaces the configured file with the corresponding file in the decompressed Directory. of course, you can also add files not in the original system, the following is the repackaging and compression process. 1. step cd/8.0-Release-src-filemtree-c-K md5digest-p. /base/> base.tar/base. mtree cd/8.0-Release-src-file/basetar-czpf -. /* | split-B 4 M rm-f .. /base.tar/mv x ?? ../Base.tar cd/8.0-Release-src-file/base.tar find./-type f-depth 1-name 'X ?? '| Sed s /'. \/x' // g | awk '{MV = "mv"}; {PRE = "base. "};{ SRC =" x "};{ print mv src $0, PRE $0} '| sh echo" Pieces = 'ls-l base .?? | Wc-l' "> base. infcksum base .?? | Sed s/base/cksum/g | awk-F "" '{printf ("% s = % s \ n", $3, $1, $2)} '> base. inf cksum base. aa | awk-F "" '{printf ("% s = % s \ n", $3, $1, $2 )} 'generate the MD5 code of the directory tree cat/dev/null> CHECKSUM. MD5cat/dev/null> CHECKSUM. SHA256md5 * | grep-v CHECKSUM> CHECKSUM. MD5sha256 * | grep-v CHECKSUM> CHECKSUM. SHA256 rm-f/8.0-Release/8.0-RELEASE/base/* cp */8.0-Release/8.0-RELEASE/base/modify the automatic installation script INSTALL. CFG steps (implementation Automatic installation, automatic partitioning, and other functions of the system. manual input is not required during the installation process. the cfg package is included in the mfsroot.gz package. use the following steps to mount it to the/dist of the current system. Cd/8.0-Release/bootgzip-d mfsroot.gz mdconfig-a-t vnode-u0-f mfsrootmount/dev/md0/dist vim/dist/install. cfg # Edit the automatic installation script # package the file into the mfsroot package after modification. umount/distcd/8.0-Release/bootmdconfig-d-u0gzip mfsroot # create the custom iso file mkisofs -R-no-emul-boot-B ~ /Freebsd/boot/cdboot-o freebsdautoinstall. iso ~ /Freebsd # After the ISO file is created, it indicates whether the installation is correct. # I uploaded the ISO file to the virtual system of vmware exsi, verify echo 'password' | scp/fb8-amd64-hapa.iso root @ vmwareexs4 by installing the VM: /vmfs/volumes/4aaa839c-7791b8bf-280b-002219bf7965 # if there is no problem, you can burn the disc burncd-f/dev/acd0 freebsdautoinstall. iso fixate attachment: automatically INSTALL the configuration file # this a simple install. CFG # do not use this config you 've read it carefully as it will overwrite your disk ##################### ######### Use Alt F2 to see the debug outputdebug = YES country = chinakeymap = us. isoninteractive = YESnoWarn = YES ############# network configuration ##################### #### host name hostname = testdomainname = hapame. comnameserver = servers = 202.106.0.20defaultrouter = 192.168.16.1ipaddr = 192.168.16.198netmask = 255.255.255.0 ############## ######## mediaSetCDROM ############## select the installed Distribution Set ############# # dists = base GENERIC manpages info lib32 ports # dists = base GENERIC manpages catpages proflibs info sbase ‑ssecure ‑sgnu setc sinclude ‑slibexec sgames srelease srescue ‑sbin ssbin sshare ssys ‑sub‑in # ############ disk configuration ############## disk = da0partition = allbootManager = standarddiskPartitionEditor ###### # partition settings ############## partition size calculation method # Example: 60g space 1024*1024*2*60 = 125829120da0s1-1 = ufs 1048576/da0s1-2 = swap 1048576 noneda0s1-3 = ufs 2097152/varda0s1-4 = ufs 2097152/usrda0s1-5 = ufs 0/storage 1 installCommit ### ######### INSTALL the additional software package ######### shutdown an INSTALL found online. CFG sample, # This is a sample installation configuration file for my test machine, # crate.cdrom.com. # It is supported Ded here merely as a sort-of-supported ented example. # $ FreeBSD: src/usr. sbin/sysinstall/install. cfg, v 1.12.10.1.2.1 2009/10/25 01:10:29 kensmith Exp $ # Turn on extra debugging. debug = yes ################################# My host specific datahostname = crate. cdrom. comdomainname = cdrom. comnameserver = 204.216.27.3defaultrouter = Route = 204.216.27.230netmask = 255.255.255.240 ############################### # Which installation device to use-ftp is pointed directly at my local # machine and the installation device is my WD8013 ethernet interface. _ ftpPath = ftp://time.cdrom.com/pubnetDev=ed0mediaSetFTP ################################ Select which distributions we want. dists = base doc manpages info src sbase ssys kernels GENERICdistSetCustom ############################# #### Now set the parameters for the partition editor on da0. Set to use the # disk exclusively (cocould also be "all" to use the whole disk but # respecting the MBR or" free "to use only unallocated space for FreeBSD ). disk = da0partiti On = exclusivediskPartitionEditor # Uncomment this instead to use only the free space and install boot manager. # partition = free # bootManager = booteasy # diskPartitionEditor ############################## ### Disk partitioning. # All sizes are expressed in 512 byte blocks! # A 512 MB root partitionda0s1-1 = ufs 1048576/# And a 512 MB swap partitionda0s1-2 = swap 1048576 none # Followed by a/usr partition using all remaining space (size 0 = free space) # and with softupdates enabled (non-zero arg following mountpoint ). da0s1-3 = ufs 0/usr 1da0s2-1 = ufs 0/storage 1 # Let's do it! DiskLabelEditor ################################# Now partition the 2nd disk a 1 GB/var and/usr/src using the # remainder of the disk. disk = ad1partition = exclusivediskPartitionEditor ad1s1-1 = ufs 2097152/varad1s1-2 = ufs 0/usr/srcdiskLabelEditor ###################### ########## And the 3rd, adding a second 512 MB of swap and the rest of the disk # for/tmp. disk = da0partition = exclusivediskpartione Ditor da0s1-1 = swap 1048576 noneda0s1-2 = ufs 0/tmpdiskLabelEditor ############################# #### OK, everything is set. do it! InstallCommit # Install some packages at the end. package = bash-3.1.17packageAddpackage = ncftp-3.2.0packageAdd
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.