Difference between revisions of "Creating an Automated Installation with pc-sysinstall/9.2"

From PC-BSD Wiki
Jump to: navigation, search
(Create a Custom Installation Media or Installation Server)
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>{{NavHeader|back=Upgrading PC-BSD®|forward=Desktops}}</noinclude>
+
<noinclude><translate>
  
 +
<!--T:1-->
 +
{{NavHeader|back=Upgrading PC-BSD®|forward=Desktops}}</noinclude>
 +
 +
<!--T:2-->
 
PC-BSD® provides a set of Bourne shell scripts that allow advanced users to create automatic or customized PC-BSD® installations. '''pc-sysinstall''' is the name of the master script; it reads a customizable configuration file and uses dozens of backend scripts to perform the installation. You can read more about this utility by typing '''man pc-sysinstall'''.
 
PC-BSD® provides a set of Bourne shell scripts that allow advanced users to create automatic or customized PC-BSD® installations. '''pc-sysinstall''' is the name of the master script; it reads a customizable configuration file and uses dozens of backend scripts to perform the installation. You can read more about this utility by typing '''man pc-sysinstall'''.
  
 +
<!--T:3-->
 
Here is a quick overview of the components used by '''pc-sysinstall''':
 
Here is a quick overview of the components used by '''pc-sysinstall''':
  
 +
<!--T:4-->
 
* '''/usr/share/pc-sysinstall/backend/'''  contains the scripts used by the PC-BSD® installer. Scripts have been divided by function, such as ''functions-bsdlabel.sh'' and ''functions-installcomponents.sh''. If you have ever wondered how the PC-BSD® installer works, read through these scripts. This directory also contains the ''parseconfig.sh'' and ''startautoinstall.sh'' scripts which '''pc-sysinstall''' uses to parse the configuration file and begin the installation.
 
* '''/usr/share/pc-sysinstall/backend/'''  contains the scripts used by the PC-BSD® installer. Scripts have been divided by function, such as ''functions-bsdlabel.sh'' and ''functions-installcomponents.sh''. If you have ever wondered how the PC-BSD® installer works, read through these scripts. This directory also contains the ''parseconfig.sh'' and ''startautoinstall.sh'' scripts which '''pc-sysinstall''' uses to parse the configuration file and begin the installation.
  
 +
<!--T:5-->
 
* '''/usr/share/pc-sysinstall/backend-partmanager/''' contains the scripts which are used by the installer to create and delete partitions.
 
* '''/usr/share/pc-sysinstall/backend-partmanager/''' contains the scripts which are used by the installer to create and delete partitions.
  
 +
<!--T:6-->
 
* '''/usr/share/pc-sysinstall/backend-query/''' contains the scripts which are used by the installer to detect (e.g. ''detect-nics.sh'') and configure (e.g. ''enable-net.sh'') hardware.
 
* '''/usr/share/pc-sysinstall/backend-query/''' contains the scripts which are used by the installer to detect (e.g. ''detect-nics.sh'') and configure (e.g. ''enable-net.sh'') hardware.
  
 +
<!--T:7-->
 
* '''/usr/share/pc-sysinstall/components/''' contains FreeBSD ports and src and the PBIs for chromium, firefox, opera, and thunderbird.
 
* '''/usr/share/pc-sysinstall/components/''' contains FreeBSD ports and src and the PBIs for chromium, firefox, opera, and thunderbird.
  
 +
<!--T:8-->
 
* '''/usr/share/pc-sysinstall/conf/''' contains the configuration file ''pc-sysinstall.conf''. It also contains a file indicating which localizations are available (''avail-langs''), a list of files which are not touched during an upgrade (''exclude-from-upgrade''), and a ''license/'' subdirectory containing text files of applicable licenses (e.g. ''bsd-en.txt'' and ''nvidia-en.txt'').
 
* '''/usr/share/pc-sysinstall/conf/''' contains the configuration file ''pc-sysinstall.conf''. It also contains a file indicating which localizations are available (''avail-langs''), a list of files which are not touched during an upgrade (''exclude-from-upgrade''), and a ''license/'' subdirectory containing text files of applicable licenses (e.g. ''bsd-en.txt'' and ''nvidia-en.txt'').
  
 +
<!--T:9-->
 
* '''/usr/share/pc-sysinstall/doc/''' contains the help text that is seen if you run '''pc-sysinstall''' without any arguments.
 
* '''/usr/share/pc-sysinstall/doc/''' contains the help text that is seen if you run '''pc-sysinstall''' without any arguments.
  
 +
<!--T:10-->
 
* '''/usr/share/examples/pc-sysinstall/''' contains several example configuration files for different scenarios (e.g. ''upgrade'', ''fbsd-netinstall''). The ''README'' file in this directory should be considered as mandatory reading before using '''pc-sysinstall'''.
 
* '''/usr/share/examples/pc-sysinstall/''' contains several example configuration files for different scenarios (e.g. ''upgrade'', ''fbsd-netinstall''). The ''README'' file in this directory should be considered as mandatory reading before using '''pc-sysinstall'''.
  
 +
<!--T:11-->
 
* '''/usr/sbin/pc-sysinstall''' this is the script that is used to perform a customized installation.
 
* '''/usr/sbin/pc-sysinstall''' this is the script that is used to perform a customized installation.
  
 +
<!--T:12-->
 
To create a custom installation, perform the following steps:
 
To create a custom installation, perform the following steps:
  
 +
<!--T:13-->
 
# [[#Determine which variables you wish to customize|Determine which variables you wish to customize]].<br>
 
# [[#Determine which variables you wish to customize|Determine which variables you wish to customize]].<br>
 
# [[#Create a customized configuration|Create a customized configuration]].<br>
 
# [[#Create a customized configuration|Create a customized configuration]].<br>
 
# [[#Create a custom installation media|Create a custom installation media]].<br>
 
# [[#Create a custom installation media|Create a custom installation media]].<br>
  
 +
<!--T:14-->
 
These steps are discussed in more detail below.
 
These steps are discussed in more detail below.
  
== Determine Which Variables you Wish to Customize ==
+
== Determine Which Variables you Wish to Customize == <!--T:15-->
  
 +
<!--T:16-->
 
A list of possible variables can be found in ''/usr/share/examples/pc-sysinstall/README'' and in Table 5.5a. Note that the Table is meant as a quick reference to determine which variables are available. The ''README'' file contains more complete descriptions for each variable.  
 
A list of possible variables can be found in ''/usr/share/examples/pc-sysinstall/README'' and in Table 5.5a. Note that the Table is meant as a quick reference to determine which variables are available. The ''README'' file contains more complete descriptions for each variable.  
  
  
 +
<!--T:17-->
 
{{tbl-init|caption=5.5a: Available Variables for Customizing a PC-BSD® Installation}}
 
{{tbl-init|caption=5.5a: Available Variables for Customizing a PC-BSD® Installation}}
{{tbl-title|width=20%|Variable}}
+
!width=20%|Variable
{{tbl-title|Options}}
+
!Options
{{tbl-title|Description}}
+
!Description
 
|-
 
|-
{{tbl-cell|row=1|content=hostname=}}
+
|hostname=||should be unique for the network||optional as installer will auto-generate a hostname if empty
{{tbl-cell|row=1|should be unique for the network}}
+
{{tbl-cell|row=1|optional as installer will auto-generate a hostname if empty}}
+
 
|-
 
|-
{{tbl-cell|row=2|content=installMode=}}
+
|installMode=||fresh, upgrade, or extract||sets the installation type
{{tbl-cell|row=2|fresh, upgrade, or extract}}
+
{{tbl-cell|row=2|sets the installation type}}
+
 
|-
 
|-
{{tbl-cell|row=3|content=installLocation=}}
+
|installLocation=||/path/to/location||used only when installMode is extract and should point to an already mounted location
{{tbl-cell|row=3|/path/to/location}}
+
{{tbl-cell|row=3|used only when installMode is extract and should point to an already mounted location}}
+
 
|-
 
|-
{{tbl-cell|row=4|content=installInteractive=}}
+
|installInteractive=||yes or no||set to no for automated installs without user input
{{tbl-cell|row=4|yes or no}}
+
{{tbl-cell|row=4|set to no for automated installs without user input}}
+
 
|-
 
|-
{{tbl-cell|row=5|content=netDev=}}
+
|netDev=||AUTO-DHCP or FreeBSD interface name||type of network connection to use during the installation
{{tbl-cell|row=5|AUTO-DHCP or FreeBSD interface name}}
+
{{tbl-cell|row=5|type of network connection to use during the installation}}
+
 
|-
 
|-
{{tbl-cell|row=6|content=netIP=|other=padding-left: 24px;}}
+
|netIP=||IP address of interface used during installation||only use if ''netDev'' is set to an interface name
{{tbl-cell|row=6|IP address of interface used during installation}}
+
{{tbl-cell|row=6|content=only use if ''netDev'' is set to an interface name}}
+
 
|-
 
|-
{{tbl-cell|row=7|content=netMask=|other=padding-left: 24px;}}
+
|netMask=||subnet mask of interface||only use if netDev is set to an interface name
{{tbl-cell|row=7|subnet mask of interface}}
+
{{tbl-cell|row=7|content=only use if netDev is set to an interface name}}
+
 
|-
 
|-
{{tbl-cell|row=8|content=netNameServer=|other=padding-left: 24px;}}
+
|netNameServer=||IP address of DNS server||only use if netDev is set to an interface name
{{tbl-cell|row=8|IP address of DNS server}}
+
{{tbl-cell|row=8|content=only use if netDev is set to an interface name}}
+
 
|-
 
|-
{{tbl-cell|row=9|content=netDefaultRouter=|other=padding-left: 24px;}}
+
|netDefaultRouter=||IP address of default gateway||only use if netDev is set to an interface name
{{tbl-cell|row=9|IP address of default gateway}}
+
{{tbl-cell|row=9|content=only use if netDev is set to an interface name}}
+
 
|-
 
|-
{{tbl-cell|row=10|content=netSaveDev=}}
+
|netSaveDev=||AUTO-DHCP or FreeBSD interface name(s) (multiple allowed separated by spaces)||type of network configuration to enable on the installed system; can set multiple interfaces
{{tbl-cell|row=10|AUTO-DHCP or FreeBSD interface name(s) (multiple allowed separated by spaces)}}
+
{{tbl-cell|row=10|content=type of network configuration to enable on the installed system; can set multiple interfaces}}
+
 
|-
 
|-
{{tbl-cell|row=11|content=netSaveIP=|other=padding-left: 24px;}}
+
|netSaveIP=||IP address of interface ''<interface_name>'' or DHCP||only use if netSaveDev is set to an interface name or a list of interface names (repeat for each interface)
{{tbl-cell|row=11|IP address of interface ''<interface_name>'' or DHCP}}
+
{{tbl-cell|row=11|content=only use if netSaveDev is set to an interface name or a list of interface names (repeat for each interface)}}
+
 
|-
 
|-
{{tbl-cell|row=12|content=netSaveMask=}}
+
|netSaveMask=||subnet mask of interface ''<interface_name>''||only use if netSaveDev is set to an interface name or a list of interface names (repeat for each interface)
{{tbl-cell|row=12|subnet mask of interface ''<interface_name>''}}
+
{{tbl-cell|row=12|content=only use if netSaveDev is set to an interface name or a list of interface names (repeat for each interface)}}
+
 
|-
 
|-
{{tbl-cell|row=13|content=netSaveNameServer=}}
+
|netSaveNameServer=||IP address of DNS server (multiple allowed separated by spaces)||only use if netSaveDev= is set to an interface name or a list of interface names (do not repeat for each interface)
{{tbl-cell|row=13|IP address of DNS server (multiple allowed separated by spaces)}}
+
{{tbl-cell|row=13|content=only use if netSaveDev= is set to an interface name or a list of interface names (do not repeat for each interface)}}
+
 
|-
 
|-
{{tbl-cell|row=14|content=netSaveDefaultRouter=}}
+
|netSaveDefaultRouter=||IP address of default gateway||only use if netSaveDev= is set to an interface name or a list of interface names (do not repeat for each interface)
{{tbl-cell|row=14|IP address of default gateway}}
+
{{tbl-cell|row=14|content=only use if netSaveDev= is set to an interface name or a list of interface names (do not repeat for each interface)}}
+
 
|-
 
|-
{{tbl-cell|row=15|content=disk0=}}
+
|disk0=||FreeBSD disk device Name, (e.g. ''ad0'')||see ''README'' for examples
{{tbl-cell|row=15|FreeBSD disk device Name, (e.g. ''ad0'')}}
+
{{tbl-cell|row=15|see ''README'' for examples}}
+
 
|-
 
|-
{{tbl-cell|row=16|content=partition=}}
+
|partition=||all, free, s1, s2, s3, s4, image||see ''README'' for examples
{{tbl-cell|row=16|content=all, free, s1, s2, s3, s4, image}}
+
{{tbl-cell|row=16|content=see ''README'' for examples}}
+
 
|-
 
|-
{{tbl-cell|row=17|content=partscheme=}}
+
|partscheme=||MBR or GPT||partition scheme type
{{tbl-cell|row=17|content=MBR or GPT}}
+
{{tbl-cell|row=17|content=partition scheme type}}
+
 
|-
 
|-
{{tbl-cell|row=18|content=mirror=}}
+
|mirror=||FreeBSD disk device name (e.g. ''ad1'')||sets the target disk for the mirror (i.e. the second disk)
{{tbl-cell|row=18|content=FreeBSD disk device name (e.g. ''ad1'')}}
+
{{tbl-cell|row=18|content=sets the target disk for the mirror (i.e. the second disk)}}
+
 
|-
 
|-
{{tbl-cell|row=19|content=mirrorbal=}}
+
|rmirrorbal=||load, prefer, round-robin, split||defaults to round-robin if the mirror balance method is not specified
{{tbl-cell|row=19|content=load, prefer, round-robin, split}}
+
{{tbl-cell|row=19|content=defaults to round-robin if the mirror balance method is not specified}}
+
 
|-
 
|-
{{tbl-cell|row=20|content=bootManager=}}
+
|rbootManager=||none, bsd||whether or not to install the FreeBSD boot manager
{{tbl-cell|row=20|content=none, bsd}}
+
{{tbl-cell|row=20|content=whether or not to install the FreeBSD boot manager}}
+
 
|-
 
|-
{{tbl-cell|row=21|content=image=}}
+
|image=||/path/to/image||will write specified image file
{{tbl-cell|row=21|content=/path/to/image}}
+
{{tbl-cell|row=21|content=will write specified image file}}
+
 
|-
 
|-
{{tbl-cell|row=22|content=commitDiskPart}}
+
|commitDiskPart|| ||this variable is mandatory and must be placed at the end of each diskX= section; create a diskX= section for each disk you wish to configure.
{{tbl-cell|row=22|content=}}
+
{{tbl-cell|row=22|content=this variable is mandatory and must be placed at the end of each diskX= section; create a diskX= section for each disk you wish to configure. }}
+
 
|-
 
|-
{{tbl-cell|row=23|content=encpass=}}
+
|encpass=||password value||at boot time, system will prompt for this password in order to mount the associated GELI encrypted partition
{{tbl-cell|row=23|content=password value}}
+
{{tbl-cell|row=23|content=at boot time, system will prompt for this password in order to mount the associated GELI encrypted partition}}
+
 
|-
 
|-
{{tbl-cell|row=24|content=commitDiskLabel}}
+
|commitDiskLabel|| ||this variable is mandatory and must be placed at the end of disk's partitioning settings; see the ''README'' for examples on how to set the <File System Type> <Size> <Mountpoint> entries for each disk
{{tbl-cell|row=24|content=}}
+
{{tbl-cell|row=24|content=this variable is mandatory and must be placed at the end of disk's partitioning settings; see the ''README'' for examples on how to set the <File System Type> <Size> <Mountpoint> entries for each disk}}
+
 
|-
 
|-
{{tbl-cell|row=25|content=installMedium=}}
+
|installMedium=||dvd, local, usb, ftp, rsync, image||source to be used for installation
{{tbl-cell|row=25|content=dvd, local, usb, ftp, rsync, image}}
+
{{tbl-cell|row=25|content=source to be used for installation}}
+
 
|-
 
|-
{{tbl-cell|row=26|content=localPath=}}
+
|localPath=||e.g. usr/freebsd-dist||location of the directory containing the installation files when using installMedium=local
{{tbl-cell|row=26|content=e.g. usr/freebsd-dist}}
+
{{tbl-cell|row=26|content=location of the directory containing the installation files when using installMedium=local}}
+
 
|-
 
|-
{{tbl-cell|row=27|content=installType=}}
+
|installType=||PCBSD, FreeBSD||determines whether this is a desktop or a server install
{{tbl-cell|row=27|content=PCBSD, FreeBSD}}
+
{{tbl-cell|row=27|content=determines whether this is a desktop or a server install}}
+
 
|-
 
|-
{{tbl-cell|row=28|content=installFile=}}
+
|installFile=||e.g. fbsd-release.tbz||only set if using a customized installer archive
{{tbl-cell|row=28|content=e.g. fbsd-release.tbz}}
+
{{tbl-cell|row=28|content=only set if using a customized installer archive}}
+
 
|-
 
|-
{{tbl-cell|row=29|content=packageType=}}
+
|packageType=||tar, uzip, split, dist||the archive type on the installation media
{{tbl-cell|row=29|content=tar, uzip, split, dist}}
+
{{tbl-cell|row=29|content=the archive type on the installation media}}
+
 
|-
 
|-
{{tbl-cell|row=30|content=ftpPath=}}
+
|ftpPath=||e.g. {{ftp}}ftp.pcbsd.org/pub/mirror/9.1/amd64/netinstall/||location of the installer archive when using installMedium=ftp
{{tbl-cell|row=30|content=e.g. <nowiki>ftp://ftp.pcbsd.org/pub/mirror/9.1/amd64/netinstall/</nowiki>}}
+
{{tbl-cell|row=30|content=location of the installer archive when using installMedium=ftp}}
+
 
|-
 
|-
{{tbl-cell|row=31|content=rsyncPath=}}
+
|rsyncPath=||e.g. life-preserver/back-2011-09-12T14_53_14||location of the rsync data on the remote server when using installMedium=rsync
{{tbl-cell|row=31|content=e.g. life-preserver/back-2011-09-12T14_53_14}}
+
{{tbl-cell|row=31|content=location of the rsync data on the remote server when using installMedium=rsync}}
+
 
|-
 
|-
{{tbl-cell|row=32|content=rsyncUser=}}
+
|rsyncUser=||username||set when using installMedium=rsync
{{tbl-cell|row=32|content=username}}
+
{{tbl-cell|row=32|content=set when using installMedium=rsync}}
+
 
|-
 
|-
{{tbl-cell|row=33|content=rsyncHost=}}
+
|rsyncHost=||IP address of rsync server||set when using installMedium=rsync
{{tbl-cell|row=33|content=IP address of rsync server}}
+
{{tbl-cell|row=33|content=set when using installMedium=rsync}}
+
 
|-
 
|-
{{tbl-cell|row=34|content=rsyncPort=}}
+
|rsyncPort=||port number||set when using installMedium=rsync
{{tbl-cell|row=34|content=port number}}
+
{{tbl-cell|row=34|content=set when using installMedium=rsync}}
+
 
|-
 
|-
{{tbl-cell|row=35|content=installComponents=}}
+
|installComponents=||e.g. amarok,firefox,ports||components must exist in ''/PCBSD/pc-sysinstall/components/''
{{tbl-cell|row=35|content=e.g. amarok,firefox,ports}}
+
{{tbl-cell|row=35|content=components must exist in ''/PCBSD/pc-sysinstall/components/''}}
+
 
|-
 
|-
{{tbl-cell|row=36|content=upgradeKeepDesktopProfile=}}
+
|upgradeKeepDesktopProfile=||yes or no||specify if you wish to keep your existing user's desktop profile data during an upgrade
{{tbl-cell|row=36|content=yes or no}}
+
{{tbl-cell|row=36|content=specify if you wish to keep your existing user's desktop profile data during an upgrade }}
+
 
|-
 
|-
{{tbl-cell|row=37|content=rootPass=}}
+
|rootPass=||password||set the root password of the installed system to the specified string
{{tbl-cell|row=37|content=password}}
+
{{tbl-cell|row=37|content=set the root password of the installed system to the specified string}}
+
 
|-
 
|-
{{tbl-cell|row=38|content=rootEncPass=}}
+
||rootEncPass=||encrypted string||set root password to specified encrypted string
{{tbl-cell|row=38|content=encrypted string}}
+
{{tbl-cell|row=38|content=set root password to specified encrypted string}}
+
 
|-
 
|-
{{tbl-cell|row=39|content=userName=}}
+
||userName=||case sensitive value||create a separate block of user values for each user you wish to create
{{tbl-cell|row=39|content=case sensitive value}}
+
{{tbl-cell|row=39|content=create a separate block of user values for each user you wish to create}}
+
 
|-
 
|-
{{tbl-cell|row=40|content=userComment=}}
+
||userComment=||description||description text can include spaces
{{tbl-cell|row=40|content=description}}
+
{{tbl-cell|row=40|content=description text can include spaces}}
+
 
|-
 
|-
{{tbl-cell|row=41|content=userPass=}}
+
|userPass=||case sensitive value|password of user
{{tbl-cell|row=41|content=case sensitive value}}
+
{{tbl-cell|row=41|content=password of user}}
+
 
|-
 
|-
{{tbl-cell|row=42|content=userEncPass}}
+
|userEncPass||encrypted string||set user password to specified encrypted string
{{tbl-cell|row=42|content=encrypted string}}
+
{{tbl-cell|row=42|content=set user password to specified encrypted string}}
+
 
|-
 
|-
{{tbl-cell|row=43|content=userShell=}}
+
|userShell=||e.g. ''/bin/csh''||path to default shell
{{tbl-cell|row=43|content=e.g. ''/bin/csh''}}
+
{{tbl-cell|row=43|content=path to default shell}}
+
 
|-
 
|-
{{tbl-cell|row=44|content=userHome=}}
+
|userHome=||e.g. ''/home/username''||path to home directory
{{tbl-cell|row=44|content=e.g. ''/home/username''}}
+
{{tbl-cell|row=44|content=path to home directory}}
+
 
|-
 
|-
{{tbl-cell|row=45|content=userGroups=}}
+
|userGroups=||e.g. wheel,operator||comma separated (no spaces) list of groups
{{tbl-cell|row=45|content=e.g. wheel,operator}}
+
{{tbl-cell|row=45|content=comma separated (no spaces) list of groups}}
+
 
|-
 
|-
{{tbl-cell|row=46|content=commitUser}}
+
|commitUser|| ||mandatory, must be last line in each user block
{{tbl-cell|row=46|content=}}
+
{{tbl-cell|row=46|content=mandatory, must be last line in each user block}}
+
 
|-
 
|-
{{tbl-cell|row=47|content=runCommand=}}
+
|runCommand=||path to command||run the specified command within chroot of the installed system, after the installation is complete
{{tbl-cell|row=47|content=path to command}}
+
{{tbl-cell|row=47|content=run the specified command within chroot of the installed system, after the installation is complete}}
+
 
|-
 
|-
{{tbl-cell|row=48|content=runScript=}}
+
|runScript=||path to script||runs specified script within chroot of the installed system, after the installation is complete
{{tbl-cell|row=48|content=path to script}}
+
{{tbl-cell|row=48|content=runs specified script within chroot of the installed system, after the installation is complete}}
+
 
|-
 
|-
{{tbl-cell|row=49|content=runExtCommand=}}
+
|runExtCommand=||path to command||runs a command outside the chroot
{{tbl-cell|row=49|content=path to command}}
+
{{tbl-cell|row=49|content=runs a command outside the chroot}}
+
 
|-
 
|-
{{tbl-cell|row=50|content=timeZone=}}
+
|timeZone=||e.g. America/New_York||location must exist in ''/usr/share/zoneinfo/''
{{tbl-cell|row=50|content=e.g. America/New_York}}
+
{{tbl-cell|row=50|content=location must exist in ''/usr/share/zoneinfo/''}}
+
 
|-
 
|-
{{tbl-cell|row=51|content=enableNTP=}}
+
|enableNTP=||yes or no||enable/disable NTP
{{tbl-cell|row=51|content=yes or no}}
+
{{tbl-cell|row=51|content=enable/disable NTP}}
+
 
|-
 
|-
{{tbl-cell|row=52|content=localizeLang=}}
+
|localizeLang=||e.g. en||sets the system console and Desktop to the target language
{{tbl-cell|row=52|content=e.g. en}}
+
{{tbl-cell|row=52|content=sets the system console and Desktop to the target language}}
+
 
|-
 
|-
{{tbl-cell|row=53|content=localizeKeyLayout=}}
+
|localizeKeyLayout=||e.g. en||updates the system's Xorg config to set the keyboard layout
{{tbl-cell|row=53|content=e.g. en}}
+
{{tbl-cell|row=53|content=updates the system's Xorg config to set the keyboard layout}}
+
 
|-
 
|-
{{tbl-cell|row=54|content=localizeKeyModel=}}
+
|localizeKeyModel=||e.g. pc104||updates the system's Xorg config to set the keyboard model
{{tbl-cell|row=54|content=e.g. pc104}}
+
{{tbl-cell|row=54|content=updates the system's Xorg config to set the keyboard model}}
+
 
|-
 
|-
{{tbl-cell|row=55|content=localizeKeyVariant=}}
+
|localizeKeyVariant=||e.g. intl||updates the Xorg config to set the keyboard variant
{{tbl-cell|row=55|content=e.g. intl}}
+
{{tbl-cell|row=55|content=updates the Xorg config to set the keyboard variant}}
+
 
|-
 
|-
{{tbl-cell|row=56|content=autoLoginUser=}}
+
|autoLoginUser=||username||user will be logged in automatically without entering a password
{{tbl-cell|row=56|content=username}}
+
{{tbl-cell|row=56|content=user will be logged in automatically without entering a password}}
+
 
|}
 
|}
  
== Create a Customized Configuration ==
+
== Create a Customized Configuration == <!--T:18-->
  
 +
<!--T:19-->
 
One way to create this file is to read through the configuration examples in ''/usr/share/examples/pc-sysinstall/'' to find the one that most closely matches your needs. Copy that file (to any location) and customize it so that it includes the variables and values you would like to use in your installation.
 
One way to create this file is to read through the configuration examples in ''/usr/share/examples/pc-sysinstall/'' to find the one that most closely matches your needs. Copy that file (to any location) and customize it so that it includes the variables and values you would like to use in your installation.
  
 +
<!--T:20-->
 
An alternate way to create this file is to perform an installation of the version that you wish to customize. The installer will automatically create a file containing the settings you selected during the installation to ''/root/pc-sysinstall.cfg.'' You can use that configuration file as-is, or customize it to meet an installation's needs. This method may prove easier to use if you are performing complex disk layouts.
 
An alternate way to create this file is to perform an installation of the version that you wish to customize. The installer will automatically create a file containing the settings you selected during the installation to ''/root/pc-sysinstall.cfg.'' You can use that configuration file as-is, or customize it to meet an installation's needs. This method may prove easier to use if you are performing complex disk layouts.
  
 +
<!--T:21-->
 
Here is a sample configuration:
 
Here is a sample configuration:
  
{{txtbox|pre|width=85%|box={{pound}} Sample configuration file for an installation using pc-sysinstall
+
<!--T:22-->
 +
{{txtbox|box={{pound}} Sample configuration file for an installation using pc-sysinstall
  
 +
<!--T:23-->
 
installMode=fresh
 
installMode=fresh
 
installInteractive=no
 
installInteractive=no
 
hostname=myhost.mydomain.com
 
hostname=myhost.mydomain.com
  
 +
<!--T:24-->
 
{{pound}} Set the disk parameters - 1st disk
 
{{pound}} Set the disk parameters - 1st disk
 
disk0=da0
 
disk0=da0
Line 284: Line 196:
 
commitDiskPart
 
commitDiskPart
  
 +
<!--T:25-->
 
{{pound}} Set the disk parameters - 2nd disk
 
{{pound}} Set the disk parameters - 2nd disk
 
disk1=da1
 
disk1=da1
Line 290: Line 203:
 
commitDiskPart
 
commitDiskPart
  
 +
<!--T:26-->
 
{{pound}} Setup the disk label - 1st disk
 
{{pound}} Setup the disk label - 1st disk
 
{{pound}} All sizes are expressed in MB
 
{{pound}} All sizes are expressed in MB
Line 302: Line 216:
 
commitDiskLabel
 
commitDiskLabel
  
 +
<!--T:27-->
 
{{pound}} Setup the disk label - 2nd disk
 
{{pound}} Setup the disk label - 2nd disk
 
{{pound}} All sizes are expressed in MB
 
{{pound}} All sizes are expressed in MB
Line 312: Line 227:
 
commitDiskLabel
 
commitDiskLabel
  
 +
<!--T:28-->
 
netDev=em1
 
netDev=em1
 
netIP=172.16.80.250
 
netIP=172.16.80.250
Line 325: Line 241:
 
netSaveDefaultRouter=192.168.100.1
 
netSaveDefaultRouter=192.168.100.1
  
 +
<!--T:29-->
 
{{pound}} Set if we are installing via optical, USB, or FTP
 
{{pound}} Set if we are installing via optical, USB, or FTP
 
installType=FreeBSD
 
installType=FreeBSD
Line 331: Line 248:
 
packageType=tar
 
packageType=tar
  
 +
<!--T:30-->
 
{{pound}} List our components to install
 
{{pound}} List our components to install
 
{{pound}}installComponents=ports,src
 
{{pound}}installComponents=ports,src
  
 +
<!--T:31-->
 
{{pound}} Set the root pass
 
{{pound}} Set the root pass
 
rootPass=root
 
rootPass=root
  
 +
<!--T:32-->
 
{{pound}} Setup our users
 
{{pound}} Setup our users
 
userName=demo
 
userName=demo
Line 345: Line 265:
 
commitUser
 
commitUser
  
 +
<!--T:33-->
 
{{pound}} Set up date/time
 
{{pound}} Set up date/time
 
runCommand=cp /usr/share/zoneinfo/EST5EDT /etc/localtime
 
runCommand=cp /usr/share/zoneinfo/EST5EDT /etc/localtime
Line 350: Line 271:
 
runCommand=adjkerntz -a
 
runCommand=adjkerntz -a
  
 +
<!--T:34-->
 
{{pound}} Install packages required for VMware Tools installation/configuration
 
{{pound}} Install packages required for VMware Tools installation/configuration
 
runCommand=pkg_add -r compat6x-amd64
 
runCommand=pkg_add -r compat6x-amd64
Line 357: Line 279:
 
runCommand=pkg_add -r sysrc
 
runCommand=pkg_add -r sysrc
  
 +
<!--T:35-->
 
{{pound}} Fetch/install VMware Tools
 
{{pound}} Fetch/install VMware Tools
 
runCommand=fetch -o /tmp/vmtools.tar.gz {{http}}pkgbuilder.mydomain.com/images/freebsd/vmware-freebsd-tools.tar.gz
 
runCommand=fetch -o /tmp/vmtools.tar.gz {{http}}pkgbuilder.mydomain.com/images/freebsd/vmware-freebsd-tools.tar.gz
Line 366: Line 289:
 
runCommand=/usr/local/bin/puppet agent -t}}
 
runCommand=/usr/local/bin/puppet agent -t}}
  
 +
<!--T:36-->
 
If you wish to perform a fully-automated installation that does not prompt for any user input, you will also need to review ''/usr/share/examples/pc-sysinstall/pc-autoinstall.conf'' and place a customized copy of that file into ''/boot/pc-autoinstall.conf'' on your installation media.
 
If you wish to perform a fully-automated installation that does not prompt for any user input, you will also need to review ''/usr/share/examples/pc-sysinstall/pc-autoinstall.conf'' and place a customized copy of that file into ''/boot/pc-autoinstall.conf'' on your installation media.
  
 +
<!--T:37-->
 
Table 5.5b summarizes the additional variables that are available for fully automatic installations. More detailed descriptions can be found in the ''/usr/share/examples/pc-sysinstall/pc-autoinstall.conf'' file. Note that the variables in this file use a different syntax than those in Table 5.5a, in that the values follow a colon and a space rather than an equal sign.
 
Table 5.5b summarizes the additional variables that are available for fully automatic installations. More detailed descriptions can be found in the ''/usr/share/examples/pc-sysinstall/pc-autoinstall.conf'' file. Note that the variables in this file use a different syntax than those in Table 5.5a, in that the values follow a colon and a space rather than an equal sign.
  
  
 +
<!--T:38-->
 
{{tbl-init|caption=5.5b: Additional Variables for Automated Installations}}
 
{{tbl-init|caption=5.5b: Additional Variables for Automated Installations}}
{{tbl-title|Variable}}
+
!Variable
{{tbl-title|Options}}
+
!Options
{{tbl-title|Description}}
+
!Description
 
|-
 
|-
{{tbl-cellw|pc_config}}
+
|pc_config||URL or /path/to/file||location of customized ''pc-sysinstall.conf''
{{tbl-cellw|URL or /path/to/file}}
+
{{tbl-cellw|location of customized ''pc-sysinstall.conf''}}
+
 
|-
 
|-
{{tbl-cellg|confirm_install}}
+
|confirm_install||yes or no||should be set to yes, otherwise booting the wrong disk will result in a system wipe
{{tbl-cellg|yes or no}}
+
{{tbl-cellg|should be set to yes, otherwise booting the wrong disk will result in a system wipe}}
+
 
|-
 
|-
{{tbl-cellw|shutdown_cmd}}
+
|shutdown_cmd||e.g. '''shutdown -p now'''||good idea to run a shutdown, but can be any command/script you wish to execute post-install
{{tbl-cellw|e.g. '''shutdown -p now'''}}
+
{{tbl-cellw|good idea to run a shutdown, but can be any command/script you wish to execute post-install}}
+
 
|-
 
|-
{{tbl-cellg|nic_config}}
+
|nic_config||dhcp-all or <interface name> <IP address> <subnet mask>||will attempt dhcp on all found NICs until the installation file can be fetched or will setup specified interface
{{tbl-cellg|dhcp-all or <interface name> <IP address> <subnet mask>}}
+
{{tbl-cellg|will attempt dhcp on all found NICs until the installation file can be fetched or will setup specified interface}}
+
 
|-
 
|-
{{tbl-cellw|nic_dns}}
+
|nic_dns||IP address|DNS server to use
{{tbl-cellw|IP address}}
+
{{tbl-cellw|DNS server to use}}
+
|-
+
{{tbl-cellg|nic_gateway}}
+
{{tbl-cellg|IP address}}
+
{{tbl-cellg|default gateway to use}}
+
 
|-
 
|-
 +
|nic_gateway||IP address||default gateway to use
 
|}
 
|}
  
 +
<!--T:39-->
 
Here is a sample ''pc-autoinstall.conf'' file:
 
Here is a sample ''pc-autoinstall.conf'' file:
  
{{txtbox|pre|width=54%|box={{pound}} pc-autoinstall.conf example
+
<!--T:40-->
 +
{{txtbox|box={{pound}} pc-autoinstall.conf example
 
{{pound}}
 
{{pound}}
 
{{pound}} Usage: Modify these variables, and copy the file to
 
{{pound}} Usage: Modify these variables, and copy the file to
Line 413: Line 328:
 
<nowiki>##################################################################</nowiki>
 
<nowiki>##################################################################</nowiki>
  
 +
<!--T:41-->
 
{{pound}} Where the pc-sysinstall main config is located
 
{{pound}} Where the pc-sysinstall main config is located
 
{{pound}} Can be either a file on the booted CD / DVD / USB media,
 
{{pound}} Can be either a file on the booted CD / DVD / USB media,
Line 422: Line 338:
 
<nowiki>##################################################################</nowiki>
 
<nowiki>##################################################################</nowiki>
  
 +
<!--T:42-->
 
{{pound}} Examples:
 
{{pound}} Examples:
 
{{pound}} pc_config: {{ftp}}192.168.0.2/cust-install.cfg
 
{{pound}} pc_config: {{ftp}}192.168.0.2/cust-install.cfg
Line 430: Line 347:
 
{{http}}pkgbuilder.mydomain.com/images/freebsd/pc-sysinstall.cfg>
 
{{http}}pkgbuilder.mydomain.com/images/freebsd/pc-sysinstall.cfg>
  
 +
<!--T:43-->
 
{{pound}} Set this to yes if we should confirm before doing an install
 
{{pound}} Set this to yes if we should confirm before doing an install
 
{{pound}} This should normally be set to yes, otherwise booting the wrong
 
{{pound}} This should normally be set to yes, otherwise booting the wrong
Line 435: Line 353:
 
confirm_install: no
 
confirm_install: no
  
 +
<!--T:44-->
 
{{pound}} Set the command to run post-install, usually best to run shutdown
 
{{pound}} Set the command to run post-install, usually best to run shutdown
 
{{pound}} but this can be replaced with any other command / script you wish
 
{{pound}} but this can be replaced with any other command / script you wish
Line 440: Line 359:
 
shutdown_cmd: shutdown -r now<br>
 
shutdown_cmd: shutdown -r now<br>
  
 +
<!--T:45-->
 
{{pound}} Options for the network setup, should the cfg need to be fetched
 
{{pound}} Options for the network setup, should the cfg need to be fetched
 
{{pound}} from a remote location, only necessary when using ftp or http
 
{{pound}} from a remote location, only necessary when using ftp or http
 
<nowiki>##################################################################</nowiki>
 
<nowiki>##################################################################</nowiki>
  
 +
<!--T:46-->
 
{{pound}} Special option, will attempt dhcp on all found NICs
 
{{pound}} Special option, will attempt dhcp on all found NICs
 
{{pound}} until the file can be fetched, or we run out of interfaces
 
{{pound}} until the file can be fetched, or we run out of interfaces
 
{{pound}} nic_config: dhcp-all
 
{{pound}} nic_config: dhcp-all
  
 +
<!--T:47-->
 
{{pound}} Line to be passed to the "ifconfig" command to bring up an interface
 
{{pound}} Line to be passed to the "ifconfig" command to bring up an interface
 
nic_config: em1 172.16.80.250 255.255.240.0
 
nic_config: em1 172.16.80.250 255.255.240.0
  
 +
<!--T:48-->
 
{{pound}} DNS server to use
 
{{pound}} DNS server to use
 
nic_dns: 172.16.80.1
 
nic_dns: 172.16.80.1
  
 +
<!--T:49-->
 
{{pound}} Default router / gateway
 
{{pound}} Default router / gateway
 
nic_gateway: 172.16.80.1}}
 
nic_gateway: 172.16.80.1}}
  
== Create a Custom Installation Media or Installation Server ==
+
== Create a Custom Installation Media or Installation Server == <!--T:50-->
  
 +
<!--T:51-->
 
'''pc-sysinstall''' supports the following installation methods:  
 
'''pc-sysinstall''' supports the following installation methods:  
  
 +
<!--T:52-->
 
* from a CD, DVD, or USB media  
 
* from a CD, DVD, or USB media  
  
 +
<!--T:53-->
 
* from an installation directory on an HTTP, FTP, SSH+rsync, or a [[Thin_Client#Creating a PXE Boot Install Server|PXE Boot Install]] server
 
* from an installation directory on an HTTP, FTP, SSH+rsync, or a [[Thin_Client#Creating a PXE Boot Install Server|PXE Boot Install]] server
  
 +
<!--T:54-->
 
The easiest way to create a custom installation media is to modify an existing installation image. For example, if you have downloaded an ISO for the PC-BSD® version that you wish to customize, the superuser can access the contents of the ISO as follows:
 
The easiest way to create a custom installation media is to modify an existing installation image. For example, if you have downloaded an ISO for the PC-BSD® version that you wish to customize, the superuser can access the contents of the ISO as follows:
  
{{txtbox|pre|box='''mdconfig -a -t vnode -f PCBSD9.0-x86-DVD.iso -u 1'''
+
<!--T:55-->
 +
{{txtbox|box='''mdconfig -a -t vnode -f PCBSD9.0-x86-DVD.iso -u 1'''
 
'''mount -t cd9660 /dev/md1 /mnt'''}}
 
'''mount -t cd9660 /dev/md1 /mnt'''}}
 
   
 
   
Make sure you have '''cd''' 'd into a directory where you would like to copy the contents of the ISO. In the following examples, ''/tmp/custominstall/'' was created for this purpose:
+
Make sure you have changed into a directory (use '''cd''') where you would like to copy the contents of the ISO. In the following examples, ''/tmp/custominstall/'' was created as the directory for this purpose:
  
{{txtbox|pre|box='''cd /tmp/custominstall'''
+
<!--T:56-->
 +
{{txtbox|box='''cd /tmp/custominstall'''
 
'''tar -C /mnt -cf - . {{!}} tar -xvf -'''
 
'''tar -C /mnt -cf - . {{!}} tar -xvf -'''
 
'''umount /mnt'''}}
 
'''umount /mnt'''}}
  
 +
<!--T:57-->
 
Alternately, if you have inserted an installation CD or DVD, you can mount the media and copy its contents to your desired directory:
 
Alternately, if you have inserted an installation CD or DVD, you can mount the media and copy its contents to your desired directory:
  
{{txtbox|pre|box='''mount -t cd9660 /dev/cd0 /mnt'''
+
<!--T:58-->
 +
{{txtbox|box='''mount -t cd9660 /dev/cd0 /mnt'''
 
'''cp -R /mnt/* /tmp/custominstall/'''
 
'''cp -R /mnt/* /tmp/custominstall/'''
 
'''umount /mnt'''}}
 
'''umount /mnt'''}}
  
 +
<!--T:59-->
 
If you are creating an automated installation, copy your customized ''pc-autoinstall.conf'' to ''/tmp/custominstall/boot/''.
 
If you are creating an automated installation, copy your customized ''pc-autoinstall.conf'' to ''/tmp/custominstall/boot/''.
  
 +
<!--T:60-->
 
Copy your customized configuration file to ''/tmp/custominstall/''. Double-check that the "installMedium=" variable in your customized configuration file is set to the type of media that you will be installing from.
 
Copy your customized configuration file to ''/tmp/custominstall/''. Double-check that the "installMedium=" variable in your customized configuration file is set to the type of media that you will be installing from.
  
 +
<!--T:61-->
 
You may also need to add some extra files if you set the following variables in your custom configuration file:
 
You may also need to add some extra files if you set the following variables in your custom configuration file:
  
 +
<!--T:62-->
 
* '''installComponents=''' make sure that any extra components you wish to install exist in ''extras/PBI/'' (if they end in the ''.pbi'' extension) or ''extras/components/'' (if they end in ''.tbz'')
 
* '''installComponents=''' make sure that any extra components you wish to install exist in ''extras/PBI/'' (if they end in the ''.pbi'' extension) or ''extras/components/'' (if they end in ''.tbz'')
  
 +
<!--T:63-->
 
* '''runCommand=''' make sure the command exists in the specified path
 
* '''runCommand=''' make sure the command exists in the specified path
  
 +
<!--T:64-->
 
* '''runScript=''' make sure the script exists in the specified path
 
* '''runScript=''' make sure the script exists in the specified path
  
 +
<!--T:65-->
 
* '''runExtCommand=''' make sure the command exists in the specified path
 
* '''runExtCommand=''' make sure the command exists in the specified path
  
 +
<!--T:66-->
 
If the installation media is a CD or DVD, you will need to create a bootable media that contains the files in your directory. To create a bootable ISO:
 
If the installation media is a CD or DVD, you will need to create a bootable media that contains the files in your directory. To create a bootable ISO:
  
{{txtbox|pre|width=55%|box='''cd /tmp/custominstall
+
<!--T:67-->
 +
{{txtbox|box='''cd /tmp/custominstall
 
'''mkisofs -V mycustominstall -J -R -b boot/cdboot -no-emul-boot -o myinstall.iso'''}}
 
'''mkisofs -V mycustominstall -J -R -b boot/cdboot -no-emul-boot -o myinstall.iso'''}}
  
 +
<!--T:68-->
 
You can then use your favorite burning utility to burn the ISO to the media.
 
You can then use your favorite burning utility to burn the ISO to the media.
  
 +
<!--T:69-->
 
To begin an installation that requires user interaction:
 
To begin an installation that requires user interaction:
  
 +
<!--T:70-->
 
'''pc-sysinstall -c /path_to_your_config_file'''
 
'''pc-sysinstall -c /path_to_your_config_file'''
  
 +
<!--T:71-->
 
To begin a fully automated installation, insert the installation media and reboot.
 
To begin a fully automated installation, insert the installation media and reboot.
  
 +
<!--T:72-->
 
If you are using an HTTP, FTP, or SSH server as the installation media, untar or copy the required files to a directory on the server that is accessible to users. Be sure to configure the server so that the installation files are accessible to the systems that you wish to install. If you are using a PXE Boot Install server, follow the instructions at [[Thin_Client#Connecting_to_and_Customizing_the_PXE_Boot_Install_Server|Connecting to and Customizing the PXE Boot Install Server]].
 
If you are using an HTTP, FTP, or SSH server as the installation media, untar or copy the required files to a directory on the server that is accessible to users. Be sure to configure the server so that the installation files are accessible to the systems that you wish to install. If you are using a PXE Boot Install server, follow the instructions at [[Thin_Client#Connecting_to_and_Customizing_the_PXE_Boot_Install_Server|Connecting to and Customizing the PXE Boot Install Server]].
  
<!-- <noinclude>{{refheading}}</noinclude> uncomment if citelink is used on the page -->
+
<!--T:73-->
<noinclude>{{GroupListHeading|group=tables}}</noinclude>
+
 
<noinclude>
 
<noinclude>
[[category:handbook]]
+
<!-- {{refheading}} --><!-- uncomment if citelink is used on this page -->
[[category:Advanced Installation Topics]]
+
{{GroupListHeading|group=tables}}
 
[[category:Creating an Automated Installation with pc-sysinstall]]
 
[[category:Creating an Automated Installation with pc-sysinstall]]
 +
[[category:Advanced Installation Topics]]
 +
[[category:handbook]]
 +
</translate>
 +
<languages/>
 
</noinclude>
 
</noinclude>

Revision as of 01:20, 30 April 2013

(Sorry for the inconvenience)

Contents

PC-BSD® provides a set of Bourne shell scripts that allow advanced users to create automatic or customized PC-BSD® installations. pc-sysinstall is the name of the master script; it reads a customizable configuration file and uses dozens of backend scripts to perform the installation. You can read more about this utility by typing man pc-sysinstall.

Here is a quick overview of the components used by pc-sysinstall:

  • /usr/share/pc-sysinstall/backend/ contains the scripts used by the PC-BSD® installer. Scripts have been divided by function, such as functions-bsdlabel.sh and functions-installcomponents.sh. If you have ever wondered how the PC-BSD® installer works, read through these scripts. This directory also contains the parseconfig.sh and startautoinstall.sh scripts which pc-sysinstall uses to parse the configuration file and begin the installation.
  • /usr/share/pc-sysinstall/backend-partmanager/ contains the scripts which are used by the installer to create and delete partitions.
  • /usr/share/pc-sysinstall/backend-query/ contains the scripts which are used by the installer to detect (e.g. detect-nics.sh) and configure (e.g. enable-net.sh) hardware.
  • /usr/share/pc-sysinstall/components/ contains FreeBSD ports and src and the PBIs for chromium, firefox, opera, and thunderbird.
  • /usr/share/pc-sysinstall/conf/ contains the configuration file pc-sysinstall.conf. It also contains a file indicating which localizations are available (avail-langs), a list of files which are not touched during an upgrade (exclude-from-upgrade), and a license/ subdirectory containing text files of applicable licenses (e.g. bsd-en.txt and nvidia-en.txt).
  • /usr/share/pc-sysinstall/doc/ contains the help text that is seen if you run pc-sysinstall without any arguments.
  • /usr/share/examples/pc-sysinstall/ contains several example configuration files for different scenarios (e.g. upgrade, fbsd-netinstall). The README file in this directory should be considered as mandatory reading before using pc-sysinstall.
  • /usr/sbin/pc-sysinstall this is the script that is used to perform a customized installation.

To create a custom installation, perform the following steps:

  1. Determine which variables you wish to customize.
  2. Create a customized configuration.
  3. Create a custom installation media.

These steps are discussed in more detail below.

Determine Which Variables you Wish to Customize

A list of possible variables can be found in /usr/share/examples/pc-sysinstall/README and in Table 5.5a. Note that the Table is meant as a quick reference to determine which variables are available. The README file contains more complete descriptions for each variable.


Table 5.5a: Available Variables for Customizing a PC-BSD® Installation [tables 1]
Variable Options Description
hostname= should be unique for the network optional as installer will auto-generate a hostname if empty
installMode= fresh, upgrade, or extract sets the installation type
installLocation= /path/to/location used only when installMode is extract and should point to an already mounted location
installInteractive= yes or no set to no for automated installs without user input
netDev= AUTO-DHCP or FreeBSD interface name type of network connection to use during the installation
netIP= IP address of interface used during installation only use if netDev is set to an interface name
netMask= subnet mask of interface only use if netDev is set to an interface name
netNameServer= IP address of DNS server only use if netDev is set to an interface name
netDefaultRouter= IP address of default gateway only use if netDev is set to an interface name
netSaveDev= AUTO-DHCP or FreeBSD interface name(s) (multiple allowed separated by spaces) type of network configuration to enable on the installed system; can set multiple interfaces
netSaveIP= IP address of interface <interface_name> or DHCP only use if netSaveDev is set to an interface name or a list of interface names (repeat for each interface)
netSaveMask= subnet mask of interface <interface_name> only use if netSaveDev is set to an interface name or a list of interface names (repeat for each interface)
netSaveNameServer= IP address of DNS server (multiple allowed separated by spaces) only use if netSaveDev= is set to an interface name or a list of interface names (do not repeat for each interface)
netSaveDefaultRouter= IP address of default gateway only use if netSaveDev= is set to an interface name or a list of interface names (do not repeat for each interface)
disk0= FreeBSD disk device Name, (e.g. ad0) see README for examples
partition= all, free, s1, s2, s3, s4, image see README for examples
partscheme= MBR or GPT partition scheme type
mirror= FreeBSD disk device name (e.g. ad1) sets the target disk for the mirror (i.e. the second disk)
rmirrorbal= load, prefer, round-robin, split defaults to round-robin if the mirror balance method is not specified
rbootManager= none, bsd whether or not to install the FreeBSD boot manager
image= /path/to/image will write specified image file
commitDiskPart this variable is mandatory and must be placed at the end of each diskX= section; create a diskX= section for each disk you wish to configure.
encpass= password value at boot time, system will prompt for this password in order to mount the associated GELI encrypted partition
commitDiskLabel this variable is mandatory and must be placed at the end of disk's partitioning settings; see the README for examples on how to set the <File System Type> <Size> <Mountpoint> entries for each disk
installMedium= dvd, local, usb, ftp, rsync, image source to be used for installation
localPath= e.g. usr/freebsd-dist location of the directory containing the installation files when using installMedium=local
installType= PCBSD, FreeBSD determines whether this is a desktop or a server install
installFile= e.g. fbsd-release.tbz only set if using a customized installer archive
packageType= tar, uzip, split, dist the archive type on the installation media
ftpPath= e.g. ftp://ftp.pcbsd.org/pub/mirror/9.1/amd64/netinstall/ location of the installer archive when using installMedium=ftp
rsyncPath= e.g. life-preserver/back-2011-09-12T14_53_14 location of the rsync data on the remote server when using installMedium=rsync
rsyncUser= username set when using installMedium=rsync
rsyncHost= IP address of rsync server set when using installMedium=rsync
rsyncPort= port number set when using installMedium=rsync
installComponents= e.g. amarok,firefox,ports components must exist in /PCBSD/pc-sysinstall/components/
upgradeKeepDesktopProfile= yes or no specify if you wish to keep your existing user's desktop profile data during an upgrade
rootPass= password set the root password of the installed system to the specified string
rootEncPass= encrypted string set root password to specified encrypted string
userName= case sensitive value create a separate block of user values for each user you wish to create
userComment= description description text can include spaces
userPass= password of user
userEncPass encrypted string set user password to specified encrypted string
userShell= e.g. /bin/csh path to default shell
userHome= e.g. /home/username path to home directory
userGroups= e.g. wheel,operator comma separated (no spaces) list of groups
commitUser mandatory, must be last line in each user block
runCommand= path to command run the specified command within chroot of the installed system, after the installation is complete
runScript= path to script runs specified script within chroot of the installed system, after the installation is complete
runExtCommand= path to command runs a command outside the chroot
timeZone= e.g. America/New_York location must exist in /usr/share/zoneinfo/
enableNTP= yes or no enable/disable NTP
localizeLang= e.g. en sets the system console and Desktop to the target language
localizeKeyLayout= e.g. en updates the system's Xorg config to set the keyboard layout
localizeKeyModel= e.g. pc104 updates the system's Xorg config to set the keyboard model
localizeKeyVariant= e.g. intl updates the Xorg config to set the keyboard variant
autoLoginUser= username user will be logged in automatically without entering a password

Create a Customized Configuration

One way to create this file is to read through the configuration examples in /usr/share/examples/pc-sysinstall/ to find the one that most closely matches your needs. Copy that file (to any location) and customize it so that it includes the variables and values you would like to use in your installation.

An alternate way to create this file is to perform an installation of the version that you wish to customize. The installer will automatically create a file containing the settings you selected during the installation to /root/pc-sysinstall.cfg. You can use that configuration file as-is, or customize it to meet an installation's needs. This method may prove easier to use if you are performing complex disk layouts.

Here is a sample configuration:

# Sample configuration file for an installation using pc-sysinstall

installMode=fresh installInteractive=no hostname=myhost.mydomain.com

# Set the disk parameters - 1st disk disk0=da0 partition=all bootManager=none commitDiskPart

# Set the disk parameters - 2nd disk disk1=da1 partition=all bootManager=none commitDiskPart

# Setup the disk label - 1st disk # All sizes are expressed in MB # Avail FS Types, UFS, UFS+S, UFS+J, ZFS, SWAP disk0-part=UFS+S 1024 / disk0-part=SWAP.eli 2048 none disk0-part=UFS+S 1024 /tmp disk0-part=UFS+S 1024 /var disk0-part=UFS+S 0 /usr # Size 0 means use the rest of the slice size # Do it now! commitDiskLabel

# Setup the disk label - 2nd disk # All sizes are expressed in MB # Avail FS Types, UFS, UFS+S, UFS+J, ZFS, SWAP disk1-part=UFS+S 1024 /usr/src disk1-part=UFS+S 4096 /usr/local disk1-part=UFS+S 0 /usr/ports # Size 0 means use the rest of the slice size> # Do it now! commitDiskLabel

netDev=em1 netIP=172.16.80.250 netMask=255.255.240.0 netNameServer=172.16.80.1 netDefaultRouter=172.16.80.1 netSaveDev=em0 em1 netSaveIP_em0=192.168.101.42 netSaveIP_em1=172.16.80.156 netSaveMask_em0=255.255.252.0 netSaveMask_em1=255.255.240.0 netSaveNameServer=172.16.80.1 netSaveDefaultRouter=192.168.100.1

# Set if we are installing via optical, USB, or FTP installType=FreeBSD installMedium=ftp ftpPath=http://pkgbuilder.mydomain.com/images/freebsd/8.2/ packageType=tar

# List our components to install #installComponents=ports,src

# Set the root pass rootPass=root

# Setup our users userName=demo userComment=Demo User userPass=demo userShell=/bin/sh userHome=/home/demo commitUser

# Set up date/time runCommand=cp /usr/share/zoneinfo/EST5EDT /etc/localtime runCommand=touch /etc/wall_cmos_clock runCommand=adjkerntz -a

# Install packages required for VMware Tools installation/configuration runCommand=pkg_add -r compat6x-amd64 runCommand=pkg_add -r perl runCommand=pkg_add -r pcre runCommand=pkg_add -r puppet runCommand=pkg_add -r sysrc

# Fetch/install VMware Tools runCommand=fetch -o /tmp/vmtools.tar.gz http://pkgbuilder.mydomain.com/images/freebsd/vmware-freebsd-tools.tar.gz

runCommand=zcat /tmp/vmtools.tar.gz

If you wish to perform a fully-automated installation that does not prompt for any user input, you will also need to review /usr/share/examples/pc-sysinstall/pc-autoinstall.conf and place a customized copy of that file into /boot/pc-autoinstall.conf on your installation media.

Table 5.5b summarizes the additional variables that are available for fully automatic installations. More detailed descriptions can be found in the /usr/share/examples/pc-sysinstall/pc-autoinstall.conf file. Note that the variables in this file use a different syntax than those in Table 5.5a, in that the values follow a colon and a space rather than an equal sign.


Table 5.5b: Additional Variables for Automated Installations [tables 2]
Variable Options Description
pc_config URL or /path/to/file location of customized pc-sysinstall.conf
confirm_install yes or no should be set to yes, otherwise booting the wrong disk will result in a system wipe
shutdown_cmd e.g. shutdown -p now good idea to run a shutdown, but can be any command/script you wish to execute post-install
nic_config dhcp-all or <interface name> <IP address> <subnet mask> will attempt dhcp on all found NICs until the installation file can be fetched or will setup specified interface
nic_dns DNS server to use
nic_gateway IP address default gateway to use

Here is a sample pc-autoinstall.conf file:

# pc-autoinstall.conf example

# # Usage: Modify these variables, and copy the file to # /boot/pc-autoinstall.conf on your PC-BSD installation medium # # The conf will then be read at bootup, and your automated # install will take place ##################################################################

# Where the pc-sysinstall main config is located # Can be either a file on the booted CD / DVD / USB media, # or a remote file on http / ftp # # The value %%NIC_MAC%% is special, and will be substituted with # the macaddress of the enabled NIC from DHCP or manually set # with 'nic_config:' ##################################################################

# Examples: # pc_config: ftp://192.168.0.2/cust-install.cfg # pc_config: http://192.168.0.2/cust-install.cfg # pc_config: http://192.168.0.2/%%NIC_MAC%%.cfg # pc_config: /boot/cust-install.cfg pc_config: http://pkgbuilder.mydomain.com/images/freebsd/pc-sysinstall.cfg>

# Set this to yes if we should confirm before doing an install # This should normally be set to yes, otherwise booting the wrong # disk will result in a system wipe confirm_install: no

# Set the command to run post-install, usually best to run shutdown # but this can be replaced with any other command / script you wish # to execute post-install
shutdown_cmd: shutdown -r now

# Options for the network setup, should the cfg need to be fetched # from a remote location, only necessary when using ftp or http ##################################################################

# Special option, will attempt dhcp on all found NICs # until the file can be fetched, or we run out of interfaces # nic_config: dhcp-all

# Line to be passed to the "ifconfig" command to bring up an interface nic_config: em1 172.16.80.250 255.255.240.0

# DNS server to use nic_dns: 172.16.80.1

# Default router / gateway

nic_gateway: 172.16.80.1

Create a Custom Installation Media or Installation Server

pc-sysinstall supports the following installation methods:

  • from a CD, DVD, or USB media
  • from an installation directory on an HTTP, FTP, SSH+rsync, or a PXE Boot Install server

The easiest way to create a custom installation media is to modify an existing installation image. For example, if you have downloaded an ISO for the PC-BSD® version that you wish to customize, the superuser can access the contents of the ISO as follows:

mdconfig -a -t vnode -f PCBSD9.0-x86-DVD.iso -u 1 mount -t cd9660 /dev/md1 /mnt

Make sure you have changed into a directory (use cd) where you would like to copy the contents of the ISO. In the following examples, /tmp/custominstall/ was created as the directory for this purpose:

cd /tmp/custominstall

tar -C /mnt -cf - . | tar -xvf -

umount /mnt

Alternately, if you have inserted an installation CD or DVD, you can mount the media and copy its contents to your desired directory:

mount -t cd9660 /dev/cd0 /mnt

cp -R /mnt/* /tmp/custominstall/

umount /mnt

If you are creating an automated installation, copy your customized pc-autoinstall.conf to /tmp/custominstall/boot/.

Copy your customized configuration file to /tmp/custominstall/. Double-check that the "installMedium=" variable in your customized configuration file is set to the type of media that you will be installing from.

You may also need to add some extra files if you set the following variables in your custom configuration file:

  • installComponents= make sure that any extra components you wish to install exist in extras/PBI/ (if they end in the .pbi extension) or extras/components/ (if they end in .tbz)
  • runCommand= make sure the command exists in the specified path
  • runScript= make sure the script exists in the specified path
  • runExtCommand= make sure the command exists in the specified path

If the installation media is a CD or DVD, you will need to create a bootable media that contains the files in your directory. To create a bootable ISO:

cd /tmp/custominstall mkisofs -V mycustominstall -J -R -b boot/cdboot -no-emul-boot -o myinstall.iso

You can then use your favorite burning utility to burn the ISO to the media.

To begin an installation that requires user interaction:

pc-sysinstall -c /path_to_your_config_file

To begin a fully automated installation, insert the installation media and reboot.

If you are using an HTTP, FTP, or SSH server as the installation media, untar or copy the required files to a directory on the server that is accessible to users. Be sure to configure the server so that the installation files are accessible to the systems that you wish to install. If you are using a PXE Boot Install server, follow the instructions at Connecting to and Customizing the PXE Boot Install Server.


List of Tables


  1. Table 5.5a: Available Variables for Customizing a PC-BSD® Installation
  2. Table 5.5b: Additional Variables for Automated Installations
Other languages:German 3% • ‎English 100% • ‎French 3%
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox