diff options
Diffstat (limited to 'usr/sbin/pc-sysinstall/pc-sysinstall')
-rw-r--r-- | usr/sbin/pc-sysinstall/pc-sysinstall/Makefile | 6 | ||||
-rw-r--r-- | usr/sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8 | 120 | ||||
-rw-r--r-- | usr/sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh | 224 |
3 files changed, 350 insertions, 0 deletions
diff --git a/usr/sbin/pc-sysinstall/pc-sysinstall/Makefile b/usr/sbin/pc-sysinstall/pc-sysinstall/Makefile new file mode 100644 index 0000000..65abcc0 --- /dev/null +++ b/usr/sbin/pc-sysinstall/pc-sysinstall/Makefile @@ -0,0 +1,6 @@ +# $FreeBSD: src/usr.sbin/pc-sysinstall/pc-sysinstall/Makefile,v 1.3 2010/06/27 17:14:04 imp Exp $ + +SCRIPTS=pc-sysinstall.sh +MAN= pc-sysinstall.8 + +.include <bsd.prog.mk> diff --git a/usr/sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8 b/usr/sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8 new file mode 100644 index 0000000..69556f4 --- /dev/null +++ b/usr/sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8 @@ -0,0 +1,120 @@ +.\" Copyright (c) 2010 +.\" iXsystems, Inc. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL Jordan Hubbard OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: src/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8,v 1.2 2010/07/06 23:29:55 imp Exp $ +.\" +.Dd June 24, 2010 +.Dt PC-SYSINSTALL 8 +.Os +.Sh NAME +.Nm pc-sysinstall +.Nd System installer backend +.Sh SYNOPSIS +.Nm +.Op Fl c Ar file +.Op Ar command +.Sh DESCRIPTION +The +.Nm +utility is a hybrid backend for installing FreeBSD. When run in install mode +it takes a configuration file and performs an installation according to the +parameters specified in the configuration file. When called with one of +the system query commands it provides information about the system to aid a +front end in building an appropriate configuration file. +.Pp +The following options are available: +.Bl -tag -width indent +.It Fl c Ar file +Perform an installation as directed by +.Ar file. +.El +.Sh COMMANDS +The +.Cm command +can be any one of the following: +.Pp +.Bl -tag -width indent +.It help +Display a list of all commands. +.It help Ar command +Dispay the help data for the specified command. +.It disk-list +Provide a listing of the storage devices detected on this system. +.It disk-part Ar disk +Queries the specified storage device and returns information about its +partitions. +.It disk-info Ar disk +Returns information about a storage device's size, cylinders, heads, and +sectors. +.It detect-laptop +Tests to see if this system is a laptop or desktop. +.It detect-emulation +Tests to see if this system is running in an emulator +.It detect-nics +Returns a listing of the detected network cards on this system. +.It list-components +Returns a listing of the available components which can be installed. +.It list-rsync-backups Ar user Ar host Ar port +Returns a listing of available rsync-backups on the target server in the +life-preserver/ directory. +.It list-tzones +Returns a listing of available timezones. +.It query-langs +Returns a list of languages that the installer supports. +.It sys-mem +Returns the size of installed system RAM in MegaBytes. +.It test-netup +test if an internet connection is available. +.It update-part-list +Returns a list of PC-BSD and FreeBSD installs on this system for updates. +.It xkeyboard-layouts +Returns a list of keyboard layouts that xorg supports. +.It xkeyboard-models +Returns a list of keyboard models that xorg supports. +.It xkeyboard-variants +Returns a list of keyboard variants that xorg supports. +.It create-part Ar disk Ar size +Create a new MBR primary slice on the target disk using size MB. +.It delete-part Ar partition +Delete the disk partition specified. If this is the last partition, the +disk partition layout will also be scrubbed, leaving a clean disk ready +for MBR or GPT file system layouts. +.It start-autoinstall Ar file +Start an automated installation with the specified file. Normally only +used by automated install scripts. +.It setup-ssh-keys Ar user Ar host Ar port +Setup SSH without a password for the target host, user, and port. Used to +prompt the user to log into a server before doing a rsync + ssh restore. +.Sh HISTORY +This version of +.Nm +first appeared in +.Fx 9.0 . +.Sh AUTHORS +.An Kris Moore Aq kmoore@FreeBSD.org +.Sh BUGS +This utility was written to install PC-BSD and has seen limited use as an +installer for FreeBSD. It's likely that usage to install FreeBSD will expose +edge cases that PC-BSD doesn't, as well as generate feature requests based +on unforseen needs. diff --git a/usr/sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh b/usr/sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh new file mode 100644 index 0000000..8605499 --- /dev/null +++ b/usr/sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh @@ -0,0 +1,224 @@ +#!/bin/sh +##################################################################### +# Author: Kris Moore +# License: BSD +# Description: pc-sysinstall provides a backend for performing +# system installations, as well as calls which a front-end can use +# to retrive information about the system +##################################################################### +# Copyright 2010 iXsystems +# All rights reserved +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted providing that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# $FreeBSD: src/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh,v 1.6 2010/07/13 23:47:12 imp Exp $ +##################################################################### + +# User-editable configuration variables + +# Set this to the program location +PROGDIR="/usr/share/pc-sysinstall" +export PROGDIR + +# Set this to the components location +COMPDIR="${PROGDIR}/components" +export COMPDIR + +# Set this to the packages location +PKGDIR="${PROGDIR}/conf" +export PKGDIR + +# End of user-editable configuration +##################################################################### + +# Set our QUERYDIR +QUERYDIR="${PROGDIR}/backend-query" +export QUERYDIR + +# Set our BACKEND +BACKEND="${PROGDIR}/backend" +export BACKEND + +PARTMANAGERDIR="${PROGDIR}/backend-partmanager" +export PARTMANAGERDIR + +# Start by sourcing our conf file +if [ -e "${PROGDIR}/conf/pc-sysinstall.conf" ] +then + . ${PROGDIR}/conf/pc-sysinstall.conf +else + echo "ERROR: Could not find ${PROGDIR}/conf/pc-sysinstall.conf" + exit 1 +fi + +# Now source our functions.sh +if [ -e "${PROGDIR}/backend/functions.sh" ] +then + . ${PROGDIR}/backend/functions.sh +else + echo "ERROR: Could not find ${PROGDIR}/backend/functions.sh" + exit 1 +fi + + +# Check if we are called without any flags and display help +if [ -z "${1}" ] +then + # Display the help index + display_help + exit 0 +fi + +case $1 in + # The -c flag has been given, time to parse the script + -c) if [ -z "${2}" ] + then + display_help + else + ${BACKEND}/parseconfig.sh ${2} + exit $? + fi + ;; + + # The user requsted help + help) if [ -z "${2}" ] + then + display_help + else + display_command_help ${2} + fi + ;; + + # Parse an auto-install directive, and begin the installation + start-autoinstall) ${BACKEND}/startautoinstall.sh ${2} + ;; + + # The user is wanting to create a new partition + create-part) ${PARTMANAGERDIR}/create-part.sh "${2}" "${3}" + ;; + + # The user is wanting to delete an existing partition + delete-part) ${PARTMANAGERDIR}/delete-part.sh "${2}" + ;; + + # The user is wanting to check if we are on a laptop or desktop + detect-laptop) ${QUERYDIR}/detect-laptop.sh + ;; + + # The user is wanting to see what nics are available on the system + detect-nics) ${QUERYDIR}/detect-nics.sh + ;; + + # The user is wanting to check if we are in emulation + detect-emulation) ${QUERYDIR}/detect-emulation.sh + ;; + + # The user is wanting to query a disk's information + disk-info) ${QUERYDIR}/disk-info.sh ${2} + ;; + + # The user is wanting to query which disks are available + disk-list) ${QUERYDIR}/disk-list.sh + ;; + + # The user is wanting to query a disk's partitions + disk-part) ${QUERYDIR}/disk-part.sh ${2} + ;; + + # Function allows the setting of networking by a calling front-end + enable-net) ${QUERYDIR}/enable-net.sh "${2}" "${3}" "${4}" "${5}" "${6}" "${7}" + ;; + + # Function which lists components available + list-components) ${QUERYDIR}/list-components.sh + ;; + + # Function which lists pc-sysinstall configuration + list-config) ${QUERYDIR}/list-config.sh + ;; + + # Function which lists available FTP mirrors + list-mirrors) ${QUERYDIR}/list-mirrors.sh "${2}" + ;; + + # Function which lists available packages + list-packages) ${QUERYDIR}/list-packages.sh "${2}" "${3}" + ;; + + # Function which lists available backups on a rsync/ssh server + list-rsync-backups) ${QUERYDIR}/list-rsync-backups.sh "${2}" "${3}" "${4}" + ;; + + # Function which lists timezones available + list-tzones) ${QUERYDIR}/list-tzones.sh + ;; + + # Requested a list of languages this install will support + query-langs) ${QUERYDIR}/query-langs.sh + ;; + + # Function which creates a error report, and mails it to the specified address + send-logs) ${QUERYDIR}/send-logs.sh ${2} + ;; + + # Function to get package index + get-packages) ${QUERYDIR}/get-packages.sh "${2}" + ;; + + # Function which allows setting up of SSH keys + setup-ssh-keys) ${QUERYDIR}/setup-ssh-keys.sh "${2}" "${3}" "${4}" + ;; + + # Function which lists the real memory of the system in MB + sys-mem) ${QUERYDIR}/sys-mem.sh + ;; + + # Run script which determines if we are booted from install media, or on disk + test-live) ${QUERYDIR}/test-live.sh + ;; + + # The user is wanting to test if the network is up and working + test-netup) ${QUERYDIR}/test-netup.sh + ;; + + # The user is wanting to get a list of partitions available to be updated / repaired + update-part-list) ${QUERYDIR}/update-part-list.sh + ;; + + # Requested a list of keyboard layouts that xorg supports + xkeyboard-layouts) ${QUERYDIR}/xkeyboard-layouts.sh + ;; + + # Requested a list of keyboard models that xorg supports + xkeyboard-models) ${QUERYDIR}/xkeyboard-models.sh + ;; + + # Requested a list of keyboard variants that xorg supports + xkeyboard-variants) ${QUERYDIR}/xkeyboard-variants.sh + ;; + + *) echo "Unknown Command: ${1}" + exit 1 ;; +esac + +# Exit with success if we made it to the end +exit $? |