diff options
344 files changed, 19754 insertions, 0 deletions
diff --git a/PCBSD/pc-sysinstall/.svn/entries b/PCBSD/pc-sysinstall/.svn/entries new file mode 100644 index 0000000..29d3157 --- /dev/null +++ b/PCBSD/pc-sysinstall/.svn/entries @@ -0,0 +1,83 @@ +10 + +dir +6759 +svn://svn.pcbsd.org/pcbsd/current/pc-sysinstall +svn://svn.pcbsd.org + + + +2010-05-22T19:59:31.576442Z +6759 +ayerenkow + + + + + + + + + + + + + + +212fe199-4beb-da11-a70e-00e08102fd27 + +components +dir + +conf +dir + +doc +dir + +pc-sysinstall +file + + + + +2010-05-23T00:20:49.000000Z +f9babfde02346c33435066224e0f693d +2010-05-09T01:45:25.667864Z +6683 +johnh +has-props + + + + + + + + + + + + + + + + + + + + +6015 + +backend-partmanager +dir + +backend +dir + +backend-query +dir + +examples +dir + diff --git a/PCBSD/pc-sysinstall/.svn/lock b/PCBSD/pc-sysinstall/.svn/lock new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/PCBSD/pc-sysinstall/.svn/lock diff --git a/PCBSD/pc-sysinstall/.svn/prop-base/pc-sysinstall.svn-base b/PCBSD/pc-sysinstall/.svn/prop-base/pc-sysinstall.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/.svn/prop-base/pc-sysinstall.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/.svn/text-base/pc-sysinstall.svn-base b/PCBSD/pc-sysinstall/.svn/text-base/pc-sysinstall.svn-base new file mode 100644 index 0000000..dc5a594 --- /dev/null +++ b/PCBSD/pc-sysinstall/.svn/text-base/pc-sysinstall.svn-base @@ -0,0 +1,202 @@ +#!/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 Kris Moore +# 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. +##################################################################### + +# User-editable configuration variables + +# Set this to the program location +PROGDIR="/PCBSD/pc-sysinstall" +export PROGDIR + +# Set this to the components location +COMPDIR="${PROGDIR}/components" +export COMPDIR + +# 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 vmware + detect-vmware) ${QUERYDIR}/detect-vmware.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 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 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 0 diff --git a/PCBSD/pc-sysinstall/backend-partmanager/.svn/entries b/PCBSD/pc-sysinstall/backend-partmanager/.svn/entries new file mode 100644 index 0000000..b00da0e --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-partmanager/.svn/entries @@ -0,0 +1,96 @@ +10 + +dir +6759 +svn://svn.pcbsd.org/pcbsd/current/pc-sysinstall/backend-partmanager +svn://svn.pcbsd.org + + + +2010-04-09T15:45:00.906559Z +6540 +kris + + + + + + + + + + + + + + +212fe199-4beb-da11-a70e-00e08102fd27 + +delete-part.sh +file + + + + +2010-05-23T00:20:49.000000Z +9a9488cc44bffc3e2371b8968f9a31a9 +2010-04-09T15:45:00.906559Z +6540 +kris +has-props + + + + + + + + + + + + + + + + + + + + +1446 + +create-part.sh +file + + + + +2010-05-23T00:20:49.000000Z +f06b56ec8ae483a32a0b20ef500eeb88 +2010-04-06T22:19:25.560716Z +6514 +kris +has-props + + + + + + + + + + + + + + + + + + + + +1595 + diff --git a/PCBSD/pc-sysinstall/backend-partmanager/.svn/lock b/PCBSD/pc-sysinstall/backend-partmanager/.svn/lock new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-partmanager/.svn/lock diff --git a/PCBSD/pc-sysinstall/backend-partmanager/.svn/prop-base/create-part.sh.svn-base b/PCBSD/pc-sysinstall/backend-partmanager/.svn/prop-base/create-part.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-partmanager/.svn/prop-base/create-part.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/backend-partmanager/.svn/prop-base/delete-part.sh.svn-base b/PCBSD/pc-sysinstall/backend-partmanager/.svn/prop-base/delete-part.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-partmanager/.svn/prop-base/delete-part.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/backend-partmanager/.svn/text-base/create-part.sh.svn-base b/PCBSD/pc-sysinstall/backend-partmanager/.svn/text-base/create-part.sh.svn-base new file mode 100644 index 0000000..e7f1e65 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-partmanager/.svn/text-base/create-part.sh.svn-base @@ -0,0 +1,66 @@ +#!/bin/sh +# Query a disk for partitions and display them +############################# + +. ${PROGDIR}/backend/functions.sh + +if [ -z "${1}" ] ; then + echo "Error: No disk specified!" + exit 1 +fi + +if [ -z "${2}" ] ; then + echo "Error: No size specified!" + exit 1 +fi + +if [ ! -e "/dev/${1}" ] ; then + echo "Error: Disk /dev/${1} does not exist!" + exit 1 +fi + +DISK="${1}" +MB="${2}" + +TOTALBLOCKS="`expr $MB \* 2048`" + + +# Lets figure out what number this slice will be +LASTSLICE="`fdisk -s /dev/${DISK} 2>/dev/null | grep -v ${DISK} | grep ':' | tail -n 1 | cut -d ':' -f 1 | tr -s '\t' ' ' | tr -d ' '`" +if [ -z "${LASTSLICE}" ] ; then + LASTSLICE="1" +else + LASTSLICE="`expr $LASTSLICE + 1`" +fi + +if [ ${LASTSLICE} -gt "4" ] ; then + echo "Error: FreeBSD MBR setups can only have a max of 4 slices" + exit 1 +fi + + +SLICENUM="${LASTSLICE}" + +# Lets get the starting block +if [ "${SLICENUM}" = "1" ] ; then + STARTBLOCK="63" +else + # Lets figure out where the prior slice ends + checkslice="`expr ${SLICENUM} - 1`" + + # Get starting block of this slice + fdisk -s /dev/${DISK} | grep -v "${DISK}:" | grep "${checkslice}:" | tr -s " " >${TMPDIR}/pfdisk + pstartblock="`cat ${TMPDIR}/pfdisk | cut -d ' ' -f 3`" + psize="`cat ${TMPDIR}/pfdisk | cut -d ' ' -f 4`" + STARTBLOCK="`expr ${pstartblock} + ${psize}`" +fi + + +# If this is an empty disk, see if we need to create a new MBR scheme for it +gpart show ${DISK} >/dev/null 2>/dev/null +if [ "$?" != "0" -a "${SLICENUM}" = "1" ] ; then + gpart create -s mbr ${DISK} +fi + +gpart add -b ${STARTBLOCK} -s ${TOTALBLOCKS} -t freebsd -i ${SLICENUM} ${DISK} +exit "$?" diff --git a/PCBSD/pc-sysinstall/backend-partmanager/.svn/text-base/delete-part.sh.svn-base b/PCBSD/pc-sysinstall/backend-partmanager/.svn/text-base/delete-part.sh.svn-base new file mode 100644 index 0000000..a1f0a1d --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-partmanager/.svn/text-base/delete-part.sh.svn-base @@ -0,0 +1,63 @@ +#!/bin/sh +# Delete a specified partition, takes effect immediately +######################################################## + +. ${PROGDIR}/backend/functions.sh +. ${PROGDIR}/backend/functions-disk.sh + +if [ -z "${1}" ] +then + echo "Error: No partition specified!" + exit 1 +fi + +if [ ! -e "/dev/${1}" ] +then + echo "Error: Partition /dev/${1} does not exist!" + exit 1 +fi + +PARTITION="${1}" + +# First lets figure out the partition number for the given device +################################################################## + +# Get the number of characters in this dev +CHARS="`echo $PARTITION | wc -c`" + +PARTINDEX="" + +# Lets read through backwards until we get the part number +while +z=1 +do + CHARS=`expr $CHARS - 1` + LAST_CHAR=`echo "${PARTITION}" | cut -c $CHARS` + echo "${LAST_CHAR}" | grep "^[0-9]$" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + PARTINDEX="${LAST_CHAR}${PARTINDEX}" + else + break + fi +done + +# Now get current disk we are working on +CHARS=`expr $CHARS - 1` +DISK="`echo $PARTITION | cut -c 1-${CHARS}`" + +# Make sure we have a valid disk name still +if [ ! -e "/dev/${DISK}" ] ; then + echo "Error: Disk: ${DISK} doesnt exist!" + exit 1 +fi + +echo "Running: gpart delete -i ${PARTINDEX} ${DISK}" +gpart delete -i ${PARTINDEX} ${DISK} >/dev/null 2>/dev/null + +# Check if this was the last partition and destroy the disk geom if so +get_disk_partitions "${DISK}" +if [ -z "${VAL}" ] ; then + gpart destroy ${DISK} +fi + +exit "$?" diff --git a/PCBSD/pc-sysinstall/backend-partmanager/create-part.sh b/PCBSD/pc-sysinstall/backend-partmanager/create-part.sh new file mode 100755 index 0000000..e7f1e65 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-partmanager/create-part.sh @@ -0,0 +1,66 @@ +#!/bin/sh +# Query a disk for partitions and display them +############################# + +. ${PROGDIR}/backend/functions.sh + +if [ -z "${1}" ] ; then + echo "Error: No disk specified!" + exit 1 +fi + +if [ -z "${2}" ] ; then + echo "Error: No size specified!" + exit 1 +fi + +if [ ! -e "/dev/${1}" ] ; then + echo "Error: Disk /dev/${1} does not exist!" + exit 1 +fi + +DISK="${1}" +MB="${2}" + +TOTALBLOCKS="`expr $MB \* 2048`" + + +# Lets figure out what number this slice will be +LASTSLICE="`fdisk -s /dev/${DISK} 2>/dev/null | grep -v ${DISK} | grep ':' | tail -n 1 | cut -d ':' -f 1 | tr -s '\t' ' ' | tr -d ' '`" +if [ -z "${LASTSLICE}" ] ; then + LASTSLICE="1" +else + LASTSLICE="`expr $LASTSLICE + 1`" +fi + +if [ ${LASTSLICE} -gt "4" ] ; then + echo "Error: FreeBSD MBR setups can only have a max of 4 slices" + exit 1 +fi + + +SLICENUM="${LASTSLICE}" + +# Lets get the starting block +if [ "${SLICENUM}" = "1" ] ; then + STARTBLOCK="63" +else + # Lets figure out where the prior slice ends + checkslice="`expr ${SLICENUM} - 1`" + + # Get starting block of this slice + fdisk -s /dev/${DISK} | grep -v "${DISK}:" | grep "${checkslice}:" | tr -s " " >${TMPDIR}/pfdisk + pstartblock="`cat ${TMPDIR}/pfdisk | cut -d ' ' -f 3`" + psize="`cat ${TMPDIR}/pfdisk | cut -d ' ' -f 4`" + STARTBLOCK="`expr ${pstartblock} + ${psize}`" +fi + + +# If this is an empty disk, see if we need to create a new MBR scheme for it +gpart show ${DISK} >/dev/null 2>/dev/null +if [ "$?" != "0" -a "${SLICENUM}" = "1" ] ; then + gpart create -s mbr ${DISK} +fi + +gpart add -b ${STARTBLOCK} -s ${TOTALBLOCKS} -t freebsd -i ${SLICENUM} ${DISK} +exit "$?" diff --git a/PCBSD/pc-sysinstall/backend-partmanager/delete-part.sh b/PCBSD/pc-sysinstall/backend-partmanager/delete-part.sh new file mode 100755 index 0000000..a1f0a1d --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-partmanager/delete-part.sh @@ -0,0 +1,63 @@ +#!/bin/sh +# Delete a specified partition, takes effect immediately +######################################################## + +. ${PROGDIR}/backend/functions.sh +. ${PROGDIR}/backend/functions-disk.sh + +if [ -z "${1}" ] +then + echo "Error: No partition specified!" + exit 1 +fi + +if [ ! -e "/dev/${1}" ] +then + echo "Error: Partition /dev/${1} does not exist!" + exit 1 +fi + +PARTITION="${1}" + +# First lets figure out the partition number for the given device +################################################################## + +# Get the number of characters in this dev +CHARS="`echo $PARTITION | wc -c`" + +PARTINDEX="" + +# Lets read through backwards until we get the part number +while +z=1 +do + CHARS=`expr $CHARS - 1` + LAST_CHAR=`echo "${PARTITION}" | cut -c $CHARS` + echo "${LAST_CHAR}" | grep "^[0-9]$" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + PARTINDEX="${LAST_CHAR}${PARTINDEX}" + else + break + fi +done + +# Now get current disk we are working on +CHARS=`expr $CHARS - 1` +DISK="`echo $PARTITION | cut -c 1-${CHARS}`" + +# Make sure we have a valid disk name still +if [ ! -e "/dev/${DISK}" ] ; then + echo "Error: Disk: ${DISK} doesnt exist!" + exit 1 +fi + +echo "Running: gpart delete -i ${PARTINDEX} ${DISK}" +gpart delete -i ${PARTINDEX} ${DISK} >/dev/null 2>/dev/null + +# Check if this was the last partition and destroy the disk geom if so +get_disk_partitions "${DISK}" +if [ -z "${VAL}" ] ; then + gpart destroy ${DISK} +fi + +exit "$?" diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/entries b/PCBSD/pc-sysinstall/backend-query/.svn/entries new file mode 100644 index 0000000..1d2ea30 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/entries @@ -0,0 +1,708 @@ +10 + +dir +6759 +svn://svn.pcbsd.org/pcbsd/current/pc-sysinstall/backend-query +svn://svn.pcbsd.org + + + +2010-05-19T15:53:43.658786Z +6745 +kris + + + + + + + + + + + + + + +212fe199-4beb-da11-a70e-00e08102fd27 + +query-langs.sh +file + + + + +2010-05-23T00:20:49.000000Z +3bcc757592871aa1aaf6f3d954b98f82 +2009-10-07T19:49:26.064302Z +4603 +kris +has-props + + + + + + + + + + + + + + + + + + + + +62 + +detect-vmware.sh +file + + + + +2010-05-23T00:20:49.000000Z +0561c61c16dc42b87f502eaea614207f +2009-07-09T18:57:31.007874Z +4206 +kris +has-props + + + + + + + + + + + + + + + + + + + + +154 + +test-netup.sh +file + + + + +2010-05-23T00:20:49.000000Z +58211165da0e9f63f239830fa04839b1 +2009-11-13T01:20:07.446403Z +4987 +kris +has-props + + + + + + + + + + + + + + + + + + + + +499 + +xkeyboard-models.sh +file + + + + +2010-05-23T00:20:49.000000Z +d870a898806a1fce1657ed67c56abe47 +2010-02-18T21:04:33.090720Z +6275 +kris +has-props + + + + + + + + + + + + + + + + + + + + +585 + +enable-net.sh +file + + + + +2010-05-23T00:20:49.000000Z +9425af03a0bd26036a7b0ba56a3ea62d +2010-04-26T13:39:59.440346Z +6589 +kris +has-props + + + + + + + + + + + + + + + + + + + + +789 + +test-live.sh +file + + + + +2010-05-23T00:20:49.000000Z +1c52843a04eca3510ab24d26e60e9828 +2009-11-04T17:58:14.335537Z +4868 +kris +has-props + + + + + + + + + + + + + + + + + + + + +315 + +xkeyboard-variants.sh +file + + + + +2010-05-23T00:20:49.000000Z +71cac092f572af1c6506e17b8f4a072c +2009-08-13T17:35:25.800191Z +4327 +kris +has-props + + + + + + + + + + + + + + + + + + + + +501 + +disk-info.sh +file + + + + +2010-05-23T00:20:49.000000Z +78ec4b3d543c261f5ccbf2844e8eecd2 +2010-05-16T18:52:47.285311Z +6724 +kris +has-props + + + + + + + + + + + + + + + + + + + + +830 + +xkeyboard-layouts.sh +file + + + + +2010-05-23T00:20:49.000000Z +29bf5c99439499dfa4991ae42e0ec28c +2009-08-13T17:35:25.800191Z +4327 +kris +has-props + + + + + + + + + + + + + + + + + + + + +499 + +sys-mem.sh +file + + + + +2010-05-23T00:20:49.000000Z +8cb23015f16b5ded6916a6cb54a5beb9 +2009-11-19T21:08:33.521287Z +5094 +kris +has-props + + + + + + + + + + + + + + + + + + + + +117 + +send-logs.sh +file + + + + +2010-05-23T00:20:49.000000Z +79540df57cdab844730bafd90bc5d9ff +2010-04-07T16:05:18.981194Z +6521 +kris +has-props + + + + + + + + + + + + + + + + + + + + +1364 + +list-tzones.sh +file + + + + +2010-05-23T00:20:49.000000Z +a9a1d730fff2e97f6d2495a110265554 +2009-11-24T20:27:39.829718Z +5138 +kris +has-props + + + + + + + + + + + + + + + + + + + + +436 + +list-rsync-backups.sh +file + + + + +2010-05-23T00:20:49.000000Z +ad1419c38766a6aedb68e3e651f1bac7 +2010-04-06T22:49:12.599480Z +6517 +kris +has-props + + + + + + + + + + + + + + + + + + + + +980 + +list-components.sh +file + + + + +2010-05-23T00:20:49.000000Z +ce5a3d8f9e5bd98611ca7c70115adb3f +2010-01-13T20:56:14.439980Z +5997 +kris +has-props + + + + + + + + + + + + + + + + + + + + +729 + +disk-part.sh +file + + + + +2010-05-23T00:20:49.000000Z +ad28392754729c65ece91d3f465e7d31 +2010-05-16T18:52:47.285311Z +6724 +kris +has-props + + + + + + + + + + + + + + + + + + + + +2154 + +update-part-list.sh +file + + + + +2010-05-23T00:20:49.000000Z +1a5d703a44e51dc0dec1c626811efce0 +2010-05-19T15:53:43.658786Z +6745 +kris +has-props + + + + + + + + + + + + + + + + + + + + +1854 + +detect-nics.sh +file + + + + +2010-05-23T00:20:49.000000Z +ff5a9f5e02f2b909e28846786d2eebb4 +2009-12-08T21:27:43.712949Z +5488 +kris +has-props + + + + + + + + + + + + + + + + + + + + +401 + +disk-list.sh +file + + + + +2010-05-23T00:20:49.000000Z +4947a1ee7ead62f138643f1c51a5c22f +2010-05-18T14:01:16.376891Z +6733 +kris +has-props + + + + + + + + + + + + + + + + + + + + +692 + +setup-ssh-keys.sh +file + + + + +2010-05-23T00:20:49.000000Z +568df0d9a1e34ed042220b7882805559 +2009-11-12T17:28:32.178595Z +4973 +kris +has-props + + + + + + + + + + + + + + + + + + + + +953 + +detect-laptop.sh +file + + + + +2010-05-23T00:20:49.000000Z +b5e2ca171e221374acb517fdecd3c72f +2009-07-09T18:57:31.007874Z +4206 +kris +has-props + + + + + + + + + + + + + + + + + + + + +133 + diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/lock b/PCBSD/pc-sysinstall/backend-query/.svn/lock new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/lock diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/detect-laptop.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/detect-laptop.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/detect-laptop.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/detect-nics.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/detect-nics.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/detect-nics.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/detect-vmware.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/detect-vmware.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/detect-vmware.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/disk-info.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/disk-info.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/disk-info.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/disk-list.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/disk-list.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/disk-list.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/disk-part.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/disk-part.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/disk-part.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/enable-net.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/enable-net.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/enable-net.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/list-components.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/list-components.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/list-components.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/list-rsync-backups.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/list-rsync-backups.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/list-rsync-backups.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/list-tzones.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/list-tzones.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/list-tzones.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/query-langs.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/query-langs.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/query-langs.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/send-logs.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/send-logs.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/send-logs.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/setup-ssh-keys.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/setup-ssh-keys.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/setup-ssh-keys.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/sys-mem.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/sys-mem.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/sys-mem.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/test-live.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/test-live.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/test-live.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/test-netup.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/test-netup.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/test-netup.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/update-part-list.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/update-part-list.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/update-part-list.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/xkeyboard-layouts.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/xkeyboard-layouts.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/xkeyboard-layouts.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/xkeyboard-models.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/xkeyboard-models.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/xkeyboard-models.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/xkeyboard-variants.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/xkeyboard-variants.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/prop-base/xkeyboard-variants.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/text-base/detect-laptop.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/detect-laptop.sh.svn-base new file mode 100644 index 0000000..bf42842 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/detect-laptop.sh.svn-base @@ -0,0 +1,8 @@ +#!/bin/sh + +dmesgLine=`dmesg | grep "acpi_acad0"` +if test "${dmesgLine}" = ""; then + echo "laptop: NO" +else + echo "laptop: YES" +fi diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/text-base/detect-nics.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/detect-nics.sh.svn-base new file mode 100644 index 0000000..ead211d --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/detect-nics.sh.svn-base @@ -0,0 +1,16 @@ +#!/bin/sh + +rm /tmp/netCards 2>/dev/null +touch /tmp/netCards + +config="`ifconfig -l`" + +for i in $config +do + echo "${i}" | grep -e "lo0" -e "^fwe" -e "^fwip" -e "lo1" -e "^plip" -e "^pfsync" -e "^pflog" -e "^tun" >/dev/null 2>/dev/null + if [ "$?" != "0" ] + then + IDENT="<`dmesg | grep ^${i} | grep -v "miibus" | grep '<' | cut -d '<' -f 2 | cut -d '>' -f 1 | head -1`>" + echo "${i}: $IDENT" + fi +done diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/text-base/detect-vmware.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/detect-vmware.sh.svn-base new file mode 100644 index 0000000..74b32db --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/detect-vmware.sh.svn-base @@ -0,0 +1,12 @@ +#!/bin/sh + + +pciconf -lv | grep -i vmware >/dev/null 2>/dev/null +if [ "$?" = "0" ] +then + echo "vmware: YES" + exit 0 +else + echo "vmware: NO" + exit 1 +fi diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/text-base/disk-info.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/disk-info.sh.svn-base new file mode 100644 index 0000000..1a4ca7e --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/disk-info.sh.svn-base @@ -0,0 +1,42 @@ +#!/bin/sh +# Query a disk for partitions and display them +############################# + +. ${PROGDIR}/backend/functions.sh +. ${PROGDIR}/backend/functions-disk.sh + +if [ -z "${1}" ] +then + echo "Error: No disk specified!" + exit 1 +fi + +if [ ! -e "/dev/${1}" ] +then + echo "Error: Disk /dev/${1} does not exist!" + exit 1 +fi + +DISK="${1}" + +get_disk_cyl "${DISK}" +CYLS="${VAL}" + +get_disk_heads "${DISK}" +HEADS="${VAL}" + +get_disk_sectors "${DISK}" +SECS="${VAL}" + +echo "cylinders=${CYLS}" +echo "heads=${HEADS}" +echo "sectors=${SECS}" + +# Now get the disks size in MB +KB="`diskinfo -v ${1} | grep 'bytes' | cut -d '#' -f 1 | tr -s '\t' ' ' | tr -d ' '`" +MB=$(convert_byte_to_megabyte ${KB}) +echo "size=$MB" + +# Now get the Controller Type +CTYPE="`dmesg | grep "^${1}:" | grep "B <" | cut -d '>' -f 2 | cut -d ' ' -f 3-10`" +echo "type=$CTYPE" diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/text-base/disk-list.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/disk-list.sh.svn-base new file mode 100644 index 0000000..4a17133 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/disk-list.sh.svn-base @@ -0,0 +1,35 @@ +#!/bin/sh + +# Create our device listing +SYSDISK=$(sysctl -n kern.disks) + +# Now loop through these devices, and list the disk drives +for i in ${SYSDISK} +do + + # Get the current device + DEV="${i}" + + # Make sure we don't find any cd devices + case "${DEV}" in + acd[0-9]*|cd[0-9]*|scd[0-9]*) continue ;; + esac + + # Check the dmesg output for some more info about this device + NEWLINE=$(dmesg | sed -n "s/^$DEV: .*<\(.*\)>.*$/ <\1>/p" | head -n 1) + if [ -z "$NEWLINE" ]; then + NEWLINE=" <Unknown Device>" + fi + + # Save the disk list + if [ ! -z "$DLIST" ] + then + DLIST="\n${DLIST}" + fi + + DLIST="${DEV}:${NEWLINE}${DLIST}" + +done + +# Echo out the found line +echo -e "$DLIST" | sort diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/text-base/disk-part.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/disk-part.sh.svn-base new file mode 100644 index 0000000..ab78768 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/disk-part.sh.svn-base @@ -0,0 +1,93 @@ +#!/bin/sh +# Query a disk for partitions and display them +############################# + +. ${PROGDIR}/backend/functions.sh +. ${PROGDIR}/backend/functions-disk.sh + +if [ -z "${1}" ] +then + echo "Error: No disk specified!" + exit 1 +fi + +if [ ! -e "/dev/${1}" ] +then + echo "Error: Disk /dev/${1} does not exist!" + exit 1 +fi + +DISK="${1}" + +# Now get the disks size in MB +KB="`diskinfo -v ${1} | grep 'bytes' | cut -d '#' -f 1 | tr -s '\t' ' ' | tr -d ' '`" +MB=$(convert_byte_to_megabyte ${KB}) +TOTALSIZE="$MB" +TOTALB="`diskinfo -v ${1} | grep 'in sectors' | tr -s '\t' ' ' | cut -d ' ' -f 2`" + + + +gpart show ${1} >/dev/null 2>/dev/null +if [ "$?" != "0" ] ; then + # No partitions on this disk, display entire disk size and exit + echo "${1}-freemb: ${TOTALSIZE}" + echo "${1}-freeblocks: ${TOTALB}" + exit +fi + +# Display if this is GPT or MBR formatted +gpart show ${1} | grep "GPT" >/dev/null 2>/dev/null +if [ "$?" = "0" ] ; then + echo "${1}-format: GPT" + TYPE="GPT" +else + echo "${1}-format: MBR" + TYPE="MBR" +fi + +# Set some search flags +PART="0" +EXTENDED="0" +START="0" +SIZEB="0" + +# Get a listing of partitions on this disk +get_disk_partitions "${DISK}" +PARTS="${VAL}" +for curpart in $PARTS +do + + # First get the sysid / label for this partition + if [ "$TYPE" = "MBR" ] ; then + get_partition_sysid_mbr "${DISK}" "${curpart}" + echo "${curpart}-sysid: ${VAL}" + get_partition_label_mbr "${DISK}" "${curpart}" + echo "${curpart}-label: ${VAL}" + else + get_partition_label_gpt "${DISK}" "${curpart}" + echo "${curpart}-sysid: ${VAL}" + echo "${curpart}-label: ${VAL}" + fi + + # Now get the startblock, blocksize and MB size of this partition + + get_partition_startblock "${DISK}" "${curpart}" + START="${VAL}" + echo "${curpart}-blockstart: ${START}" + + get_partition_blocksize "${DISK}" "${curpart}" + SIZEB="${VAL}" + echo "${curpart}-blocksize: ${SIZEB}" + + SIZEMB=$(convert_blocks_to_megabyte ${SIZEB}) + echo "${curpart}-sizemb: ${SIZEMB}" + +done + + +# Now calculate any free space +LASTB="`expr $SIZEB + $START`" +FREEB="`expr $TOTALB - $LASTB`" +FREEMB="`expr ${FREEB} / 2048`" +echo "${1}-freemb: $FREEMB" +echo "${1}-freeblocks: $FREEB" diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/text-base/enable-net.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/enable-net.sh.svn-base new file mode 100644 index 0000000..ca3115d --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/enable-net.sh.svn-base @@ -0,0 +1,39 @@ +#!/bin/sh +# Script which enables networking with specified options +########################################################################### + +. ${PROGDIR}/backend/functions.sh +. ${PROGDIR}/conf/pc-sysinstall.conf +. ${BACKEND}/functions-networking.sh +. ${BACKEND}/functions-parse.sh + + +NIC="$1" +IP="$2" +NETMASK="$3" +DNS="$4" +GATEWAY="$5" +MIRRORFETCH="$6" + +if [ -z "${NIC}" ] +then + echo "ERROR: Usage enable-net <nic> <ip> <netmask> <dns> <gateway>" + exit 150 +fi + +if [ "$NIC" = "AUTO-DHCP" ] +then + enable_auto_dhcp +else + echo "Enabling NIC: $NIC" + ifconfig ${NIC} ${IP} ${NETMASK} + + echo "nameserver ${DNS}" >/etc/resolv.conf + + route add default ${GATE} +fi + +case ${MIRRORFETCH} in + ON|on|yes|YES) fetch -o /tmp/mirrors-list.txt ${MIRRORLIST} >/dev/null 2>/dev/null;; + *) ;; +esac diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/text-base/list-components.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/list-components.sh.svn-base new file mode 100644 index 0000000..6833dc7 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/list-components.sh.svn-base @@ -0,0 +1,28 @@ +#!/bin/sh +# Script which lists the available components for this release +########################################################################### + +. ${PROGDIR}/backend/functions.sh + +echo "Available Components:" + +cd ${COMPDIR} +for i in `ls -d *` +do + if [ -e "${i}/component.cfg" -a -e "${i}/install.sh" -a -e "${i}/distfiles" ] + then + NAME="`grep 'name:' ${i}/component.cfg | cut -d ':' -f 2`" + DESC="`grep 'description:' ${i}/component.cfg | cut -d ':' -f 2`" + TYPE="`grep 'type:' ${i}/component.cfg | cut -d ':' -f 2`" + echo " " + echo "name: ${i}" + echo "desc:${DESC}" + echo "type:${TYPE}" + if [ -e "${i}/component.png" ] + then + echo "icon: ${COMPDIR}/${i}/component.png" + fi + fi + +done + diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/text-base/list-rsync-backups.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/list-rsync-backups.sh.svn-base new file mode 100644 index 0000000..6b32fb1 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/list-rsync-backups.sh.svn-base @@ -0,0 +1,44 @@ +#!/bin/sh +# Script which lists the backups present on a server +########################################################################### + +. ${PROGDIR}/backend/functions.sh + +SSHUSER=$1 +SSHHOST=$2 +SSHPORT=$3 + +if [ -z "${SSHHOST}" -o -z "${SSHPORT}" ] +then + echo "ERROR: Usage list-rsync-backups.sh <user> <host> <port>" + exit 150 +fi + +# Look for full-system backups, needs at minimum a kernel to be bootable +FINDCMD="find . -type d -maxdepth 6 -name 'kernel' | grep '/boot/kernel'" + +# Get a listing of the number of full backups saved +OLDBACKUPS=`ssh -o 'BatchMode=yes' -p ${SSHPORT} ${SSHUSER}@${SSHHOST} "${FINDCMD}"` +if [ "$?" = "0" ] +then + for i in ${OLDBACKUPS} + do + BACKPATH="`echo ${i} | sed 's|/boot/.*||g' | sed 's|^./||g'`" + if [ -z "${BACKLIST}" ] + then + BACKLIST="${BACKPATH}" + else + BACKLIST="${BACKLIST}:${BACKPATH}" + fi + done + + if [ -z "${BACKLIST}" ] + then + echo "NONE" + else + echo "$BACKLIST" + fi + +else + echo "FAILED" +fi diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/text-base/list-tzones.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/list-tzones.sh.svn-base new file mode 100644 index 0000000..38bae91 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/list-tzones.sh.svn-base @@ -0,0 +1,18 @@ +#!/bin/sh + +rm ${TMPDIR}/.tzonetmp >/dev/null 2>/dev/null + +# Backend script which lists all the available timezones for front-ends to display +while read line +do + echo "$line" | grep "^#" >/dev/null 2>/dev/null + if [ "$?" != "0" ] + then + echo "$line" | tr -s "\t" ":" | cut -d ":" -f 3-4 >>${TMPDIR}/.tzonetmp + fi +done < /usr/share/zoneinfo/zone.tab + +sort ${TMPDIR}/.tzonetmp +rm ${TMPDIR}/.tzonetmp >/dev/null 2>/dev/null + +exit 0 diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/text-base/query-langs.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/query-langs.sh.svn-base new file mode 100644 index 0000000..7951ca6f --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/query-langs.sh.svn-base @@ -0,0 +1,7 @@ +#!/bin/sh + +FOUND="0" + +cat ${PROGDIR}/conf/avail-langs + +exit 0 diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/text-base/send-logs.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/send-logs.sh.svn-base new file mode 100644 index 0000000..c182b22 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/send-logs.sh.svn-base @@ -0,0 +1,57 @@ +#!/bin/sh +# Script which creates a gzipped log and optionally mails it to the specified address +############################################################################ + +. ${PROGDIR}/backend/functions.sh +. ${PROGDIR}/conf/pc-sysinstall.conf +. ${BACKEND}/functions-networking.sh +. ${BACKEND}/functions-parse.sh + +# Bring up all NICS under DHCP +enable_auto_dhcp + +MAILTO="$1" +MAILRESULT="0" + +# Set the location of our compressed log +TMPLOG="/tmp/pc-sysinstall.log" + +echo "# PC-SYSINSTALL LOG" >${TMPLOG} +cat ${LOGOUT} >> ${TMPLOG} + +# Check if we have a GUI generated install cfg +if [ -e "/tmp/sys-install.cfg" ] +then + echo "" >>${TMPLOG} + echo "# PC-SYSINSTALL CFG " >>${TMPLOG} + cat /tmp/sys-install.cfg >> ${TMPLOG} +fi + +# Save dmesg output +echo "" >>${TMPLOG} +echo "# DMESG OUTPUT " >>${TMPLOG} +dmesg >> ${TMPLOG} + +# Get gpart info on all disks +for i in `${PROGDIR}/pc-sysinstall disk-list | cut -d ':' -f 1` +do + echo "" >>${TMPLOG} + echo "# DISK INFO $i " >>${TMPLOG} + ls /dev/${i}* >>${TMPLOG} + gpart show ${i} >> ${TMPLOG} +done + +# Show Mounted volumes +echo "" >>${TMPLOG} +echo "# MOUNT OUTPUT " >>${TMPLOG} +mount >> ${TMPLOG} + +echo "Log file saved to ${TMPLOG}" +echo "Warning: This file will be lost once the system is rebooted." + +echo "Do you wish to view this logfile now? (Y/N)" +read tmp +if [ "$tmp" = "Y" -o "$tmp" = "y" ] +then + more ${TMPLOG} +fi diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/text-base/setup-ssh-keys.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/setup-ssh-keys.sh.svn-base new file mode 100644 index 0000000..9b09e99 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/setup-ssh-keys.sh.svn-base @@ -0,0 +1,38 @@ +#!/bin/sh +# Script which sets up password-less logins for ssh host +########################################################################### + +. ${PROGDIR}/backend/functions.sh + +SSHUSER=$1 +SSHHOST=$2 +SSHPORT=$3 + +if [ -z "${SSHUSER}" -o -z "${SSHHOST}" -o -z "${SSHPORT}" ] +then + echo "ERROR: Usage setup-ssh-keys <user> <host> <port>" + exit 150 +fi + +cd ~ + +echo "Preparing to setup SSH key authorization..." +echo "When prompted, enter your password for ${SSHUSER}@${SSHHOST}" + +if [ ! -e ".ssh/id_rsa.pub" ] +then + mkdir .ssh >/dev/null 2>/dev/null + ssh-keygen -q -t rsa -N '' -f .ssh/id_rsa + sleep 1 +fi + +if [ ! -e ".ssh/id_rsa.pub" ] +then + echo "ERROR: Failed creating .ssh/id_rsa.pub" + exit 150 +fi + +# Get the .pub key +PUBKEY="`cat .ssh/id_rsa.pub`" + +ssh -p ${SSHPORT} ${SSHUSER}@${SSHHOST} "mkdir .ssh ; echo $PUBKEY >> .ssh/authorized_keys; chmod 600 .ssh/authorized_keys ; echo $PUBKEY >> .ssh/authorized_keys2; chmod 600 .ssh/authorized_keys2" diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/text-base/sys-mem.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/sys-mem.sh.svn-base new file mode 100644 index 0000000..f087621 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/sys-mem.sh.svn-base @@ -0,0 +1,6 @@ +#!/bin/sh + +MEM=`sysctl hw.realmem | sed "s|hw.realmem: ||g"` +MEM=`expr $MEM / 1024` +MEM=`expr $MEM / 1024` +echo $MEM diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/text-base/test-live.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/test-live.sh.svn-base new file mode 100644 index 0000000..67ec7a5 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/test-live.sh.svn-base @@ -0,0 +1,14 @@ +#!/bin/sh +# Script which checks if we are running from install media, or real system +############################################################################# + +dmesg | grep "md0: Preloaded image" >/dev/null 2>/dev/null +if [ "$?" = "0" ] +then + echo "INSTALL-MEDIA" + exit 0 +else + echo "REAL-DISK" + exit 1 +fi + diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/text-base/test-netup.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/test-netup.sh.svn-base new file mode 100644 index 0000000..666781d --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/test-netup.sh.svn-base @@ -0,0 +1,23 @@ +#!/bin/sh +# Script which tests "fetch" when using a network connection, and saves +# if we are using direct connect, or need FTP passive mode +############################################################################# + +rm ${TMPDIR}/.testftp >/dev/null 2>/dev/null + +ping -c 2 www.pcbsd.org >/dev/null 2>/dev/null +if [ "$?" = "0" ] +then + echo "ftp: Up" + exit 0 +fi + +ping -c 2 www.freebsd.org >/dev/null 2>/dev/null +if [ "$?" = "0" ] +then + echo "ftp: Up" + exit 0 +fi + +echo "ftp: Down" +exit 1 diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/text-base/update-part-list.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/update-part-list.sh.svn-base new file mode 100644 index 0000000..9e38b53 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/update-part-list.sh.svn-base @@ -0,0 +1,75 @@ +#!/bin/sh + +echo "Running: find-update-parts" >> ${LOGOUT} + +rm ${TMPDIR}/AvailUpgrades >/dev/null 2>/dev/null + +FSMNT="/mnt" + +# Get the freebsd version on this partition +get_fbsd_ver() { + + VER="`file ${FSMNT}/bin/sh | grep 'for FreeBSD' | sed 's|for FreeBSD |;|g' | cut -d ';' -f 2 | cut -d ',' -f 1`" + if [ "$?" = "0" ] ; then + file ${FSMNT}/bin/sh | grep '32-bit' >/dev/null 2>/dev/null + if [ "${?}" = "0" ] ; then + echo "${1}: FreeBSD ${VER} (32bit)" + else + echo "${1}: FreeBSD ${VER} (64bit)" + fi + fi + +} + +# Create our device listing +SYSDISK="`sysctl kern.disks | cut -d ':' -f 2 | sed 's/^[ \t]*//'`" +DEVS="" + +# Now loop through these devices, and list the disk drives +for i in ${SYSDISK} +do + + # Get the current device + DEV="${i}" + # Make sure we don't find any cd devices + echo "${DEV}" | grep -e "^acd[0-9]" -e "^cd[0-9]" -e "^scd[0-9]" >/dev/null 2>/dev/null + if [ "$?" != "0" ] ; then + DEVS="${DEVS} `ls /dev/${i}s*`" + fi + +done + +# Import any zpools +zpool import -a + +for i in $DEVS +do + if [ -e "${i}a.journal" ] ; then + mount ${i}a.journal ${FSMNT} >>${LOGOUT} 2>>${LOGOUT} + if [ "${?}" = "0" ] ; then + get_fbsd_ver ${i} + umount -f ${FSMNT} >/dev/null 2>/dev/null + fi + elif [ -e "${i}a" ] + then + mount ${i}a ${FSMNT} >>${LOGOUT} 2>>${LOGOUT} + if [ "${?}" = "0" ] ; then + get_fbsd_ver ${i} + umount -f ${FSMNT} >/dev/null 2>/dev/null + else + # Lets try ZFS of this device + ZNAME=`echo ${i} | cut -d '/' -f 3` + mount -t zfs ${ZNAME}a ${FSMNT} + if [ "${?}" = "0" ] ; then + get_fbsd_ver ${i} + umount -f ${FSMNT} >/dev/null 2>/dev/null + fi + fi + fi +done + +# Export all zpools again, so that we can overwrite these partitions potentially +#for i in `zpool list -H -o name` +#do +# zpool export -f ${i} +#done diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/text-base/xkeyboard-layouts.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/xkeyboard-layouts.sh.svn-base new file mode 100644 index 0000000..b2b92f3 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/xkeyboard-layouts.sh.svn-base @@ -0,0 +1,31 @@ +#!/bin/sh + +FOUND="0" + +# Lets parse the xorg.list file, and see what layouts are supported +while read line +do + + if [ "$FOUND" = "1" -a ! -z "$line" ] + then + echo $line | grep '! ' >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + exit 0 + else + echo "$line" + fi + fi + + if [ "${FOUND}" = "0" ] + then + echo $line | grep '! layout' >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + FOUND="1" + fi + fi + +done < /usr/local/share/X11/xkb/rules/xorg.lst + +exit 0 diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/text-base/xkeyboard-models.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/xkeyboard-models.sh.svn-base new file mode 100644 index 0000000..0d72681 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/xkeyboard-models.sh.svn-base @@ -0,0 +1,33 @@ +#!/bin/sh + +FOUND="0" + +# Lets parse the xorg.list file, and see what models are supported +while read line +do + + if [ "$FOUND" = "1" -a ! -z "$line" ] + then + echo $line | grep '! ' >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + exit 0 + else + model="`echo $line | sed 's|(|[|g'`" + model="`echo $model | sed 's|)|]|g'`" + echo "$model" + fi + fi + + if [ "${FOUND}" = "0" ] + then + echo $line | grep '! model' >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + FOUND="1" + fi + fi + +done < /usr/local/share/X11/xkb/rules/xorg.lst + +exit 0 diff --git a/PCBSD/pc-sysinstall/backend-query/.svn/text-base/xkeyboard-variants.sh.svn-base b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/xkeyboard-variants.sh.svn-base new file mode 100644 index 0000000..3bf18d7 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/.svn/text-base/xkeyboard-variants.sh.svn-base @@ -0,0 +1,31 @@ +#!/bin/sh + +FOUND="0" + +# Lets parse the xorg.list file, and see what varients are supported +while read line +do + + if [ "$FOUND" = "1" -a ! -z "$line" ] + then + echo $line | grep '! ' >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + exit 0 + else + echo "$line" + fi + fi + + if [ "${FOUND}" = "0" ] + then + echo $line | grep '! variant' >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + FOUND="1" + fi + fi + +done < /usr/local/share/X11/xkb/rules/xorg.lst + +exit 0 diff --git a/PCBSD/pc-sysinstall/backend-query/detect-laptop.sh b/PCBSD/pc-sysinstall/backend-query/detect-laptop.sh new file mode 100755 index 0000000..bf42842 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/detect-laptop.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +dmesgLine=`dmesg | grep "acpi_acad0"` +if test "${dmesgLine}" = ""; then + echo "laptop: NO" +else + echo "laptop: YES" +fi diff --git a/PCBSD/pc-sysinstall/backend-query/detect-nics.sh b/PCBSD/pc-sysinstall/backend-query/detect-nics.sh new file mode 100755 index 0000000..ead211d --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/detect-nics.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +rm /tmp/netCards 2>/dev/null +touch /tmp/netCards + +config="`ifconfig -l`" + +for i in $config +do + echo "${i}" | grep -e "lo0" -e "^fwe" -e "^fwip" -e "lo1" -e "^plip" -e "^pfsync" -e "^pflog" -e "^tun" >/dev/null 2>/dev/null + if [ "$?" != "0" ] + then + IDENT="<`dmesg | grep ^${i} | grep -v "miibus" | grep '<' | cut -d '<' -f 2 | cut -d '>' -f 1 | head -1`>" + echo "${i}: $IDENT" + fi +done diff --git a/PCBSD/pc-sysinstall/backend-query/detect-vmware.sh b/PCBSD/pc-sysinstall/backend-query/detect-vmware.sh new file mode 100755 index 0000000..74b32db --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/detect-vmware.sh @@ -0,0 +1,12 @@ +#!/bin/sh + + +pciconf -lv | grep -i vmware >/dev/null 2>/dev/null +if [ "$?" = "0" ] +then + echo "vmware: YES" + exit 0 +else + echo "vmware: NO" + exit 1 +fi diff --git a/PCBSD/pc-sysinstall/backend-query/disk-info.sh b/PCBSD/pc-sysinstall/backend-query/disk-info.sh new file mode 100755 index 0000000..1a4ca7e --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/disk-info.sh @@ -0,0 +1,42 @@ +#!/bin/sh +# Query a disk for partitions and display them +############################# + +. ${PROGDIR}/backend/functions.sh +. ${PROGDIR}/backend/functions-disk.sh + +if [ -z "${1}" ] +then + echo "Error: No disk specified!" + exit 1 +fi + +if [ ! -e "/dev/${1}" ] +then + echo "Error: Disk /dev/${1} does not exist!" + exit 1 +fi + +DISK="${1}" + +get_disk_cyl "${DISK}" +CYLS="${VAL}" + +get_disk_heads "${DISK}" +HEADS="${VAL}" + +get_disk_sectors "${DISK}" +SECS="${VAL}" + +echo "cylinders=${CYLS}" +echo "heads=${HEADS}" +echo "sectors=${SECS}" + +# Now get the disks size in MB +KB="`diskinfo -v ${1} | grep 'bytes' | cut -d '#' -f 1 | tr -s '\t' ' ' | tr -d ' '`" +MB=$(convert_byte_to_megabyte ${KB}) +echo "size=$MB" + +# Now get the Controller Type +CTYPE="`dmesg | grep "^${1}:" | grep "B <" | cut -d '>' -f 2 | cut -d ' ' -f 3-10`" +echo "type=$CTYPE" diff --git a/PCBSD/pc-sysinstall/backend-query/disk-list.sh b/PCBSD/pc-sysinstall/backend-query/disk-list.sh new file mode 100755 index 0000000..4a17133 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/disk-list.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +# Create our device listing +SYSDISK=$(sysctl -n kern.disks) + +# Now loop through these devices, and list the disk drives +for i in ${SYSDISK} +do + + # Get the current device + DEV="${i}" + + # Make sure we don't find any cd devices + case "${DEV}" in + acd[0-9]*|cd[0-9]*|scd[0-9]*) continue ;; + esac + + # Check the dmesg output for some more info about this device + NEWLINE=$(dmesg | sed -n "s/^$DEV: .*<\(.*\)>.*$/ <\1>/p" | head -n 1) + if [ -z "$NEWLINE" ]; then + NEWLINE=" <Unknown Device>" + fi + + # Save the disk list + if [ ! -z "$DLIST" ] + then + DLIST="\n${DLIST}" + fi + + DLIST="${DEV}:${NEWLINE}${DLIST}" + +done + +# Echo out the found line +echo -e "$DLIST" | sort diff --git a/PCBSD/pc-sysinstall/backend-query/disk-part.sh b/PCBSD/pc-sysinstall/backend-query/disk-part.sh new file mode 100755 index 0000000..ab78768 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/disk-part.sh @@ -0,0 +1,93 @@ +#!/bin/sh +# Query a disk for partitions and display them +############################# + +. ${PROGDIR}/backend/functions.sh +. ${PROGDIR}/backend/functions-disk.sh + +if [ -z "${1}" ] +then + echo "Error: No disk specified!" + exit 1 +fi + +if [ ! -e "/dev/${1}" ] +then + echo "Error: Disk /dev/${1} does not exist!" + exit 1 +fi + +DISK="${1}" + +# Now get the disks size in MB +KB="`diskinfo -v ${1} | grep 'bytes' | cut -d '#' -f 1 | tr -s '\t' ' ' | tr -d ' '`" +MB=$(convert_byte_to_megabyte ${KB}) +TOTALSIZE="$MB" +TOTALB="`diskinfo -v ${1} | grep 'in sectors' | tr -s '\t' ' ' | cut -d ' ' -f 2`" + + + +gpart show ${1} >/dev/null 2>/dev/null +if [ "$?" != "0" ] ; then + # No partitions on this disk, display entire disk size and exit + echo "${1}-freemb: ${TOTALSIZE}" + echo "${1}-freeblocks: ${TOTALB}" + exit +fi + +# Display if this is GPT or MBR formatted +gpart show ${1} | grep "GPT" >/dev/null 2>/dev/null +if [ "$?" = "0" ] ; then + echo "${1}-format: GPT" + TYPE="GPT" +else + echo "${1}-format: MBR" + TYPE="MBR" +fi + +# Set some search flags +PART="0" +EXTENDED="0" +START="0" +SIZEB="0" + +# Get a listing of partitions on this disk +get_disk_partitions "${DISK}" +PARTS="${VAL}" +for curpart in $PARTS +do + + # First get the sysid / label for this partition + if [ "$TYPE" = "MBR" ] ; then + get_partition_sysid_mbr "${DISK}" "${curpart}" + echo "${curpart}-sysid: ${VAL}" + get_partition_label_mbr "${DISK}" "${curpart}" + echo "${curpart}-label: ${VAL}" + else + get_partition_label_gpt "${DISK}" "${curpart}" + echo "${curpart}-sysid: ${VAL}" + echo "${curpart}-label: ${VAL}" + fi + + # Now get the startblock, blocksize and MB size of this partition + + get_partition_startblock "${DISK}" "${curpart}" + START="${VAL}" + echo "${curpart}-blockstart: ${START}" + + get_partition_blocksize "${DISK}" "${curpart}" + SIZEB="${VAL}" + echo "${curpart}-blocksize: ${SIZEB}" + + SIZEMB=$(convert_blocks_to_megabyte ${SIZEB}) + echo "${curpart}-sizemb: ${SIZEMB}" + +done + + +# Now calculate any free space +LASTB="`expr $SIZEB + $START`" +FREEB="`expr $TOTALB - $LASTB`" +FREEMB="`expr ${FREEB} / 2048`" +echo "${1}-freemb: $FREEMB" +echo "${1}-freeblocks: $FREEB" diff --git a/PCBSD/pc-sysinstall/backend-query/enable-net.sh b/PCBSD/pc-sysinstall/backend-query/enable-net.sh new file mode 100755 index 0000000..ca3115d --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/enable-net.sh @@ -0,0 +1,39 @@ +#!/bin/sh +# Script which enables networking with specified options +########################################################################### + +. ${PROGDIR}/backend/functions.sh +. ${PROGDIR}/conf/pc-sysinstall.conf +. ${BACKEND}/functions-networking.sh +. ${BACKEND}/functions-parse.sh + + +NIC="$1" +IP="$2" +NETMASK="$3" +DNS="$4" +GATEWAY="$5" +MIRRORFETCH="$6" + +if [ -z "${NIC}" ] +then + echo "ERROR: Usage enable-net <nic> <ip> <netmask> <dns> <gateway>" + exit 150 +fi + +if [ "$NIC" = "AUTO-DHCP" ] +then + enable_auto_dhcp +else + echo "Enabling NIC: $NIC" + ifconfig ${NIC} ${IP} ${NETMASK} + + echo "nameserver ${DNS}" >/etc/resolv.conf + + route add default ${GATE} +fi + +case ${MIRRORFETCH} in + ON|on|yes|YES) fetch -o /tmp/mirrors-list.txt ${MIRRORLIST} >/dev/null 2>/dev/null;; + *) ;; +esac diff --git a/PCBSD/pc-sysinstall/backend-query/list-components.sh b/PCBSD/pc-sysinstall/backend-query/list-components.sh new file mode 100755 index 0000000..6833dc7 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/list-components.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# Script which lists the available components for this release +########################################################################### + +. ${PROGDIR}/backend/functions.sh + +echo "Available Components:" + +cd ${COMPDIR} +for i in `ls -d *` +do + if [ -e "${i}/component.cfg" -a -e "${i}/install.sh" -a -e "${i}/distfiles" ] + then + NAME="`grep 'name:' ${i}/component.cfg | cut -d ':' -f 2`" + DESC="`grep 'description:' ${i}/component.cfg | cut -d ':' -f 2`" + TYPE="`grep 'type:' ${i}/component.cfg | cut -d ':' -f 2`" + echo " " + echo "name: ${i}" + echo "desc:${DESC}" + echo "type:${TYPE}" + if [ -e "${i}/component.png" ] + then + echo "icon: ${COMPDIR}/${i}/component.png" + fi + fi + +done + diff --git a/PCBSD/pc-sysinstall/backend-query/list-rsync-backups.sh b/PCBSD/pc-sysinstall/backend-query/list-rsync-backups.sh new file mode 100755 index 0000000..6b32fb1 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/list-rsync-backups.sh @@ -0,0 +1,44 @@ +#!/bin/sh +# Script which lists the backups present on a server +########################################################################### + +. ${PROGDIR}/backend/functions.sh + +SSHUSER=$1 +SSHHOST=$2 +SSHPORT=$3 + +if [ -z "${SSHHOST}" -o -z "${SSHPORT}" ] +then + echo "ERROR: Usage list-rsync-backups.sh <user> <host> <port>" + exit 150 +fi + +# Look for full-system backups, needs at minimum a kernel to be bootable +FINDCMD="find . -type d -maxdepth 6 -name 'kernel' | grep '/boot/kernel'" + +# Get a listing of the number of full backups saved +OLDBACKUPS=`ssh -o 'BatchMode=yes' -p ${SSHPORT} ${SSHUSER}@${SSHHOST} "${FINDCMD}"` +if [ "$?" = "0" ] +then + for i in ${OLDBACKUPS} + do + BACKPATH="`echo ${i} | sed 's|/boot/.*||g' | sed 's|^./||g'`" + if [ -z "${BACKLIST}" ] + then + BACKLIST="${BACKPATH}" + else + BACKLIST="${BACKLIST}:${BACKPATH}" + fi + done + + if [ -z "${BACKLIST}" ] + then + echo "NONE" + else + echo "$BACKLIST" + fi + +else + echo "FAILED" +fi diff --git a/PCBSD/pc-sysinstall/backend-query/list-tzones.sh b/PCBSD/pc-sysinstall/backend-query/list-tzones.sh new file mode 100755 index 0000000..38bae91 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/list-tzones.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +rm ${TMPDIR}/.tzonetmp >/dev/null 2>/dev/null + +# Backend script which lists all the available timezones for front-ends to display +while read line +do + echo "$line" | grep "^#" >/dev/null 2>/dev/null + if [ "$?" != "0" ] + then + echo "$line" | tr -s "\t" ":" | cut -d ":" -f 3-4 >>${TMPDIR}/.tzonetmp + fi +done < /usr/share/zoneinfo/zone.tab + +sort ${TMPDIR}/.tzonetmp +rm ${TMPDIR}/.tzonetmp >/dev/null 2>/dev/null + +exit 0 diff --git a/PCBSD/pc-sysinstall/backend-query/query-langs.sh b/PCBSD/pc-sysinstall/backend-query/query-langs.sh new file mode 100755 index 0000000..7951ca6f --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/query-langs.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +FOUND="0" + +cat ${PROGDIR}/conf/avail-langs + +exit 0 diff --git a/PCBSD/pc-sysinstall/backend-query/send-logs.sh b/PCBSD/pc-sysinstall/backend-query/send-logs.sh new file mode 100755 index 0000000..c182b22 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/send-logs.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# Script which creates a gzipped log and optionally mails it to the specified address +############################################################################ + +. ${PROGDIR}/backend/functions.sh +. ${PROGDIR}/conf/pc-sysinstall.conf +. ${BACKEND}/functions-networking.sh +. ${BACKEND}/functions-parse.sh + +# Bring up all NICS under DHCP +enable_auto_dhcp + +MAILTO="$1" +MAILRESULT="0" + +# Set the location of our compressed log +TMPLOG="/tmp/pc-sysinstall.log" + +echo "# PC-SYSINSTALL LOG" >${TMPLOG} +cat ${LOGOUT} >> ${TMPLOG} + +# Check if we have a GUI generated install cfg +if [ -e "/tmp/sys-install.cfg" ] +then + echo "" >>${TMPLOG} + echo "# PC-SYSINSTALL CFG " >>${TMPLOG} + cat /tmp/sys-install.cfg >> ${TMPLOG} +fi + +# Save dmesg output +echo "" >>${TMPLOG} +echo "# DMESG OUTPUT " >>${TMPLOG} +dmesg >> ${TMPLOG} + +# Get gpart info on all disks +for i in `${PROGDIR}/pc-sysinstall disk-list | cut -d ':' -f 1` +do + echo "" >>${TMPLOG} + echo "# DISK INFO $i " >>${TMPLOG} + ls /dev/${i}* >>${TMPLOG} + gpart show ${i} >> ${TMPLOG} +done + +# Show Mounted volumes +echo "" >>${TMPLOG} +echo "# MOUNT OUTPUT " >>${TMPLOG} +mount >> ${TMPLOG} + +echo "Log file saved to ${TMPLOG}" +echo "Warning: This file will be lost once the system is rebooted." + +echo "Do you wish to view this logfile now? (Y/N)" +read tmp +if [ "$tmp" = "Y" -o "$tmp" = "y" ] +then + more ${TMPLOG} +fi diff --git a/PCBSD/pc-sysinstall/backend-query/setup-ssh-keys.sh b/PCBSD/pc-sysinstall/backend-query/setup-ssh-keys.sh new file mode 100755 index 0000000..9b09e99 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/setup-ssh-keys.sh @@ -0,0 +1,38 @@ +#!/bin/sh +# Script which sets up password-less logins for ssh host +########################################################################### + +. ${PROGDIR}/backend/functions.sh + +SSHUSER=$1 +SSHHOST=$2 +SSHPORT=$3 + +if [ -z "${SSHUSER}" -o -z "${SSHHOST}" -o -z "${SSHPORT}" ] +then + echo "ERROR: Usage setup-ssh-keys <user> <host> <port>" + exit 150 +fi + +cd ~ + +echo "Preparing to setup SSH key authorization..." +echo "When prompted, enter your password for ${SSHUSER}@${SSHHOST}" + +if [ ! -e ".ssh/id_rsa.pub" ] +then + mkdir .ssh >/dev/null 2>/dev/null + ssh-keygen -q -t rsa -N '' -f .ssh/id_rsa + sleep 1 +fi + +if [ ! -e ".ssh/id_rsa.pub" ] +then + echo "ERROR: Failed creating .ssh/id_rsa.pub" + exit 150 +fi + +# Get the .pub key +PUBKEY="`cat .ssh/id_rsa.pub`" + +ssh -p ${SSHPORT} ${SSHUSER}@${SSHHOST} "mkdir .ssh ; echo $PUBKEY >> .ssh/authorized_keys; chmod 600 .ssh/authorized_keys ; echo $PUBKEY >> .ssh/authorized_keys2; chmod 600 .ssh/authorized_keys2" diff --git a/PCBSD/pc-sysinstall/backend-query/sys-mem.sh b/PCBSD/pc-sysinstall/backend-query/sys-mem.sh new file mode 100755 index 0000000..f087621 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/sys-mem.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +MEM=`sysctl hw.realmem | sed "s|hw.realmem: ||g"` +MEM=`expr $MEM / 1024` +MEM=`expr $MEM / 1024` +echo $MEM diff --git a/PCBSD/pc-sysinstall/backend-query/test-live.sh b/PCBSD/pc-sysinstall/backend-query/test-live.sh new file mode 100755 index 0000000..67ec7a5 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/test-live.sh @@ -0,0 +1,14 @@ +#!/bin/sh +# Script which checks if we are running from install media, or real system +############################################################################# + +dmesg | grep "md0: Preloaded image" >/dev/null 2>/dev/null +if [ "$?" = "0" ] +then + echo "INSTALL-MEDIA" + exit 0 +else + echo "REAL-DISK" + exit 1 +fi + diff --git a/PCBSD/pc-sysinstall/backend-query/test-netup.sh b/PCBSD/pc-sysinstall/backend-query/test-netup.sh new file mode 100755 index 0000000..666781d --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/test-netup.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# Script which tests "fetch" when using a network connection, and saves +# if we are using direct connect, or need FTP passive mode +############################################################################# + +rm ${TMPDIR}/.testftp >/dev/null 2>/dev/null + +ping -c 2 www.pcbsd.org >/dev/null 2>/dev/null +if [ "$?" = "0" ] +then + echo "ftp: Up" + exit 0 +fi + +ping -c 2 www.freebsd.org >/dev/null 2>/dev/null +if [ "$?" = "0" ] +then + echo "ftp: Up" + exit 0 +fi + +echo "ftp: Down" +exit 1 diff --git a/PCBSD/pc-sysinstall/backend-query/update-part-list.sh b/PCBSD/pc-sysinstall/backend-query/update-part-list.sh new file mode 100755 index 0000000..9e38b53 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/update-part-list.sh @@ -0,0 +1,75 @@ +#!/bin/sh + +echo "Running: find-update-parts" >> ${LOGOUT} + +rm ${TMPDIR}/AvailUpgrades >/dev/null 2>/dev/null + +FSMNT="/mnt" + +# Get the freebsd version on this partition +get_fbsd_ver() { + + VER="`file ${FSMNT}/bin/sh | grep 'for FreeBSD' | sed 's|for FreeBSD |;|g' | cut -d ';' -f 2 | cut -d ',' -f 1`" + if [ "$?" = "0" ] ; then + file ${FSMNT}/bin/sh | grep '32-bit' >/dev/null 2>/dev/null + if [ "${?}" = "0" ] ; then + echo "${1}: FreeBSD ${VER} (32bit)" + else + echo "${1}: FreeBSD ${VER} (64bit)" + fi + fi + +} + +# Create our device listing +SYSDISK="`sysctl kern.disks | cut -d ':' -f 2 | sed 's/^[ \t]*//'`" +DEVS="" + +# Now loop through these devices, and list the disk drives +for i in ${SYSDISK} +do + + # Get the current device + DEV="${i}" + # Make sure we don't find any cd devices + echo "${DEV}" | grep -e "^acd[0-9]" -e "^cd[0-9]" -e "^scd[0-9]" >/dev/null 2>/dev/null + if [ "$?" != "0" ] ; then + DEVS="${DEVS} `ls /dev/${i}s*`" + fi + +done + +# Import any zpools +zpool import -a + +for i in $DEVS +do + if [ -e "${i}a.journal" ] ; then + mount ${i}a.journal ${FSMNT} >>${LOGOUT} 2>>${LOGOUT} + if [ "${?}" = "0" ] ; then + get_fbsd_ver ${i} + umount -f ${FSMNT} >/dev/null 2>/dev/null + fi + elif [ -e "${i}a" ] + then + mount ${i}a ${FSMNT} >>${LOGOUT} 2>>${LOGOUT} + if [ "${?}" = "0" ] ; then + get_fbsd_ver ${i} + umount -f ${FSMNT} >/dev/null 2>/dev/null + else + # Lets try ZFS of this device + ZNAME=`echo ${i} | cut -d '/' -f 3` + mount -t zfs ${ZNAME}a ${FSMNT} + if [ "${?}" = "0" ] ; then + get_fbsd_ver ${i} + umount -f ${FSMNT} >/dev/null 2>/dev/null + fi + fi + fi +done + +# Export all zpools again, so that we can overwrite these partitions potentially +#for i in `zpool list -H -o name` +#do +# zpool export -f ${i} +#done diff --git a/PCBSD/pc-sysinstall/backend-query/xkeyboard-layouts.sh b/PCBSD/pc-sysinstall/backend-query/xkeyboard-layouts.sh new file mode 100755 index 0000000..b2b92f3 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/xkeyboard-layouts.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +FOUND="0" + +# Lets parse the xorg.list file, and see what layouts are supported +while read line +do + + if [ "$FOUND" = "1" -a ! -z "$line" ] + then + echo $line | grep '! ' >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + exit 0 + else + echo "$line" + fi + fi + + if [ "${FOUND}" = "0" ] + then + echo $line | grep '! layout' >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + FOUND="1" + fi + fi + +done < /usr/local/share/X11/xkb/rules/xorg.lst + +exit 0 diff --git a/PCBSD/pc-sysinstall/backend-query/xkeyboard-models.sh b/PCBSD/pc-sysinstall/backend-query/xkeyboard-models.sh new file mode 100755 index 0000000..0d72681 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/xkeyboard-models.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +FOUND="0" + +# Lets parse the xorg.list file, and see what models are supported +while read line +do + + if [ "$FOUND" = "1" -a ! -z "$line" ] + then + echo $line | grep '! ' >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + exit 0 + else + model="`echo $line | sed 's|(|[|g'`" + model="`echo $model | sed 's|)|]|g'`" + echo "$model" + fi + fi + + if [ "${FOUND}" = "0" ] + then + echo $line | grep '! model' >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + FOUND="1" + fi + fi + +done < /usr/local/share/X11/xkb/rules/xorg.lst + +exit 0 diff --git a/PCBSD/pc-sysinstall/backend-query/xkeyboard-variants.sh b/PCBSD/pc-sysinstall/backend-query/xkeyboard-variants.sh new file mode 100755 index 0000000..3bf18d7 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend-query/xkeyboard-variants.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +FOUND="0" + +# Lets parse the xorg.list file, and see what varients are supported +while read line +do + + if [ "$FOUND" = "1" -a ! -z "$line" ] + then + echo $line | grep '! ' >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + exit 0 + else + echo "$line" + fi + fi + + if [ "${FOUND}" = "0" ] + then + echo $line | grep '! variant' >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + FOUND="1" + fi + fi + +done < /usr/local/share/X11/xkb/rules/xorg.lst + +exit 0 diff --git a/PCBSD/pc-sysinstall/backend/.svn/entries b/PCBSD/pc-sysinstall/backend/.svn/entries new file mode 100644 index 0000000..4402e3a --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/.svn/entries @@ -0,0 +1,640 @@ +10 + +dir +6759 +svn://svn.pcbsd.org/pcbsd/current/pc-sysinstall/backend +svn://svn.pcbsd.org + + + +2010-05-22T19:59:31.576442Z +6759 +ayerenkow + + + + + + + + + + + + + + +212fe199-4beb-da11-a70e-00e08102fd27 + +functions-users.sh +file + + + + +2010-05-23T00:20:49.000000Z +b491892fd2657913a1b8d533290f235e +2009-11-13T19:38:48.836985Z +5020 +kris + + + + + + + + + + + + + + + + + + + + + +3641 + +functions.sh +file + + + + +2010-05-23T00:20:49.000000Z +9f599a0beb00995ba08f1766119fdba5 +2010-05-16T18:52:47.285311Z +6724 +kris + + + + + + + + + + + + + + + + + + + + + +4617 + +functions-localize.sh +file + + + + +2010-05-23T00:20:49.000000Z +0731744b38de88f94d13548662852031 +2010-05-22T19:59:31.576442Z +6759 +ayerenkow + + + + + + + + + + + + + + + + + + + + + +10707 + +functions-unmount.sh +file + + + + +2010-05-23T00:20:49.000000Z +fda52422b07c35b56df627125912e0d9 +2010-05-19T15:53:43.658786Z +6745 +kris + + + + + + + + + + + + + + + + + + + + + +4903 + +startautoinstall.sh +file + + + + +2010-05-23T00:20:49.000000Z +4c9dd792a22d634d594b0605216e8ec2 +2010-05-11T17:59:10.123893Z +6693 +kris +has-props + + + + + + + + + + + + + + + + + + + + +3331 + +functions-bsdlabel.sh +file + + + + +2010-05-23T00:20:49.000000Z +9ed6f132c916bd27175af9a36b6e8772 +2010-05-20T12:37:14.779822Z +6746 +kris + + + + + + + + + + + + + + + + + + + + + +16780 + +functions-parse.sh +file + + + + +2010-05-23T00:20:49.000000Z +b77eb406b67335f4d4198a041619965f +2010-03-11T07:55:56.999915Z +6386 +kris + + + + + + + + + + + + + + + + + + + + + +4734 + +functions-installcomponents.sh +file + + + + +2010-05-23T00:20:49.000000Z +8624a8eda565ebd3ef14269e329ac8c4 +2010-01-06T19:15:24.597719Z +5795 +kris + + + + + + + + + + + + + + + + + + + + + +3573 + +functions-mountdisk.sh +file + + + + +2010-05-23T00:20:49.000000Z +b331e04625ce6372111a19267625f069 +2010-05-16T18:52:47.285311Z +6724 +kris + + + + + + + + + + + + + + + + + + + + + +4757 + +functions-extractimage.sh +file + + + + +2010-05-23T00:20:49.000000Z +64de3ea9deb361c817267bcadabdadcf +2010-05-09T01:44:47.258849Z +6682 +johnh + + + + + + + + + + + + + + + + + + + + + +7362 + +functions-mountoptical.sh +file + + + + +2010-05-23T00:20:49.000000Z +fac8df44ce04d39c0ec3c494cccc5578 +2009-12-29T19:30:31.237756Z +5711 +kris + + + + + + + + + + + + + + + + + + + + + +2882 + +functions-newfs.sh +file + + + + +2010-05-23T00:20:49.000000Z +204d8c20ba158460418ea91a0b521e79 +2010-05-16T18:52:47.285311Z +6724 +kris + + + + + + + + + + + + + + + + + + + + + +4592 + +functions-runcommands.sh +file + + + + +2010-05-23T00:20:49.000000Z +0da82dc876435b06828c90afdfb8deec +2009-10-29T14:29:55.972326Z +4809 +kris + + + + + + + + + + + + + + + + + + + + + +1535 + +functions-networking.sh +file + + + + +2010-05-23T00:20:49.000000Z +0bc6f149d9fbb76d7d0ef3882b8401b5 +2010-05-11T17:59:10.123893Z +6693 +kris + + + + + + + + + + + + + + + + + + + + + +7717 + +functions-cleanup.sh +file + + + + +2010-05-23T00:20:49.000000Z +744bae2df1b9be9134c261b6ca59d862 +2010-05-16T18:52:47.285311Z +6724 +kris + + + + + + + + + + + + + + + + + + + + + +10169 + +functions-upgrade.sh +file + + + + +2010-05-23T00:20:49.000000Z +c3e6b574af945d598161d638f980194c +2010-04-07T16:05:18.981194Z +6521 +kris + + + + + + + + + + + + + + + + + + + + + +7629 + +functions-disk.sh +file + + + + +2010-05-23T00:20:49.000000Z +3db491d9ddbdbbe16c81003a1fe1dfd7 +2010-05-20T12:37:14.779822Z +6746 +kris + + + + + + + + + + + + + + + + + + + + + +16748 + +parseconfig.sh +file + + + + +2010-05-23T00:20:49.000000Z +a72e0c373850c6798eae69a79aa970d2 +2010-05-09T01:44:47.258849Z +6682 +johnh +has-props + + + + + + + + + + + + + + + + + + + + +3508 + diff --git a/PCBSD/pc-sysinstall/backend/.svn/lock b/PCBSD/pc-sysinstall/backend/.svn/lock new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/.svn/lock diff --git a/PCBSD/pc-sysinstall/backend/.svn/prop-base/parseconfig.sh.svn-base b/PCBSD/pc-sysinstall/backend/.svn/prop-base/parseconfig.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/.svn/prop-base/parseconfig.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/backend/.svn/prop-base/startautoinstall.sh.svn-base b/PCBSD/pc-sysinstall/backend/.svn/prop-base/startautoinstall.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/.svn/prop-base/startautoinstall.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-bsdlabel.sh.svn-base b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-bsdlabel.sh.svn-base new file mode 100644 index 0000000..af7813e --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-bsdlabel.sh.svn-base @@ -0,0 +1,592 @@ +#!/bin/sh +# Functions related to disk operations using bsdlabel + +# Check if we are are provided a geli password on the nextline of the config +check_for_enc_pass() +{ + CURLINE="${1}" + + get_next_cfg_line "${CFGF}" "${CURLINE}" + echo ${VAL} | grep "^encpass=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + # Found a password, return it + get_value_from_string "${VAL}" + return + fi + + VAL="" ; export VAL + return -1 +}; + +# On check on the disk-label line if we have any extra vars for this device +# Only enabled for ZFS devices now, may add other xtra options in future for other FS's +get_fs_line_xvars() +{ + ACTIVEDEV="${1}" + LINE="${2}" + + echo $LINE | grep ' (' >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + + # See if we are looking for ZFS specific options + echo $LINE | grep '^ZFS' >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + ZTYPE="NONE" + ZFSVARS="`echo $LINE | cut -d '(' -f 2- | cut -d ')' -f 1`" + + # Check if we are doing raidz setup + echo $ZFSVARS | grep "^raidz:" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + ZTYPE="raidz" + ZFSVARS="`echo $ZFSVARS | sed 's|raidz: ||g' | sed 's|raidz:||g'`" + fi + + echo $ZFSVARS | grep "^mirror:" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + ZTYPE="mirror" + ZFSVARS="`echo $ZFSVARS | sed 's|mirror: ||g' | sed 's|mirror:||g'`" + _nZFS="" + + # Using mirroring, setup boot partitions on each disk + for i in $ZFSVARS + do + is_disk "$i" + if [ "$?" = "0" ] ; then + init_gpt_full_disk "$i" + rc_halt "gpart add -t freebsd-zfs ${i}" + rc_halt "gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ${i}" + _nZFS="$_nZFS ${i}p2" + else + _nZFS="$_nZFS ${i}" + fi + done + ZFSVARS=`echo "$_nZFS" | tr -s ' '` + fi + + # Return the ZFS options + if [ "${ZTYPE}" = "NONE" ] ; then + VAR="${ACTIVEDEV} ${ZFSVARS}" + else + VAR="${ZTYPE} ${ACTIVEDEV} ${ZFSVARS}" + fi + export VAR + return + fi # End of ZFS block + + + fi # End of xtra-options block + + # If we got here, set VAR to empty and export + VAR="" + export VAR + return +}; + +# Function which creates a unique label name for the specified mount +gen_glabel_name() +{ + MOUNT="$1" + TYPE="$2" + NUM="0" + MAXNUM="20" + + # Check if we are doing /, and rename it + if [ "$MOUNT" = "/" ] + then + NAME="rootfs" + else + # If doing a swap partition, also rename it + if [ "${TYPE}" = "SWAP" ] + then + NAME="swap" + else + NAME="`echo $MOUNT | sed 's|/||g' | sed 's| ||g'`" + fi + fi + + # Loop through and break when we find our first available label + while + Z=1 + do + glabel status | grep "${NAME}${NUM}" >/dev/null 2>/dev/null + if [ "$?" != "0" ] + then + break + else + NUM="`expr ${NUM} + 1`" + fi + + if [ $NUM -gt $MAXNUM ] + then + exit_err "Cannot allocate additional glabel name for $NAME" + break + fi + done + + + VAL="${NAME}${NUM}" + export VAL +}; + +# Function to setup / stamp a legacy MBR bsdlabel +setup_mbr_partitions() +{ + + DISKTAG="$1" + WRKSLICE="$2" + FOUNDPARTS="1" + + + # Lets setup the BSDLABEL + BSDLABEL="${TMPDIR}/bsdLabel-${WRKSLICE}" + export BSDLABEL + rm $BSDLABEL >/dev/null 2>/dev/null + echo "# /dev/${WRKSLICE}" >>$BSDLABEL + echo "8 partitions:" >>$BSDLABEL + echo "# size offset fstype bsize bps/cpg" >>$BSDLABEL + + PARTLETTER="a" + + # Lets read in the config file now and populate this + while read line + do + # Check for data on this slice + echo $line | grep "^${DISKTAG}-part=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + # Found a slice- entry, lets get the slice info + get_value_from_string "${line}" + STRING="$VAL" + FOUNDPARTS="0" + + # We need to split up the string now, and pick out the variables + FS=`echo $STRING | tr -s '\t' ' ' | cut -d ' ' -f 1` + SIZE=`echo $STRING | tr -s '\t' ' ' | cut -d ' ' -f 2` + MNT=`echo $STRING | tr -s '\t' ' ' | cut -d ' ' -f 3` + + # Check if we have a .eli extension on this FS + echo ${FS} | grep ".eli" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + FS="`echo ${FS} | cut -d '.' -f 1`" + ENC="ON" + check_for_enc_pass "${line}" + if [ "${VAL}" != "" ] ; then + # We have a user supplied password, save it for later + ENCPASS="${VAL}" + fi + else + ENC="OFF" + fi + + # Check if the user tried to setup / as an encrypted partition + check_for_mount "${MNT}" "/" + if [ "${?}" = "0" -a "${ENC}" = "ON" ] + then + USINGENCROOT="0" ; export USINGENCROOT + fi + + # Now check that these values are sane + case $FS in + UFS|UFS+S|UFS+J|ZFS|SWAP) ;; + *) exit_err "ERROR: Invalid file system specified on $line" ;; + esac + + # Check that we have a valid size number + expr $SIZE + 1 >/dev/null 2>/dev/null + if [ "$?" != "0" ]; then + exit_err "ERROR: The size specified on $line is invalid" + fi + + # Check that the mount-point starts with / + echo "$MNT" | grep -e "^/" -e "^none" >/dev/null 2>/dev/null + if [ "$?" != "0" ]; then + exit_err "ERROR: The mount-point specified on $line is invalid" + fi + + if [ "$SIZE" = "0" ] + then + SOUT="*" + else + SOUT="${SIZE}M" + fi + + # OK, we passed all tests, now lets put these values into a config + # If the part + if [ "${PARTLETTER}" = "a" ] + then + if [ "$FS" = "SWAP" ] + then + echo "a: ${SOUT} * swap 0 0" >>${BSDLABEL} + else + echo "a: ${SOUT} 0 4.2BSD 0 0" >>${BSDLABEL} + fi + + # Check if we found a valid root partition + check_for_mount "${MNT}" "/" + if [ "$?" = "0" ] ; then + FOUNDROOT="0" ; export FOUNDROOT + fi + + # Check if we have a "/boot" instead + check_for_mount "${MNT}" "/boot" + if [ "${?}" = "0" ] ; then + USINGBOOTPART="0" ; export USINGBOOTPART + if [ "${FS}" != "UFS" -a "${FS}" != "UFS+S" -a "${FS}" != "UFS+J" ] + then + exit_err "/boot partition must be formatted with UFS" + fi + fi + + else + # Done with the a: partitions + + # Check if we found a valid root partition not on a: + check_for_mount "${MNT}" "/" + if [ "${?}" = "0" ] ; then + FOUNDROOT="1" ; export FOUNDROOT + fi + + # Check if we have a /boot partition, and fail since its not first + check_for_mount "${MNT}" "/boot" + if [ "${?}" = "0" ] ; then + exit_err "/boot partition must be first partition" + fi + + + if [ "$FS" = "SWAP" ] + then + echo "${PARTLETTER}: ${SOUT} * swap" >>${BSDLABEL} + else + echo "${PARTLETTER}: ${SOUT} * 4.2BSD" >>${BSDLABEL} + fi + fi + + # Generate a unique label name for this mount + gen_glabel_name "${MNT}" "${FS}" + PLABEL="${VAL}" + + # Get any extra options for this fs / line + get_fs_line_xvars "${WRKSLICE}${PARTLETTER}" "${STRING}" + XTRAOPTS="${VAR}" + + # Save this data to our partition config dir + echo "${FS}:${MNT}:${ENC}:${PLABEL}:MBR:${XTRAOPTS}" >${PARTDIR}/${WRKSLICE}${PARTLETTER} + + # If we have a enc password, save it as well + if [ ! -z "${ENCPASS}" ] ; then + echo "${ENCPASS}" >${PARTDIR}-enc/${WRKSLICE}${PARTLETTER}-encpass + fi + + # This partition letter is used, get the next one + case ${PARTLETTER} in + a) PARTLETTER="b" ;; + b) # When we hit b, add the special c: setup for bsdlabel + echo "c: * * unused" >>${BSDLABEL} + PARTLETTER="d" ;; + d) PARTLETTER="e" ;; + e) PARTLETTER="f" ;; + f) PARTLETTER="g" ;; + g) PARTLETTER="h" ;; + h) PARTLETTER="ERR" ;; + *) exit_err "ERROR: bsdlabel only supports up to letter h for partitions." ;; + esac + + fi # End of subsection locating a slice in config + + echo $line | grep "^commitDiskLabel" >/dev/null 2>/dev/null + if [ "$?" = "0" -a "${FOUNDPARTS}" = "0" ] + then + # Found our flag to commit this label setup, check that we found at least 1 partition and do it + if [ "${PARTLETTER}" != "a" ] + then + # Check if we only had 1 partition, and make sure we add "c:" section to label + if [ "${PARTLETTER}" = "b" ] + then + echo "c: * * unused" >>${BSDLABEL} + fi + + echo "bsdlabel -R -B /dev/${WRKSLICE} ${BSDLABEL}" + bsdlabel -R -B ${WRKSLICE} ${BSDLABEL} + + break + else + exit_err "ERROR: commitDiskLabel was called without any partition entries for it!" + fi + fi + done <${CFGF} +}; + +# Function to setup partitions using gpt +setup_gpt_partitions() +{ + DISKTAG="$1" + DISK="$2" + FOUNDPARTS="1" + + # Lets read in the config file now and setup our GPT partitions + CURPART="2" + while read line + do + # Check for data on this slice + echo $line | grep "^${DISKTAG}-part=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + FOUNDPARTS="0" + # Found a slice- entry, lets get the slice info + get_value_from_string "${line}" + STRING="$VAL" + + # We need to split up the string now, and pick out the variables + FS=`echo $STRING | tr -s '\t' ' ' | cut -d ' ' -f 1` + SIZE=`echo $STRING | tr -s '\t' ' ' | cut -d ' ' -f 2` + MNT=`echo $STRING | tr -s '\t' ' ' | cut -d ' ' -f 3` + + # Check if we have a .eli extension on this FS + echo ${FS} | grep ".eli" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + FS="`echo ${FS} | cut -d '.' -f 1`" + ENC="ON" + check_for_enc_pass "${line}" + if [ "${VAL}" != "" ] ; then + # We have a user supplied password, save it for later + ENCPASS="${VAL}" + fi + else + ENC="OFF" + fi + + # Check if the user tried to setup / as an encrypted partition + check_for_mount "${MNT}" "/" + if [ "${?}" = "0" -a "${ENC}" = "ON" ] + then + USINGENCROOT="0" ; export USINGENCROOT + fi + + # Now check that these values are sane + case $FS in + UFS|UFS+S|UFS+J|ZFS|SWAP) ;; + *) exit_err "ERROR: Invalid file system specified on $line" ;; + esac + + # Check that we have a valid size number + expr $SIZE + 1 >/dev/null 2>/dev/null + if [ "$?" != "0" ]; then + exit_err "ERROR: The size specified on $line is invalid" + fi + + # Check that the mount-point starts with / + echo "$MNT" | grep -e "^/" -e "^none" >/dev/null 2>/dev/null + if [ "$?" != "0" ]; then + exit_err "ERROR: The mount-point specified on $line is invalid" + fi + + if [ "$SIZE" = "0" ] + then + SOUT="" + else + SOUT="-s ${SIZE}M" + fi + + # Check if we found a valid root partition + check_for_mount "${MNT}" "/" + if [ "${?}" = "0" ] ; then + if [ "${CURPART}" = "2" ] ; then + FOUNDROOT="0" ; export FOUNDROOT + else + FOUNDROOT="1" ; export FOUNDROOT + fi + fi + + check_for_mount "${MNT}" "/boot" + if [ "${?}" = "0" ] ; then + if [ "${CURPART}" = "2" ] ; then + USINGBOOTPART="0" ; export USINGBOOTPART + if [ "${FS}" != "UFS" -a "${FS}" != "UFS+S" -a "${FS}" != "UFS+J" ] + then + exit_err "/boot partition must be formatted with UFS" + fi + else + exit_err "/boot partition must be first partition" + fi + fi + + # Generate a unique label name for this mount + gen_glabel_name "${MNT}" "${FS}" + PLABEL="${VAL}" + + # Get any extra options for this fs / line + get_fs_line_xvars "${DISK}p${CURPART}" "${STRING}" + XTRAOPTS="${VAR}" + + # Figure out the gpart type to use + case ${FS} in + ZFS) PARTYPE="freebsd-zfs" ;; + SWAP) PARTYPE="freebsd-swap" ;; + *) PARTYPE="freebsd-ufs" ;; + esac + + # Create the partition + rc_halt "gpart add ${SOUT} -t ${PARTYPE} ${DISK}" + + # Check if this is a root / boot partition, and stamp the right loader + for TESTMNT in `echo ${MNT} | sed 's|,| |g'` + do + if [ "${TESTMNT}" = "/" -a -z "${BOOTTYPE}" ] ; then + BOOTTYPE="${PARTYPE}" + fi + if [ "${TESTMNT}" = "/boot" ] ; then + BOOTTYPE="${PARTYPE}" + fi + done + + # Save this data to our partition config dir + echo "${FS}:${MNT}:${ENC}:${PLABEL}:GPT:${XTRAOPTS}" >${PARTDIR}/${DISK}p${CURPART} + + # Clear out any headers + sleep 2 + dd if=/dev/zero of=${DISK}p${CURPART} count=2048 >/dev/null 2>/dev/null + + # If we have a enc password, save it as well + if [ ! -z "${ENCPASS}" ] ; then + echo "${ENCPASS}" >${PARTDIR}-enc/${DISK}p${CURPART}-encpass + fi + + # Increment our parts counter + CURPART="`expr ${CURPART} + 1`" + + fi # End of subsection locating a slice in config + + echo $line | grep "^commitDiskLabel" >/dev/null 2>/dev/null + if [ "$?" = "0" -a "${FOUNDPARTS}" = "0" ] + then + + # If this is the boot disk, stamp the right gptboot + if [ ! -z "${BOOTTYPE}" ] ; then + case ${BOOTTYPE} in + freebsd-ufs) rc_halt "gpart bootcode -p /boot/gptboot -i 1 ${DISK}" ;; + freebsd-zfs) rc_halt "gpart bootcode -p /boot/gptzfsboot -i 1 ${DISK}" ;; + esac + fi + + + # Found our flag to commit this label setup, check that we found at least 1 partition + if [ "${CURPART}" = "2" ] ; then + exit_err "ERROR: commitDiskLabel was called without any partition entries for it!" + fi + + break + fi + done <${CFGF} +}; + +# Reads through the config and sets up a BSDLabel for the given slice +populate_disk_label() +{ + if [ -z "${1}" ] + then + exit_err "ERROR: populate_disk_label() called without argument!" + fi + + # Set some vars from the given working slice + disk="`echo $1 | cut -d '-' -f 1`" + slicenum="`echo $1 | cut -d '-' -f 2`" + type="`echo $1 | cut -d '-' -f 3`" + + # Set WRKSLICE based upon format we are using + if [ "$type" = "mbr" ] ; then + wrkslice="${disk}s${slicenum}" + fi + if [ "$type" = "gpt" ] ; then + wrkslice="${disk}p${slicenum}" + fi + + if [ -e "${SLICECFGDIR}/${wrkslice}" ] + then + disktag="`cat ${SLICECFGDIR}/${wrkslice}`" + else + exit_err "ERROR: Missing SLICETAG data. This shouldn't happen - please let the developers know" + fi + + # Using Traditional MBR for dual-booting + if [ "$type" = "mbr" ] ; then + setup_mbr_partitions "${disktag}" "${wrkslice}" + fi + + # Using entire disk mode, use GPT for this + if [ "$type" = "gpt" ] ; then + setup_gpt_partitions "${disktag}" "${disk}" + fi + +}; + +# Function which reads in the disk slice config, and performs it +setup_disk_label() +{ + # We are ready to start setting up the label, lets read the config and do the actions + + # First confirm that we have a valid WORKINGSLICES + if [ -z "${WORKINGSLICES}" ]; then + exit_err "ERROR: No slices were setup! Please report this to the maintainers" + fi + + # Check that the slices we have did indeed get setup and gpart worked + for i in $WORKINGSLICES + do + disk="`echo $i | cut -d '-' -f 1`" + pnum="`echo $i | cut -d '-' -f 2`" + type="`echo $i | cut -d '-' -f 3`" + if [ "$type" = "mbr" -a ! -e "/dev/${disk}s${pnum}" ] ; then + exit_err "ERROR: The partition ${i} doesn't exist! gpart failure!" + fi + if [ "$type" = "gpt" -a ! -e "/dev/${disk}p${pnum}" ] ; then + exit_err "ERROR: The partition ${i} doesn't exist! gpart failure!" + fi + done + + # Setup some files which we'll be referring to + LABELLIST="${TMPDIR}/workingLabels" + export LABELLIST + rm $LABELLIST >/dev/null 2>/dev/null + + # Set our flag to determine if we've got a valid root partition in this setup + FOUNDROOT="-1" + export FOUNDROOT + + # Check if we are using a /boot partition + USINGBOOTPART="1" + export USINGBOOTPART + + # Set encryption on root check + USINGENCROOT="1" ; export USINGENCROOT + + # Make the tmp directory where we'll store FS info & mount-points + rm -rf ${PARTDIR} >/dev/null 2>/dev/null + mkdir -p ${PARTDIR} >/dev/null 2>/dev/null + rm -rf ${PARTDIR}-enc >/dev/null 2>/dev/null + mkdir -p ${PARTDIR}-enc >/dev/null 2>/dev/null + + for i in $WORKINGSLICES + do + populate_disk_label "${i}" + done + + # Check if we made a root partition + if [ "$FOUNDROOT" = "-1" ] + then + exit_err "ERROR: No root (/) partition specified!!" + fi + + # Check if we made a root partition + if [ "$FOUNDROOT" = "1" -a "${USINGBOOTPART}" != "0" ] + then + exit_err "ERROR: (/) partition isn't first partition on disk!" + fi + + if [ "${USINGENCROOT}" = "0" -a "${USINGBOOTPART}" != "0" ] + then + exit_err "ERROR: Can't encrypt (/) with no (/boot) partition!" + fi +}; + diff --git a/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-cleanup.sh.svn-base b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-cleanup.sh.svn-base new file mode 100644 index 0000000..2c7ffd0 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-cleanup.sh.svn-base @@ -0,0 +1,386 @@ +#!/bin/sh +# Functions which perform the final cleanup after an install + +# Finishes up with ZFS setup before unmounting +zfs_cleanup_unmount() +{ + # Loop through our FS and see if we have any ZFS partitions to cleanup + for PART in `ls ${PARTDIR}` + do + PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`" + PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`" + ZPOOLNAME=$(get_zpool_name "${PART}") + + if [ "$PARTFS" = "ZFS" ] + then + # Check if we have multiple zfs mounts specified + for ZMNT in `echo ${PARTMNT} | sed 's|,| |g'` + do + if [ "${ZMNT}" = "/" ] + then + # Make sure we haven't already added the zfs boot line when + # Creating a dedicated "/boot" partition + cat ${FSMNT}/boot/loader.conf 2>/dev/null | grep "vfs.root.mountfrom=" >/dev/null 2>/dev/null + if [ "$?" != "0" ] ; then + echo "vfs.root.mountfrom=\"zfs:${ZPOOLNAME}\"" >> ${FSMNT}/boot/loader.conf + fi + FOUNDZFSROOT="${ZPOOLNAME}" ; export FOUNDZFSROOT + fi + done + FOUNDZFS="1" + fi + done + + if [ ! -z "${FOUNDZFS}" ] + then + # Check if we need to add our ZFS flags to rc.conf, src.conf and loader.conf + cat ${FSMNT}/boot/loader.conf 2>/dev/null | grep 'zfs_load="YES"' >/dev/null 2>/dev/null + if [ "$?" != "0" ] + then + echo 'zfs_load="YES"' >>${FSMNT}/boot/loader.conf + fi + cat ${FSMNT}/etc/rc.conf 2>/dev/null | grep 'zfs_enable="YES"' >/dev/null 2>/dev/null + if [ "$?" != "0" ] + then + echo 'zfs_enable="YES"' >>${FSMNT}/etc/rc.conf + fi + + sleep 2 + # Copy over any ZFS cache data + cp /boot/zfs/* ${FSMNT}/boot/zfs/ + + # Copy the hostid so that our zfs cache works + cp /etc/hostid ${FSMNT}/etc/hostid + fi + + # Loop through our FS and see if we have any ZFS partitions to cleanup + for PART in `ls ${PARTDIR}` + do + PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`" + PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`" + PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`" + ZPOOLNAME=$(get_zpool_name "${PART}") + + if [ "$PARTFS" = "ZFS" ] + then + # Check if we have multiple zfs mounts specified + for ZMNT in `echo ${PARTMNT} | sed 's|,| |g'` + do + PARTMNTREV="${ZMNT} ${PARTMNTREV}" + done + + for ZMNT in ${PARTMNTREV} + do + if [ "${ZMNT}" != "/" ] + then + rc_halt "zfs set mountpoint=${ZMNT} ${ZPOOLNAME}${ZMNT}" + rc_halt "zfs unmount ${ZPOOLNAME}${ZMNT}" + sleep 2 + fi + done + fi + done + +}; + +# Function which performs the specific setup for using a /boot partition +setup_dedicated_boot_part() +{ + ROOTFS="${1}" + ROOTFSTYPE="${2}" + BOOTFS="${3}" + BOOTMNT="${4}" + + # Set the root mount in loader.conf + echo "vfs.root.mountfrom=\"${ROOTFSTYPE}:${ROOTFS}\"" >> ${FSMNT}/boot/loader.conf + rc_halt "mkdir -p ${FSMNT}/${BOOTMNT}/boot" + rc_halt "mv ${FSMNT}/boot/* ${FSMNT}${BOOTMNT}/boot/" + rc_halt "mv ${FSMNT}${BOOTMNT}/boot ${FSMNT}/boot/" + rc_halt "umount /dev/${BOOTFS}" + rc_halt "mount /dev/${BOOTFS} ${FSMNT}${BOOTMNT}" + rc_halt "rmdir ${FSMNT}/boot" + + # Strip the '/' from BOOTMNT before making symlink + BOOTMNTNS="`echo ${BOOTMNT} | sed 's|/||g'`" + rc_halt "chroot ${FSMNT} ln -s ${BOOTMNTNS}/boot /boot" + +}; + +# Function which creates the /etc/fstab for the installed system +setup_fstab() +{ + FSTAB="${FSMNT}/etc/fstab" + rm ${FSTAB} >/dev/null 2>/dev/null + + # Create the header + echo "# Device Mountpoint FStype Options Dump Pass" >> ${FSTAB} + + # Loop through the partitions, and start creating /etc/fstab + for PART in `ls ${PARTDIR}` + do + PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`" + PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`" + PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`" + PARTLABEL="`cat ${PARTDIR}/${PART} | cut -d ':' -f 4`" + + DRIVE="`echo ${PART} | rev | cut -b 4- | rev`" + # Check if this device is being mirrored + if [ -e "${MIRRORCFGDIR}/${DRIVE}" ] + then + # This device is apart of a gmirror, lets reset PART to correct value + MDRIVE="mirror/`cat ${MIRRORCFGDIR}/${DRIVE} | cut -d ':' -f 3`" + TMP="`echo ${PART} | rev | cut -b -3 | rev`" + PART="${MDRIVE}${TMP}" + PARTLABEL="" + fi + + # Unset EXT + EXT="" + + # Figure out if we are using a glabel, or the raw name for this entry + if [ ! -z "${PARTLABEL}" ] + then + DEVICE="label/${PARTLABEL}" + else + # Check if using encryption + if [ "${PARTENC}" = "ON" ] ; then + EXT=".eli" + fi + + if [ "${PARTFS}" = "UFS+J" ] ; then + EXT="${EXT}.journal" + fi + DEVICE="${PART}${EXT}" + fi + + + # Set our ROOTFSTYPE for loader.conf if necessary + check_for_mount "${PARTMNT}" "/" + if [ "$?" = "0" ] ; then + if [ "${PARTFS}" = "ZFS" ] ; then + ROOTFSTYPE="zfs" + XPOOLNAME=$(get_zpool_name "${PART}") + ROOTFS="${ZPOOLNAME}" + else + ROOTFS="${DEVICE}" + ROOTFSTYPE="ufs" + fi + fi + + # Only create non-zfs partitions + if [ "${PARTFS}" != "ZFS" ] + then + + # Make sure geom_journal is loaded + if [ "${PARTFS}" = "UFS+J" ] ; then + setup_gjournal + fi + + # Save the BOOTFS for call at the end + if [ "${PARTMNT}" = "/boot" ] ; then + BOOTFS="${PART}${EXT}" + BOOTMNT="${BOOT_PART_MOUNT}" + PARTMNT="${BOOTMNT}" + fi + + # Echo out the fstab entry now + if [ "${PARTFS}" = "SWAP" ] + then + echo "/dev/${DEVICE} none swap sw 0 0" >> ${FSTAB} + else + echo "/dev/${DEVICE} ${PARTMNT} ufs rw,noatime 1 1" >> ${FSTAB} + fi + + fi # End of ZFS Check + done + + # Setup some specific PC-BSD fstab options + if [ "$INSTALLTYPE" != "FreeBSD" ] + then + echo "procfs /proc procfs rw 0 0" >> ${FSTAB} + echo "linprocfs /compat/linux/proc linprocfs rw 0 0" >> ${FSTAB} + echo "tmpfs /tmp tmpfs rw,mode=1777 0 0" >> ${FSTAB} + fi + + # If we have a dedicated /boot, run the post-install setup of it now + if [ ! -z "${BOOTMNT}" ] ; then + setup_dedicated_boot_part "${ROOTFS}" "${ROOTFSTYPE}" "${BOOTFS}" "${BOOTMNT}" + fi + +}; + +# Setup our disk mirroring with gmirror +setup_gmirror() +{ + NUM="0" + + cd ${MIRRORCFGDIR} + for DISK in `ls *` + do + MIRRORDISK="`cat ${DISK} | cut -d ':' -f 1`" + MIRRORBAL="`cat ${DISK} | cut -d ':' -f 2`" + + # Create this mirror device + gmirror label -vb $MIRRORBAL gm${NUM} /dev/${DISK} + + sleep 3 + + # Save the gm<num> device in our config + echo "${MIRRORDISK}:${MIRRORBAL}:gm${NUM}" > ${DISK} + + sleep 3 + + NUM="`expr ${NUM} + 1`" + done + + + cat ${FSMNT}/boot/loader.conf 2>/dev/null | grep 'geom_mirror_load="YES"' >/dev/null 2>/dev/null + if [ "$?" != "0" ] + then + echo 'geom_mirror_load="YES"' >>${FSMNT}/boot/loader.conf + fi + +}; + +# Function which saves geli keys and sets up loading of them at boot +setup_geli_loading() +{ + + # Make our keys dir + mkdir -p ${FSMNT}/boot/keys >/dev/null 2>/dev/null + + cd ${GELIKEYDIR} + for KEYFILE in `ls *` + do + # Figure out the partition name based on keyfile name removing .key + PART="`echo ${KEYFILE} | cut -d '.' -f 1`" + + # Add the entries to loader.conf to start this geli provider at boot + echo "geli_${PART}_keyfile0_load=\"YES\"" >> ${FSMNT}/boot/loader.conf + echo "geli_${PART}_keyfile0_type=\"${PART}:geli_keyfile0\"" >> ${FSMNT}/boot/loader.conf + echo "geli_${PART}_keyfile0_name=\"/boot/keys/${KEYFILE}\"" >> ${FSMNT}/boot/loader.conf + + # If we have a passphrase, set it up now + if [ -e "${PARTDIR}-enc/${PART}-encpass" ] ; then + cat ${PARTDIR}-enc/${PART}-encpass | geli setkey -S -n 0 -p -k ${KEYFILE} -K ${KEYFILE} ${PART} + geli configure -b ${PART} + fi + + # Copy the key to the disk + cp ${KEYFILE} ${FSMNT}/boot/keys/${KEYFILE} + done + + # Make sure we have geom_eli set to load at boot + cat ${FSMNT}/boot/loader.conf 2>/dev/null | grep 'geom_eli_load="YES"' >/dev/null 2>/dev/null + if [ "$?" != "0" ] + then + echo 'geom_eli_load="YES"' >>${FSMNT}/boot/loader.conf + fi + +}; + + +# Function to generate a random hostname if none was specified +gen_hostname() +{ + RAND="`jot -r 1 1 9000`" + + if [ "$INSTALLTYPE" = "FreeBSD" ] + then + VAL="freebsd-${RAND}" + else + VAL="pcbsd-${RAND}" + fi + + export VAL + +}; + +# Function which sets up the hostname for the system +setup_hostname() +{ + + get_value_from_cfg hostname + HOSTNAME="${VAL}" + + # If we don't have a hostname, make one up + if [ -z "${HOSTNAME}" ] + then + gen_hostname + HOSTNAME="${VAL}" + fi + + # Clean up any saved hostname + cat ${FSMNT}/etc/rc.conf | grep -v "hostname=" >${FSMNT}/etc/rc.conf.new + mv ${FSMNT}/etc/rc.conf.new ${FSMNT}/etc/rc.conf + + # Set the hostname now + echo_log "Setting hostname: ${HOSTNAME}" + echo "hostname=\"${HOSTNAME}\"" >> ${FSMNT}/etc/rc.conf + sed -i -e "s|my.domain|${HOSTNAME} ${HOSTNAME}|g" ${FSMNT}/etc/hosts + +}; + + +# Check and make sure geom_journal is enabled on the system +setup_gjournal() +{ + + # Make sure we have geom_journal set to load at boot + cat ${FSMNT}/boot/loader.conf 2>/dev/null | grep 'geom_journal_load="YES"' >/dev/null 2>/dev/null + if [ "$?" != "0" ] + then + echo 'geom_journal_load="YES"' >>${FSMNT}/boot/loader.conf + fi + +}; + +# Function which sets the root password from the install config +set_root_pw() +{ + get_value_from_cfg_with_spaces rootPass + PW="${VAL}" + + # If we don't have a root pass, return + if [ -z "${PW}" ] + then + return 0 + fi + + echo_log "Setting root password" + echo "${PW}" > ${FSMNT}/.rootpw + run_chroot_cmd "cat /.rootpw | pw usermod root -h 0" + rc_halt "rm ${FSMNT}/.rootpw" + +}; + + +run_final_cleanup() +{ + + # Check if we need to run any gmirror setup + ls ${MIRRORCFGDIR}/* >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + # Lets setup gmirror now + setup_gmirror + fi + + # Check if we need to save any geli keys + ls ${GELIKEYDIR}/* >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + # Lets setup geli loading + setup_geli_loading + fi + + # Set a hostname on the install system + setup_hostname + + # Set the root_pw if it is specified + set_root_pw + + # Generate the fstab for the installed system + setup_fstab + +}; diff --git a/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-disk.sh.svn-base b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-disk.sh.svn-base new file mode 100644 index 0000000..17cfb63 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-disk.sh.svn-base @@ -0,0 +1,646 @@ +#!/bin/sh +# Functions related to disk operations using gpart + +# See if device is a full disk or partition/slice +is_disk() { + for dsk in `sysctl -n kern.disks` + do + if [ "$dsk" = "${1}" ] ; then return 0 ; fi + done + + return 1 +} + +# Get a MBR partitions sysid +get_partition_sysid_mbr() +{ + INPART="0" + DISK="$1" + PARTNUM=`echo ${2} | sed "s|${DISK}s||g"` + fdisk ${DISK} >${TMPDIR}/disk-${DISK} 2>/dev/null + while read i + do + echo "$i" | grep "The data for partition" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + INPART="0" + PART="`echo ${i} | cut -d ' ' -f 5`" + if [ "$PART" = "$PARTNUM" ] ; then + INPART="1" + fi + fi + + # In the partition section + if [ "$INPART" = "1" ] ; then + echo "$i" | grep "^sysid" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + SYSID="`echo ${i} | tr -s '\t' ' ' | cut -d ' ' -f 2`" + break + fi + + fi + + done < ${TMPDIR}/disk-${DISK} + rm ${TMPDIR}/disk-${DISK} + + VAL="${SYSID}" + export VAL +}; + +# Get the partitions MBR label +get_partition_label_mbr() +{ + INPART="0" + DISK="$1" + PARTNUM=`echo ${2} | sed "s|${DISK}s||g"` + fdisk ${DISK} >${TMPDIR}/disk-${DISK} 2>/dev/null + while read i + do + echo "$i" | grep "The data for partition" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + INPART="0" + PART="`echo ${i} | cut -d ' ' -f 5`" + if [ "$PART" = "$PARTNUM" ] ; then + INPART="1" + fi + fi + + # In the partition section + if [ "$INPART" = "1" ] ; then + echo "$i" | grep "^sysid" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + LABEL="`echo ${i} | tr -s '\t' ' ' | cut -d ',' -f 2-10`" + break + fi + + fi + + done < ${TMPDIR}/disk-${DISK} + rm ${TMPDIR}/disk-${DISK} + + VAL="${LABEL}" + export VAL +}; + +# Get a GPT partitions label +get_partition_label_gpt() +{ + DISK="${1}" + PARTNUM=`echo ${2} | sed "s|${DISK}p||g"` + + gpart show ${DISK} >${TMPDIR}/disk-${DISK} + while read i + do + SLICE="`echo ${i} | grep -v ${DISK} | grep -v ' free ' |tr -s '\t' ' ' | cut -d ' ' -f 3`" + if [ "${SLICE}" = "${PARTNUM}" ] ; then + LABEL="`echo ${i} | grep -v ${DISK} | grep -v ' free ' |tr -s '\t' ' ' | cut -d ' ' -f 4`" + break + fi + done <${TMPDIR}/disk-${DISK} + rm ${TMPDIR}/disk-${DISK} + + VAL="${LABEL}" + export VAL +}; + +# Get a partitions startblock +get_partition_startblock() +{ + DISK="${1}" + PARTNUM=`echo ${2} | sed "s|${DISK}p||g" | sed "s|${DISK}s||g"` + + gpart show ${DISK} >${TMPDIR}/disk-${DISK} + while read i + do + SLICE="`echo ${i} | grep -v ${DISK} | grep -v ' free ' |tr -s '\t' ' ' | cut -d ' ' -f 3`" + if [ "$SLICE" = "${PARTNUM}" ] ; then + SB="`echo ${i} | grep -v ${DISK} | grep -v ' free ' |tr -s '\t' ' ' | cut -d ' ' -f 1`" + break + fi + done <${TMPDIR}/disk-${DISK} + rm ${TMPDIR}/disk-${DISK} + + VAL="${SB}" + export VAL +}; + +# Get a partitions blocksize +get_partition_blocksize() +{ + DISK="${1}" + PARTNUM=`echo ${2} | sed "s|${DISK}p||g" | sed "s|${DISK}s||g"` + + gpart show ${DISK} >${TMPDIR}/disk-${DISK} + while read i + do + SLICE="`echo ${i} | grep -v ${DISK} | grep -v ' free ' |tr -s '\t' ' ' | cut -d ' ' -f 3`" + if [ "$SLICE" = "${PARTNUM}" ] ; then + BS="`echo ${i} | grep -v ${DISK} | grep -v ' free ' |tr -s '\t' ' ' | cut -d ' ' -f 2`" + break + fi + done <${TMPDIR}/disk-${DISK} + rm ${TMPDIR}/disk-${DISK} + + VAL="${BS}" + export VAL +}; + +# Function which returns the partitions on a target disk +get_disk_partitions() +{ + gpart show ${1} >/dev/null 2>/dev/null + if [ "$?" != "0" ] ; then + VAL="" ; export VAL + return + fi + + gpart show ${1} | grep "MBR" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + type="MBR" + else + type="GPT" + fi + + SLICES="`gpart show ${1} | grep -v ${1} | grep -v ' free ' |tr -s '\t' ' ' | cut -d ' ' -f 4 | sed '/^$/d'`" + for i in ${SLICES} + do + case $type in + MBR) name="${1}s${i}" ;; + GPT) name="${1}p${i}";; + *) name="${1}s${i}";; + esac + if [ -z "${RSLICES}" ] + then + RSLICES="${name}" + else + RSLICES="${RSLICES} ${name}" + fi + done + + VAL="${RSLICES}" ; export VAL +}; + +# Function which returns a target disks cylinders +get_disk_cyl() +{ + cyl=`diskinfo -v ${1} | grep "# Cylinders" | tr -s ' ' | cut -f 2` + VAL="${cyl}" ; export VAL +}; + +# Function which returns a target disks sectors +get_disk_sectors() +{ + sec=`diskinfo -v ${1} | grep "# Sectors" | tr -s ' ' | cut -f 2` + VAL="${sec}" ; export VAL +}; + +# Function which returns a target disks heads +get_disk_heads() +{ + head=`diskinfo -v ${1} | grep "# Heads" | tr -s ' ' | cut -f 2` + VAL="${head}" ; export VAL +}; + +# Function which exports all zpools, making them safe to overwrite potentially +export_all_zpools() { + # Export any zpools + for i in `zpool list -H -o name` + do + zpool export -f ${i} + done +}; + +# Function to delete all gparts before starting an install +delete_all_gpart() +{ + echo_log "Deleting all gparts" + DISK="$1" + + # Check for any swaps to stop + for i in `gpart show ${DISK} 2>/dev/null | grep 'freebsd-swap' | tr -s ' ' | cut -d ' ' -f 4` + do + swapoff /dev/${DISK}s${i}b >/dev/null 2>/dev/null + swapoff /dev/${DISK}p${i} >/dev/null 2>/dev/null + done + + # Delete the gparts now + for i in `gpart show ${DISK} 2>/dev/null | tr -s ' ' | cut -d ' ' -f 4` + do + if [ "${i}" != "${DISK}" -a "${i}" != "-" ] ; then + rc_nohalt "gpart delete -i ${i} ${DISK}" + fi + done + + rc_nohalt "dd if=/dev/zero of=/dev/${DISK} count=3000" + +}; + +# Function to export all zpools before starting an install +stop_all_zfs() +{ + # Export all zpools again, so that we can overwrite these partitions potentially + for i in `zpool list -H -o name` + do + zpool export -f ${i} + done +}; + +# Function which stops all gmirrors before doing any disk manipulation +stop_all_gmirror() +{ + DISK="${1}" + GPROV="`gmirror list | grep ". Name: mirror/" | cut -d '/' -f 2`" + for gprov in $GPROV + do + gmirror list | grep "Name: ${DISK}" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + echo_log "Stopping mirror $gprov $DISK" + rc_nohalt "gmirror remove $gprov $DISK" + rc_nohalt "dd if=/dev/zero of=/dev/${DISK} count=4096" + fi + done +}; + +# Make sure we don't have any geli providers active on this disk +stop_all_geli() +{ + DISK="${1}" + cd /dev + + for i in `ls ${DISK}*` + do + echo $i | grep '.eli' >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + echo_log "Detaching GELI on ${i}" + rc_halt "geli detach ${i}" + fi + done + +}; + +# Function which reads in the disk slice config, and performs it +setup_disk_slice() +{ + + # Cleanup any slice / mirror dirs + rm -rf ${SLICECFGDIR} >/dev/null 2>/dev/null + mkdir ${SLICECFGDIR} + rm -rf ${MIRRORCFGDIR} >/dev/null 2>/dev/null + mkdir ${MIRRORCFGDIR} + + # Start with disk0 + disknum="0" + + # Make sure all zpools are exported + export_all_zpools + + # We are ready to start setting up the disks, lets read the config and do the actions + while read line + do + echo $line | grep "^disk${disknum}=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + + # Found a disk= entry, lets get the disk we are working on + get_value_from_string "${line}" + strip_white_space "$VAL" + DISK="$VAL" + + # Before we go further, lets confirm this disk really exists + if [ ! -e "/dev/${DISK}" ] + then + exit_err "ERROR: The disk ${DISK} does not exist!" + fi + + # Make sure we stop any gmirrors on this disk + stop_all_gmirror ${DISK} + + # Make sure we stop any geli stuff on this disk + stop_all_geli ${DISK} + + # Make sure we don't have any zpools loaded + stop_all_zfs + + fi + + # Lets look if this device will be mirrored on another disk + echo $line | grep "^mirror=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + + # Found a disk= entry, lets get the disk we are working on + get_value_from_string "${line}" + strip_white_space "$VAL" + MIRRORDISK="$VAL" + + # Before we go further, lets confirm this disk really exists + if [ ! -e "/dev/${MIRRORDISK}" ] + then + exit_err "ERROR: The mirror disk ${MIRRORDISK} does not exist!" + fi + fi + + # Lets see if we have been given a mirror balance choice + echo $line | grep "^mirrorbal=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + + # Found a disk= entry, lets get the disk we are working on + get_value_from_string "${line}" + strip_white_space "$VAL" + MIRRORBAL="$VAL" + fi + + echo $line | grep "^partition=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + # Found a partition= entry, lets read / set it + get_value_from_string "${line}" + strip_white_space "$VAL" + PTYPE="$VAL" + + # We are using free space, figure out the slice number + if [ "${PTYPE}" = "free" -o "${PTYPE}" = "FREE" ] + then + # Lets figure out what number this slice will be + LASTSLICE="`gpart show ${DISK} | grep -v ${DISK} | grep -v ' free' |tr -s '\t' ' ' | cut -d ' ' -f 4 | sed '/^$/d' | tail -n 1`" + if [ -z "${LASTSLICE}" ] + then + LASTSLICE="1" + else + LASTSLICE="`expr $LASTSLICE + 1`" + fi + + if [ $LASTSLICE -gt 4 ] + then + exit_err "ERROR: BSD only supports primary partitions, and there are none availble on $DISK" + fi + + fi + fi + + echo $line | grep "^bootManager=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + # Found a bootManager= entry, lets read /set it + get_value_from_string "${line}" + strip_white_space "$VAL" + BMANAGER="$VAL" + fi + + echo $line | grep "^commitDiskPart" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + # Found our flag to commit this disk setup / lets do sanity check and do it + if [ ! -z "${DISK}" -a ! -z "${PTYPE}" ] + then + case ${PTYPE} in + all|ALL) tmpSLICE="${DISK}p1" + run_gpart_full "${DISK}" "${BMANAGER}" ;; + s1|s2|s3|s4) tmpSLICE="${DISK}${PTYPE}" + # Get the number of the slice we are working on + s="`echo ${PTYPE} | awk '{print substr($0,length,1)}'`" + run_gpart_slice "${DISK}" "${BMANAGER}" "${s}" ;; + free|FREE) tmpSLICE="${DISK}s${LASTSLICE}" + run_gpart_free "${DISK}" "${LASTSLICE}" "${BMANAGER}" ;; + *) exit_err "ERROR: Unknown PTYPE: $PTYPE" ;; + esac + + # Now save which disk<num> this is, so we can parse it later during slice partition setup + echo "disk${disknum}" >${SLICECFGDIR}/$tmpSLICE + + # Save any mirror config + if [ ! -z "$MIRRORDISK" ] + then + # Default to round-robin if the user didn't specify + if [ -z "$MIRRORBAL" ] + then + MIRRORBAL="round-robin" + fi + echo "$MIRRORDISK:$MIRRORBAL" >${MIRRORCFGDIR}/$DISK + fi + + + # Increment our disk counter to look for next disk and unset + unset BMANAGER PTYPE DISK MIRRORDISK MIRRORBAL + disknum="`expr $disknum + 1`" + else + exit_err "ERROR: commitDiskPart was called without procceding disk<num>= and partition= entries!!!" + fi + fi + + done <${CFGF} + +}; + +# Stop all gjournals on disk / slice +stop_gjournal() { + DISK="$1" + # Check if we need to shutdown any journals on this drive + ls /dev/${DISK}*.journal >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + cd /dev + for i in `ls ${DISK}*.journal` + do + rawjournal="`echo ${i} | cut -d '.' -f 1`" + gjournal stop -f ${rawjournal} >>${LOGOUT} 2>>${LOGOUT} + gjournal clear ${rawjournal} >>${LOGOUT} 2>>${LOGOUT} + done + fi +} ; + +# Function which runs gpart and creates a single large slice +init_gpt_full_disk() +{ + DISK=$1 + + # Set our sysctl so we can overwrite any geom using drives + sysctl kern.geom.debugflags=16 >>${LOGOUT} 2>>${LOGOUT} + + # Stop any journaling + stop_gjournal "${DISK}" + + # Remove any existing partitions + delete_all_gpart "${DISK}" + + #Erase any existing bootloader + echo_log "Cleaning up ${DISK}" + rc_halt "dd if=/dev/zero of=/dev/${DISK} count=2048" + + sleep 2 + + echo_log "Running gpart on ${DISK}" + rc_halt "gpart create -s GPT ${DISK}" + rc_halt "gpart add -s 128 -t freebsd-boot ${DISK}" + + echo_log "Stamping boot sector on ${DISK}" + rc_halt "gpart bootcode -b /boot/pmbr ${DISK}" + +} + +# Function which runs gpart and creates a single large slice +run_gpart_full() +{ + DISK=$1 + + init_gpt_full_disk "$DISK" + + slice="${DISK}-1-gpt" + + # Lets save our slice, so we know what to look for in the config file later on + if [ -z "$WORKINGSLICES" ] + then + WORKINGSLICES="${slice}" + export WORKINGSLICES + else + WORKINGSLICES="${WORKINGSLICES} ${slice}" + export WORKINGSLICES + fi +}; + +# Function which runs gpart on a specified s1-4 slice +run_gpart_slice() +{ + DISK=$1 + if [ ! -z "$2" ] + then + BMANAGER="$2" + fi + + # Set the slice we will use later + slice="${1}s${3}" + + # Set our sysctl so we can overwrite any geom using drives + sysctl kern.geom.debugflags=16 >>${LOGOUT} 2>>${LOGOUT} + + # Get the number of the slice we are working on + slicenum="$3" + + # Stop any journaling + stop_gjournal "${slice}" + + # Make sure we have disabled swap on this drive + if [ -e "${slice}b" ] + then + swapoff ${slice}b >/dev/null 2>/dev/null + swapoff ${slice}b.eli >/dev/null 2>/dev/null + fi + + # Modify partition type + echo_log "Running gpart modify on ${DISK}" + rc_halt "gpart modify -t freebsd -i ${slicenum} ${DISK}" + sleep 2 + + # Clean up old partition + echo_log "Cleaning up $slice" + rc_halt "dd if=/dev/zero of=/dev/${DISK}s${slicenum} count=1024" + + sleep 1 + + if [ "${BMANAGER}" = "bsd" ] + then + echo_log "Stamping boot sector on ${DISK}" + rc_halt "gpart bootcode -b /boot/boot0 ${DISK}" + fi + + # Set the slice to the format we'll be using for gpart later + slice="${1}-${3}-mbr" + + # Lets save our slice, so we know what to look for in the config file later on + if [ -z "$WORKINGSLICES" ] + then + WORKINGSLICES="${slice}" + export WORKINGSLICES + else + WORKINGSLICES="${WORKINGSLICES} ${slice}" + export WORKINGSLICES + fi +}; + +# Function which runs gpart and creates a new slice from free disk space +run_gpart_free() +{ + DISK=$1 + SLICENUM=$2 + if [ ! -z "$3" ] + then + BMANAGER="$3" + fi + + # Set our sysctl so we can overwrite any geom using drives + sysctl kern.geom.debugflags=16 >>${LOGOUT} 2>>${LOGOUT} + + slice="${DISK}s${SLICENUM}" + slicenum="${SLICENUM}" + + # Working on the first slice, make sure we have MBR setup + gpart show ${DISK} >/dev/null 2>/dev/null + if [ "$?" != "0" -a "$SLICENUM" = "1" ] ; then + echo_log "Initializing disk, no existing MBR setup" + rc_halt "gpart create -s mbr ${DISK}" + fi + + # Lets get the starting block first + if [ "${slicenum}" = "1" ] + then + startblock="63" + else + # Lets figure out where the prior slice ends + checkslice="`expr ${slicenum} - 1`" + + # Get starting block of this slice + sblk=`gpart show ${DISK} | grep -v ${DISK} | tr -s '\t' ' ' | sed '/^$/d' | grep " ${checkslice} " | cut -d ' ' -f 2` + blksize=`gpart show ${DISK} | grep -v ${DISK} | tr -s '\t' ' ' | sed '/^$/d' | grep " ${checkslice} " | cut -d ' ' -f 3` + startblock="`expr ${sblk} + ${blksize}`" + fi + + # No slice after the new slice, lets figure out the free space remaining and use it + # Get the cyl of this disk + get_disk_cyl "${DISK}" + cyl="${VAL}" + + # Get the heads of this disk + get_disk_heads "${DISK}" + head="${VAL}" + + # Get the tracks/sectors of this disk + get_disk_sectors "${DISK}" + sec="${VAL}" + + # Multiply them all together to get our total blocks + totalblocks="`expr ${cyl} \* ${head}`" + totalblocks="`expr ${totalblocks} \* ${sec}`" + + + # Now set the ending block to the total disk block size + sizeblock="`expr ${totalblocks} - ${startblock}`" + + # Install new partition setup + echo_log "Running gpart on ${DISK}" + rc_halt "gpart add -b ${startblock} -s ${sizeblock} -t freebsd -i ${slicenum} ${DISK}" + sleep 2 + + echo_log "Cleaning up $slice" + rc_halt "dd if=/dev/zero of=/dev/${slice} count=1024" + + sleep 1 + + if [ "${BMANAGER}" = "bsd" ] + then + echo_log "Stamping boot sector on ${DISK}" + rc_halt "gpart bootcode -b /boot/boot0 ${DISK}" + fi + + slice="${DISK}-${SLICENUM}-mbr" + # Lets save our slice, so we know what to look for in the config file later on + if [ -z "$WORKINGSLICES" ] + then + WORKINGSLICES="${slice}" + export WORKINGSLICES + else + WORKINGSLICES="${WORKINGSLICES} ${slice}" + export WORKINGSLICES + fi +}; diff --git a/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-extractimage.sh.svn-base b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-extractimage.sh.svn-base new file mode 100644 index 0000000..394cfad --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-extractimage.sh.svn-base @@ -0,0 +1,289 @@ +#!/bin/sh +# Functions which perform the extraction / installation of system to disk + +. ${BACKEND}/functions-mountoptical.sh + +# Performs the extraction of data to disk from a uzip or tar archive +start_extract_uzip_tar() +{ + if [ -z "$INSFILE" ] + then + exit_err "ERROR: Called extraction with no install file set!" + fi + + # Check if we have a .count file, and echo it out for a front-end to use in progress bars + if [ -e "${INSFILE}.count" ] + then + echo "INSTALLCOUNT: `cat ${INSFILE}.count`" + fi + + # Check if we are doing an upgrade, and if so use our exclude list + if [ "${INSTALLMODE}" = "upgrade" ] + then + TAROPTS="-X ${PROGDIR}/conf/exclude-from-upgrade" + else + TAROPTS="" + fi + + echo_log "pc-sysinstall: Starting Extraction" + + case ${PACKAGETYPE} in + uzip) # Start by mounting the uzip image + MDDEVICE=`mdconfig -a -t vnode -o readonly -f ${INSFILE}` + mkdir -p ${FSMNT}.uzip + mount -r /dev/${MDDEVICE}.uzip ${FSMNT}.uzip + if [ "$?" != "0" ] + then + exit_err "ERROR: Failed mounting the ${INSFILE}" + fi + cd ${FSMNT}.uzip + + # Copy over all the files now! + tar cvf - . 2>/dev/null | tar -xpv -C ${FSMNT} ${TAROPTS} -f - 2>&1 | tee -a ${FSMNT}/.tar-extract.log + if [ "$?" != "0" ] + then + cd / + echo "TAR failure occured:" >>${LOGOUT} + cat ${FSMNT}/.tar-extract.log | grep "tar:" >>${LOGOUT} + umount ${FSMNT}.uzip + mdconfig -d -u ${MDDEVICE} + exit_err "ERROR: Failed extracting the tar image" + fi + + # All finished, now lets umount and cleanup + cd / + umount ${FSMNT}.uzip + mdconfig -d -u ${MDDEVICE} + ;; + tar) tar -xpv -C ${FSMNT} -f ${INSFILE} ${TAROPTS} >&1 2>&1 + if [ "$?" != "0" ] + then + exit_err "ERROR: Failed extracting the tar image" + fi + ;; + esac + + # Check if this was a FTP download and clean it up now + if [ "${INSTALLMEDIUM}" = "ftp" ] + then + echo_log "Cleaning up downloaded archive" + rm ${INSFILE} + rm ${INSFILE}.count >/dev/null 2>/dev/null + rm ${INSFILE}.md5 >/dev/null 2>/dev/null + fi + + echo_log "pc-sysinstall: Extraction Finished" + +}; + +# Performs the extraction of data to disk from a directory with split files +start_extract_split() +{ + if [ -z "${INSDIR}" ] + then + exit_err "ERROR: Called extraction with no install directory set!" + fi + + echo_log "pc-sysinstall: Starting Extraction" + + # Used by install.sh + DESTDIR="${FSMNT}" + export DESTDIR + + HERE=`pwd` + DIRS=`ls -d ${INSDIR}/*|grep -Ev '(uzip|kernels|src)'` + for dir in ${DIRS} + do + cd "${dir}" + if [ -f "install.sh" ] + then + echo "Extracting" `basename ${dir}` + echo "y" | sh install.sh >/dev/null + if [ "$?" != "0" ] + then + exit_err "ERROR: Failed extracting ${dir}" + fi + else + exit_err "ERROR: ${dir}/install.sh does not exist" + fi + done + cd "${HERE}" + + KERNELS=`ls -d ${INSDIR}/*|grep kernels` + cd "${KERNELS}" + if [ -f "install.sh" ] + then + echo "Extracting" `basename ${KERNELS}` + echo "y" | sh install.sh generic >/dev/null + if [ "$?" != "0" ] + then + exit_err "ERROR: Failed extracting ${KERNELS}" + fi + echo 'kernel="GENERIC"' > "${FSMNT}/boot/loader.conf" + else + exit_err "ERROR: ${KERNELS}/install.sh does not exist" + fi + cd "${HERE}" + + SOURCE=`ls -d ${INSDIR}/*|grep src` + cd "${SOURCE}" + if [ -f "install.sh" ] + then + echo "Extracting" `basename ${SOURCE}` + echo "y" | sh install.sh all >/dev/null + if [ "$?" != "0" ] + then + exit_err "ERROR: Failed extracting ${SOURCE}" + fi + else + exit_err "ERROR: ${SOURCE}/install.sh does not exist" + fi + cd "${HERE}" + + echo_log "pc-sysinstall: Extraction Finished" +}; + +# Function which will attempt to fetch the install file before we start +# the install +fetch_install_file() +{ + get_value_from_cfg ftpPath + if [ -z "$VAL" ] + then + exit_err "ERROR: Install medium was set to ftp, but no ftpPath was provided!" + fi + + FTPPATH="${VAL}" + + # Check if we have a /usr partition to save the download + if [ -d "${FSMNT}/usr" ] + then + OUTFILE="${FSMNT}/usr/.fetch-${INSFILE}" + else + OUTFILE="${FSMNT}/.fetch-${INSFILE}" + fi + + # Do the fetch of the archive now + fetch_file "${FTPPATH}/${INSFILE}" "${OUTFILE}" "1" + + # Check to see if there is a .count file for this install + fetch_file "${FTPPATH}/${INSFILE}.count" "${OUTFILE}.count" "0" + + # Check to see if there is a .md5 file for this install + fetch_file "${FTPPATH}/${INSFILE}.md5" "${OUTFILE}.md5" "0" + + # Done fetching, now reset the INSFILE to our downloaded archived + INSFILE="${OUTFILE}" ; export INSFILE + +}; + +# Function which does the rsync download from the server specifed in cfg +start_rsync_copy() +{ + # Load our rsync config values + get_value_from_cfg rsyncPath + if [ -z "${VAL}" ]; then + exit_err "ERROR: rsyncPath is unset! Please check your config and try again." + fi + RSYNCPATH="${VAL}" ; export RSYNCPATH + + get_value_from_cfg rsyncHost + if [ -z "${VAL}" ]; then + exit_err "ERROR: rsyncHost is unset! Please check your config and try again." + fi + RSYNCHOST="${VAL}" ; export RSYNCHOST + + get_value_from_cfg rsyncUser + if [ -z "${VAL}" ]; then + exit_err "ERROR: rsyncUser is unset! Please check your config and try again." + fi + RSYNCUSER="${VAL}" ; export RSYNCUSER + + get_value_from_cfg rsyncPort + if [ -z "${VAL}" ]; then + exit_err "ERROR: rsyncPort is unset! Please check your config and try again." + fi + RSYNCPORT="${VAL}" ; export RSYNCPORT + + COUNT="1" + while + z=1 + do + if [ ${COUNT} -gt ${RSYNCTRIES} ] + then + exit_err "ERROR: Failed rsync command!" + break + fi + + rsync -avvzHsR \ + --rsync-path="rsync --fake-super" \ + -e "ssh -p ${RSYNCPORT}" \ + ${RSYNCUSER}@${RSYNCHOST}:${RSYNCPATH}/./ ${FSMNT} + if [ "$?" != "0" ] + then + echo "Rsync failed! Tries: ${COUNT}" + else + break + fi + + COUNT="`expr ${COUNT} + 1`" + done + +}; + + +# Entrance function, which starts the installation process +init_extraction() +{ + # Figure out what file we are using to install from via the config + get_value_from_cfg installFile + + if [ ! -z "${VAL}" ] + then + INSFILE="${VAL}" ; export INSFILE + else + # If no installFile specified, try our defaults + if [ "$INSTALLTYPE" = "FreeBSD" ] + then + case $PACKAGETYPE in + uzip) INSFILE="${FBSD_UZIP_FILE}" ;; + tar) INSFILE="${FBSD_TAR_FILE}" ;; + split) + INSDIR="${FBSD_BRANCH_DIR}" + + # This is to trick opt_mount into not failing + INSFILE="${INSDIR}" + ;; + esac + else + case $PACKAGETYPE in + uzip) INSFILE="${UZIP_FILE}" ;; + tar) INSFILE="${TAR_FILE}" ;; + esac + fi + export INSFILE + fi + + # Lets start by figuring out what medium we are using + case ${INSTALLMEDIUM} in + dvd|usb) # Lets start by mounting the disk + opt_mount + if [ ! -z "${INSDIR}" ] + then + INSDIR="${CDMNT}/${INSDIR}" ; export INSDIR + start_extract_split + + else + INSFILE="${CDMNT}/${INSFILE}" ; export INSFILE + start_extract_uzip_tar + fi + ;; + ftp) fetch_install_file + start_extract_uzip_tar + ;; + rsync) start_rsync_copy + ;; + *) exit_err "ERROR: Unknown install medium" ;; + esac + +}; diff --git a/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-installcomponents.sh.svn-base b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-installcomponents.sh.svn-base new file mode 100644 index 0000000..cb3b0a6 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-installcomponents.sh.svn-base @@ -0,0 +1,140 @@ +#!/bin/sh +# Functions which check and load any optional modules specified in the config + +. ${BACKEND}/functions.sh +. ${BACKEND}/functions-parse.sh + +copy_component() +{ + COMPONENT="$1" + FAILED="0" + CFILES="" + + # Check the type, and set the components subdir properly + TYPE="`grep 'type:' ${COMPDIR}/${COMPONENT}/component.cfg | cut -d ' ' -f 2`" + if [ "${TYPE}" = "PBI" ] + then + SUBDIR="PBI" + else + SUBDIR="components" + fi + + # Lets start by downloading / copying the files this component needs + while read line + do + CFILE="`echo $line | cut -d ':' -f 1`" + CFILEMD5="`echo $line | cut -d ':' -f 2`" + CFILE2MD5="`echo $line | cut -d ':' -f 3`" + + + case ${INSTALLMEDIUM} in + dvd|usb) # On both dvd / usb, we can just copy the file + cp ${CDMNT}/${COMPFILEDIR}/${SUBDIR}/${CFILE} \ + ${FSMNT}/${COMPTMPDIR} >>${LOGOUT} 2>>${LOGOUT} + RESULT="$?" + ;; + ftp) get_value_from_cfg ftpPath + if [ -z "$VAL" ] + then + exit_err "ERROR: Install medium was set to ftp, but no ftpPath was provided!" + fi + FTPPATH="${VAL}" + + fetch_file "${FTPPATH}/${COMPFILEDIR}/${SUBDIR}/${CFILE}" "${FSMNT}/${COMPTMPDIR}/${CFILE}" "0" + RESULT="$?" + ;; + esac + + if [ "${RESULT}" != "0" ] + then + echo_log "WARNING: Failed to copy ${CFILE}" + FAILED="1" + else + # Now lets check the MD5 to confirm the file is valid + CHECKMD5=`md5 -q ${FSMNT}/${COMPTMPDIR}/${CFILE}` + if [ "${CHECKMD5}" != "${CFILEMD5}" -a "${CHECKMD5}" != "${CFILE2MD5}" ] + then + echo_log "WARNING: ${CFILE} failed md5 checksum" + FAILED="1" + else + if [ -z "${CFILES}" ] + then + CFILES="${CFILE}" + else + CFILES="${CFILES},${CFILE}" + fi + fi + fi + + + done < ${COMPDIR}/${COMPONENT}/distfiles + + if [ "${FAILED}" = "0" ] + then + # Now install the component + run_component_install ${COMPONENT} ${CFILES} + fi + +}; + +run_component_install() +{ + COMPONENT="$1" + CFILES="$1" + + # Lets install this component now + # Start by making a wrapper script which sets the variables + # for the component to use + echo "#!/bin/sh +COMPTMPDIR=\"${COMPTMPDIR}\" +export COMPTMPDIR +CFILE=\"${CFILE}\" +export CFILE + +sh ${COMPTMPDIR}/install.sh + +" >${FSMNT}/.componentwrapper.sh + chmod 755 ${FSMNT}/.componentwrapper.sh + + # Copy over the install script for this component + cp ${COMPDIR}/${COMPONENT}/install.sh ${FSMNT}/${COMPTMPDIR}/ + + echo_log "INSTALL COMPONENT: ${i}" + chroot ${FSMNT} /.componentwrapper.sh >>${LOGOUT} 2>>${LOGOUT} + rm ${FSMNT}/.componentwrapper.sh + + +}; + +# Check for any modules specified, and begin loading them +install_components() +{ + # First, lets check and see if we even have any optional modules + get_value_from_cfg installComponents + if [ ! -z "${VAL}" ] + then + # Lets start by cleaning up the string and getting it ready to parse + strip_white_space ${VAL} + COMPONENTS=`echo ${VAL} | sed -e "s|,| |g"` + for i in $COMPONENTS + do + if [ ! -e "${COMPDIR}/${i}/install.sh" -o ! -e "${COMPDIR}/${i}/distfiles" ] + then + echo_log "WARNING: Component ${i} doesn't seem to exist" + else + + # Make the tmpdir on the disk + mkdir -p ${FSMNT}/${COMPTMPDIR} >>${LOGOUT} 2>>${LOGOUT} + + # Start by grabbing the component files + copy_component ${i} + + # Remove the tmpdir now + rm -rf ${FSMNT}/${COMPTMPDIR} >>${LOGOUT} 2>>${LOGOUT} + + fi + done + + fi + +}; diff --git a/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-localize.sh.svn-base b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-localize.sh.svn-base new file mode 100644 index 0000000..02dfd61 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-localize.sh.svn-base @@ -0,0 +1,449 @@ +#!/bin/sh +# Functions which runs commands on the system + +. ${BACKEND}/functions.sh +. ${BACKEND}/functions-parse.sh + + +# Function which localizes a FreeBSD install +localize_freebsd() +{ + sed -i.bak "s/lang=en_US/lang=${LOCALE}/g" ${FSMNT}/etc/login.conf + rm ${FSMNT}/etc/login.conf.bak +}; + + +# Function which localizes a PC-BSD install +localize_pcbsd() +{ + #Change the skel files + ########################################################################## + sed -i.bak "s/Country=us/Country=${COUNTRY}/g" ${FSMNT}/usr/share/skel/.kde4/share/config/kdeglobals + sed -i.bak "s/Country=us/Country=${COUNTRY}/g" ${FSMNT}/root/.kde4/share/config/kdeglobals + sed -i.bak "s/Language=en_US/Language=${SETLANG}:${LOCALE}/g" ${FSMNT}/usr/share/skel/.kde4/share/config/kdeglobals + sed -i.bak "s/Language=en_US/Language=${SETLANG}:${LOCALE}/g" ${FSMNT}/root/.kde4/share/config/kdeglobals + + #Change KDM Langs + ########################################################################## + sed -i.bak "s/Language=en_US/Language=${LOCALE}.UTF-8/g" ${FSMNT}/usr/local/kde4/share/config/kdm/kdmrc + + # Check if we have a localized splash screen and copy it + if [ -e "${FSMNT}/usr/PCBSD/splash-screens/loading-screen-${SETLANG}.pcx" ] + then + cp ${FSMNT}/usr/PCBSD/splash-screens/loading-screen-${SETLANG}.pcx ${FSMNT}/boot/loading-screen.pcx + fi + +}; + +localize_x_keyboard() +{ + KEYMOD="$1" + KEYLAY="$2" + KEYVAR="$3" + COUNTRY="$4" + SETXKBMAP="" + + if [ "${COUNTRY}" = "NONE" ] || [ "${COUNTRY}" = "us" ]; + then + #In this case we don't need any additional language + COUNTRY="" + else + COUNTRY=",${COUNTRY}" + fi + + if [ "${KEYMOD}" != "NONE" ] + then + SETXKBMAP="-model ${KEYMOD}" + KXMODEL="${KEYMOD}" + else + KXMODEL="pc104" + fi + + if [ "${KEYLAY}" != "NONE" ] + then + localize_key_layout "$KEYLAY" + SETXKBMAP="${SETXKBMAP} -layout ${KEYLAY}" + KXLAYOUT="${KEYLAY}" + else + KXLAYOUT="us" + fi + + if [ "${KEYVAR}" != "NONE" ] + then + SETXKBMAP="${SETXKBMAP} -variant ${KEYVAR}" + KXVAR="(${KEYVAR})" + else + KXVAR="" + fi + + # Setup .xprofile with our setxkbmap call now + if [ ! -z "${SETXKBMAP}" ] + then + if [ ! -e "${FSMNT}/usr/share/skel/.xprofile" ] + then + echo "#!/bin/sh" >${FSMNT}/usr/share/skel/.xprofile + fi + + # Save the keyboard layout for user / root X logins + echo "setxkbmap ${SETXKBMAP}" >>${FSMNT}/usr/share/skel/.xprofile + chmod 755 ${FSMNT}/usr/share/skel/.xprofile + cp ${FSMNT}/usr/share/skel/.xprofile ${FSMNT}/root/.xprofile + + # Save it for KDM + echo "setxkbmap ${SETXKBMAP}" >>${FSMNT}/usr/local/kde4/share/config/kdm/Xsetup + fi + + + # Create the kxkbrc configuration using these options + echo "[Layout] +DisplayNames=${KXLAYOUT}${COUNTRY} +IndicatorOnly=false +LayoutList=${KXLAYOUT}${KXVAR}${COUNTRY} +Model=${KXMODEL} +Options= +ResetOldOptions=true +ShowFlag=true +ShowSingle=false +SwitchMode=WinClass +Use=true " >${FSMNT}/usr/share/skel/.kde4/share/config/kxkbrc + +}; + +localize_key_layout() +{ + + KEYLAYOUT="$1" + + # Set the keylayout in rc.conf + case ${KEYLAYOUT} in + am) KEYLAYOUT_CONSOLE="hy.armscii-8" ;; + ch) KEYLAYOUT_CONSOLE="swissgerman.iso" ;; + cz) KEYLAYOUT_CONSOLE="cz.iso2" ;; + de) KEYLAYOUT_CONSOLE="german.iso" ;; + dk) KEYLAYOUT_CONSOLE="danish.iso" ;; + ee) KEYLAYOUT_CONSOLE="estonian.iso" ;; + es) KEYLAYOUT_CONSOLE="spanish.iso" ;; + fi) KEYLAYOUT_CONSOLE="finnish.iso" ;; + is) KEYLAYOUT_CONSOLE="icelandic.iso" ;; + jp) KEYLAYOUT_CONSOLE="jp.106" ;; + nl) KEYLAYOUT_CONSOLE="dutch.iso.acc" ;; + no) KEYLAYOUT_CONSOLE="norwegian.iso" ;; + pl) KEYLAYOUT_CONSOLE="pl_PL.ISO8859-2" ;; + ru) KEYLAYOUT_CONSOLE="ru.koi8-r" ;; + sk) KEYLAYOUT_CONSOLE="sk.iso2" ;; + se) KEYLAYOUT_CONSOLE="swedish.iso" ;; + tr) KEYLAYOUT_CONSOLE="tr.iso9.q" ;; + gb) KEYLAYOUT_CONSOLE="uk.iso" ;; + *) if [ ! -z "${KEYLAYOUT}" ] + then + KEYLAYOUT_CONSOLE="${KEYLAYOUT}.iso" + fi + ;; + esac + + if [ ! -z "${KEYLAYOUT_CONSOLE}" ] + then + echo "keymap=\"${KEYLAYOUT_CONSOLE}\"" >>${FSMNT}/etc/rc.conf + fi + +}; + +# Function which prunes other l10n files from the KDE install +localize_prune_langs() +{ + get_value_from_cfg localizeLang + KEEPLANG="$VAL" + if [ -z "$KEEPLANG" ] ; then + KEEPLANG="en" + fi + export KEEPLANG + + echo_log "Pruning other l10n files, keeping ${KEEPLANG}" + + # Create the script to do uninstalls + echo '#!/bin/sh + + for i in `pkg_info | grep "kde-l10n" | cut -d " " -f 1` + do + echo "$i" | grep "${KEEPLANG}-kde" + if [ "$?" != "0" ] ; then + pkg_delete ${i} + fi + done + ' > ${FSMNT}/.pruneLangs.sh + + chmod 755 ${FSMNT}/.pruneLangs.sh + chroot ${FSMNT} /.pruneLangs.sh >/dev/null 2>/dev/null + rm ${FSMNT}/.pruneLangs.sh + +}; + +# Function which sets COUNTRY SETLANG and LOCALE based upon $1 +localize_get_codes() +{ + TARGETLANG="${1}" + # Setup the presets for the specific lang + case $TARGETLANG in + af) COUNTRY="C" + SETLANG="af" + LOCALE="af_ZA" + ;; + ar) COUNTRY="C" + SETLANG="ar" + LOCALE="en_US" + ;; + az) COUNTRY="C" + SETLANG="az" + LOCALE="en_US" + ;; + ca) COUNTRY="es" + SETLANG="es:ca" + LOCALE="ca_ES" + ;; + be) COUNTRY="be" + SETLANG="be" + LOCALE="be_BY" + ;; + bn) COUNTRY="bn" + SETLANG="bn" + LOCALE="en_US" + ;; + bg) COUNTRY="bg" + SETLANG="bg" + LOCALE="bg_BG" + ;; + cs) COUNTRY="cz" + SETLANG="cs" + LOCALE="cs_CZ" + ;; + da) COUNTRY="dk" + SETLANG="da" + LOCALE="da_DK" + ;; + de) COUNTRY="de" + SETLANG="de" + LOCALE="de_DE" + ;; + en_GB) COUNTRY="gb" + SETLANG="en_GB:cy" + LOCALE="en_GB" + ;; + el) COUNTRY="gr" + SETLANG="el:gr" + LOCALE="el_GR" + ;; + es) COUNTRY="es" + SETLANG="es" + LOCALE="es_ES" + ;; + es_LA) COUNTRY="us" + SETLANG="es:en_US" + LOCALE="es_ES" + ;; + et) COUNTRY="ee" + SETLANG="et" + LOCALE="et_EE" + ;; + fr) COUNTRY="fr" + SETLANG="fr" + LOCALE="fr_FR" + ;; + he) COUNTRY="il" + SETLANG="he:ar" + LOCALE="he_IL" + ;; + hr) COUNTRY="hr" + SETLANG="hr" + LOCALE="hr_HR" + ;; + hu) COUNTRY="hu" + SETLANG="hu" + LOCALE="hu_HU" + ;; + it) COUNTRY="it" + SETLANG="it" + LOCALE="it_IT" + ;; + ja) COUNTRY="jp" + SETLANG="ja" + LOCALE="ja_JP" + ;; + ko) COUNTRY="kr" + SETLANG="ko" + LOCALE="ko_KR" + ;; + nl) COUNTRY="nl" + SETLANG="nl" + LOCALE="nl_NL" + ;; + nn) COUNTRY="no" + SETLANG="nn" + LOCALE="en_US" + ;; + pa) COUNTRY="pa" + SETLANG="pa" + LOCALE="en_US" + ;; + pl) COUNTRY="pl" + SETLANG="pl" + LOCALE="pl_PL" + ;; + pt) COUNTRY="pt" + SETLANG="pt" + LOCALE="pt_PT" + ;; + pt_BR) COUNTRY="br" + SETLANG="pt_BR" + LOCALE="pt_BR" + ;; + ru) COUNTRY="ru" + SETLANG="ru" + LOCALE="ru_RU" + ;; + sl) COUNTRY="si" + SETLANG="sl" + LOCALE="sl_SI" + ;; + sk) COUNTRY="sk" + SETLANG="sk" + LOCALE="sk_SK" + ;; + sv) COUNTRY="se" + SETLANG="sv" + LOCALE="sv_SE" + ;; + uk) COUNTRY="ua" + SETLANG="uk" + LOCALE="uk_UA" + ;; + vi) COUNTRY="vn" + SETLANG="vi" + LOCALE="en_US" + ;; + zh_CN) COUNTRY="cn" + SETLANG="zh_CN" + LOCALE="zh_CN" + ;; + zh_TW) COUNTRY="tw" + SETLANG="zh_TW" + LOCALE="zh_TW" + ;; + *) COUNTRY="C" + SETLANG="${TARGETLANG}" + LOCALE="en_US" + ;; + esac + + export COUNTRY SETLANG LOCALE + +}; + +# Function which sets the timezone on the system +set_timezone() +{ + TZONE="$1" + cp ${FSMNT}/usr/share/zoneinfo/${TZONE} ${FSMNT}/etc/localtime +}; + +# Function which enables / disables NTP +set_ntp() +{ + ENABLED="$1" + if [ "$ENABLED" = "yes" -o "${ENABLED}" = "YES" ] + then + cat ${FSMNT}/etc/rc.conf 2>/dev/null | grep 'ntpd_enable="YES"' >/dev/null 2>/dev/null + if [ "$?" != "0" ] + then + echo 'ntpd_enable="YES"' >>${FSMNT}/etc/rc.conf + echo 'ntpd_sync_on_start="YES"' >>${FSMNT}/etc/rc.conf + fi + else + cat ${FSMNT}/etc/rc.conf 2>/dev/null | grep 'ntpd_enable="YES"' >/dev/null 2>/dev/null + if [ "$?" != "0" ] + then + sed -i.bak 's|ntpd_enable="YES"||g' ${FSMNT}/etc/rc.conf + fi + fi +}; + +# Starts checking for localization directives +run_localize() +{ + KEYLAYOUT="NONE" + KEYMOD="NONE" + KEYVAR="NONE" + LANGUAGE="NONE" + + while read line + do + # Check if we need to do any localization + echo $line | grep "^localizeLang=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + + # Set our country / lang / locale variables + get_value_from_string "$line" + localize_get_codes ${VAL} + + get_value_from_string "$line" + # If we are doing PC-BSD install, localize it as well as FreeBSD base + if [ "${INSTALLTYPE}" != "FreeBSD" ] + then + localize_pcbsd "$VAL" + LANGUAGE="$VAL" + fi + localize_freebsd "$VAL" + fi + + # Check if we need to do any keylayouts + echo $line | grep "^localizeKeyLayout=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + get_value_from_string "$line" + KEYLAYOUT="$VAL" + fi + + # Check if we need to do any key models + echo $line | grep "^localizeKeyModel=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + get_value_from_string "$line" + KEYMOD="$VAL" + fi + + # Check if we need to do any key variant + echo $line | grep "^localizeKeyVariant=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + get_value_from_string "$line" + KEYVAR="$VAL" + fi + + + # Check if we need to set a timezone + echo $line | grep "^timeZone=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + get_value_from_string "$line" + set_timezone "$VAL" + fi + + # Check if we need to set a timezone + echo $line | grep "^enableNTP=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + get_value_from_string "$line" + set_ntp "$VAL" + fi + done <${CFGF} + + if [ "${INSTALLTYPE}" != "FreeBSD" ] ; then + # Do our X keyboard localization + localize_x_keyboard "${KEYMOD}" "${KEYLAYOUT}" "${KEYVAR}" "${COUNTRY}" + fi + + # Check if we want to prunt any other KDE lang files to save some disk space + get_value_from_cfg localizePrune + if [ "${VAL}" = "yes" -o "${VAL}" = "YES" ] ; then + localize_prune_langs + fi + + # Update the login.conf db, even if we didn't localize, its a good idea to make sure its up2date + run_chroot_cmd "/usr/bin/cap_mkdb /etc/login.conf" >/dev/null 2>/dev/null + +}; diff --git a/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-mountdisk.sh.svn-base b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-mountdisk.sh.svn-base new file mode 100644 index 0000000..112e299 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-mountdisk.sh.svn-base @@ -0,0 +1,164 @@ +#!/bin/sh +# Functions related mounting the newly formatted disk partitions + +# Mounts all the specified partition to the mount-point +mount_partition() +{ + if [ -z "${1}" -o -z "${2}" -o -z "${3}" ] + then + exit_err "ERROR: Missing arguments for mount_partition" + fi + + PART="${1}" + PARTFS="${2}" + MNTPOINT="${3}" + MNTFLAGS="${4}" + + # Setup the MNTOPTS + if [ -z "${MNTOPTS}" ] + then + MNTFLAGS="-o rw" + else + MNTFLAGS="-o rw,${MNTFLAGS}" + fi + + + #We are on ZFS, lets setup this mount-point + if [ "${PARTFS}" = "ZFS" ] + then + ZPOOLNAME=$(get_zpool_name "${PART}") + + # Check if we have multiple zfs mounts specified + for ZMNT in `echo ${MNTPOINT} | sed 's|,| |g'` + do + # First make sure we create the mount point + if [ ! -d "${FSMNT}${ZMNT}" ] ; then + mkdir -p ${FSMNT}${ZMNT} >>${LOGOUT} 2>>${LOGOUT} + fi + + if [ "${ZMNT}" = "/" ] ; then + ZNAME="" + else + ZNAME="${ZMNT}" + echo_log "zfs create -p ${ZPOOLNAME}${ZNAME}" + rc_halt "zfs create -p ${ZPOOLNAME}${ZNAME}" + fi + sleep 2 + rc_halt "zfs set mountpoint=${FSMNT}${ZNAME} ${ZPOOLNAME}${ZNAME}" + + # Disable atime for this zfs partition, speed increase + rc_nohalt "zfs set atime=off ${ZPOOLNAME}${ZNAME}" + done + + else + # If we are not on ZFS, lets do the mount now + # First make sure we create the mount point + if [ ! -d "${FSMNT}${MNTPOINT}" ] + then + mkdir -p ${FSMNT}${MNTPOINT} >>${LOGOUT} 2>>${LOGOUT} + fi + + echo_log "mount ${MNTFLAGS} /dev/${PART} -> ${FSMNT}${MNTPOINT}" + sleep 2 + rc_halt "mount ${MNTFLAGS} /dev/${PART} ${FSMNT}${MNTPOINT}" + fi + +}; + +# Mounts all the new file systems to prepare for installation +mount_all_filesystems() +{ + # Make sure our mount point exists + mkdir -p ${FSMNT} >/dev/null 2>/dev/null + + # First lets find and mount the / partition + ######################################################### + for PART in `ls ${PARTDIR}` + do + if [ ! -e "/dev/${PART}" ] + then + exit_err "ERROR: The partition ${PART} does not exist. Failure in bsdlabel?" + fi + + PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`" + PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`" + PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`" + + if [ "${PARTENC}" = "ON" ] + then + EXT=".eli" + else + EXT="" + fi + + # Check for root partition for mounting, including ZFS "/,/usr" type + echo "$PARTMNT" | grep "/," >/dev/null + if [ "$?" = "0" -o "$PARTMNT" = "/" ] + then + case ${PARTFS} in + UFS) mount_partition ${PART}${EXT} ${PARTFS} ${PARTMNT} "noatime" + ;; + UFS+S) mount_partition ${PART}${EXT} ${PARTFS} ${PARTMNT} "noatime" + ;; + UFS+J) mount_partition ${PART}${EXT}.journal ${PARTFS} ${PARTMNT} "async,noatime" + ;; + ZFS) mount_partition ${PART} ${PARTFS} ${PARTMNT} + ;; + *) exit_err "ERROR: Got unknown file-system type $PARTFS" ;; + esac + + fi + + done + + # Now that we've mounted "/" lets do any other remaining mount-points + ################################################################## + for PART in `ls ${PARTDIR}` + do + if [ ! -e "/dev/${PART}" ] + then + exit_err "ERROR: The partition ${PART} does not exist. Failure in bsdlabel?" + fi + + PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`" + PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`" + PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`" + + if [ "${PARTENC}" = "ON" ] + then + EXT=".eli" + else + EXT="" + fi + + # Check if we've found "/" again, don't need to mount it twice + echo "$PARTMNT" | grep "/," >/dev/null + if [ "$?" != "0" -a "$PARTMNT" != "/" ] + then + case ${PARTFS} in + UFS) mount_partition ${PART}${EXT} ${PARTFS} ${PARTMNT} "noatime" + ;; + UFS+S) mount_partition ${PART}${EXT} ${PARTFS} ${PARTMNT} "noatime" + ;; + UFS+J) mount_partition ${PART}${EXT}.journal ${PARTFS} ${PARTMNT} "async,noatime" + ;; + ZFS) mount_partition ${PART} ${PARTFS} ${PARTMNT} + ;; + SWAP) # Lets enable this swap now + if [ "$PARTENC" = "ON" ] + then + echo_log "Enabling encrypted swap on /dev/${PART}" + rc_halt "geli onetime -d -e 3des ${PART}" + sleep 5 + rc_halt "swapon /dev/${PART}.eli" + else + echo_log "swapon ${PART}" + sleep 5 + rc_halt "swapon /dev/${PART}" + fi + ;; + *) exit_err "ERROR: Got unknown file-system type $PARTFS" ;; + esac + fi + done +}; diff --git a/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-mountoptical.sh.svn-base b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-mountoptical.sh.svn-base new file mode 100644 index 0000000..c4c324d --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-mountoptical.sh.svn-base @@ -0,0 +1,126 @@ +#!/bin/sh +# Functions which perform mounting / unmounting and switching of optical / usb media + +. ${BACKEND}/functions.sh +. ${BACKEND}/functions-parse.sh + +# Displays an optical failure message +opt_fail() +{ + # If we got here, we must not have a DVD/USB we can find :( + get_value_from_cfg installInteractive + if [ "${VAL}" = "yes" ] + then + # We are running interactive, and didn't find a DVD, prompt user again + echo_log "DISK ERROR: Unable to find installation disk!" + echo_log "Please insert the installation disk and press enter." + read tmp + else + exit_err "ERROR: Unable to locate installation DVD/USB" + fi +}; + +# Performs the extraction of data to disk +opt_mount() +{ + FOUND="0" + + # Ensure we have a directory where its supposed to be + if [ ! -d "${CDMNT}" ] + then + mkdir -p ${CDMNT} + fi + + + # Start by checking if we already have a cd mounted at CDMNT + mount | grep "${CDMNT} " >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + if [ -e "${CDMNT}/${INSFILE}" ] + then + echo "MOUNTED" >${TMPDIR}/cdmnt + echo_log "FOUND DVD: MOUNTED" + FOUND="1" + return + fi + + # failed to find optical disk + opt_fail + return + fi + +# Setup our loop to search for installation media + while + z=1 + do + + # Loop though and look for an installation disk + for i in `ls -1 /dev/acd* /dev/cd* /dev/scd* /dev/rscd* 2>/dev/null` + do + # Find the CD Device + /sbin/mount_cd9660 $i ${CDMNT} + + # Check the package type to see if we have our install data + if [ -e "${CDMNT}/${INSFILE}" ] + then + echo "${i}" >${TMPDIR}/cdmnt + echo_log "FOUND DVD: ${i}" + FOUND="1" + break + fi + /sbin/umount ${CDMNT} >/dev/null 2>/dev/null + done + + # If no DVD found, try USB + if [ "$FOUND" != "1" ] + then + # Loop though and look for an installation disk + for i in `ls -1 /dev/da* 2>/dev/null` + do + # Check if we can mount this device UFS + /sbin/mount -r $i ${CDMNT} + + # Check the package type to see if we have our install data + if [ -e "${CDMNT}/${INSFILE}" ] + then + echo "${i}" >${TMPDIR}/cdmnt + echo_log "FOUND USB: ${i}" + FOUND="1" + break + fi + /sbin/umount ${CDMNT} >/dev/null 2>/dev/null + + # Also check if it is a FAT mount + /sbin/mount -r -t msdosfs $i ${CDMNT} + + # Check the package type to see if we have our install data + if [ -e "${CDMNT}/${INSFILE}" ] + then + echo "${i}" >${TMPDIR}/cdmnt + echo_log "FOUND USB: ${i}" + FOUND="1" + break + fi + /sbin/umount ${CDMNT} >/dev/null 2>/dev/null + done + fi # End of USB Check + + + if [ "$FOUND" = "1" ] + then + break + fi + + # Failed to find a disk, take action now + opt_fail + + done + +}; + +# Function to unmount optical media +opt_umount() +{ + /sbin/umount ${CDMNT} >/dev/null 2>/dev/null +}; + diff --git a/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-networking.sh.svn-base b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-networking.sh.svn-base new file mode 100644 index 0000000..eca2321 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-networking.sh.svn-base @@ -0,0 +1,330 @@ +#!/bin/sh +# Functions which perform our networking setup + +# Function which creates a kde4 .desktop file for the PC-BSD net tray +create_desktop_nettray() +{ + NIC="${1}" + echo "#!/usr/bin/env xdg-open +[Desktop Entry] +Exec=/usr/local/kde4/bin/pc-nettray ${NIC} +Icon=network +StartupNotify=false +Type=Application" > ${FSMNT}/usr/share/skel/.kde4/Autostart/tray-${NIC}.desktop + chmod 744 ${FSMNT}/usr/share/skel/.kde4/Autostart/tray-${NIC}.desktop + +}; + +# Function which checks is a nic is wifi or not +check_is_wifi() +{ + NIC="$1" + ifconfig ${NIC} | grep "802.11" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + return 0 + else + return 1 + fi +}; + +# Function to get the first available wired nic, used for lagg0 setup +get_first_wired_nic() +{ + rm ${TMPDIR}/.niclist >/dev/null 2>/dev/null + # start by getting a list of nics on this system + ${QUERYDIR}/detect-nics.sh > ${TMPDIR}/.niclist + if [ -e "${TMPDIR}/.niclist" ] + then + while read line + do + NIC="`echo $line | cut -d ':' -f 1`" + check_is_wifi ${NIC} + if [ "$?" != "0" ] + then + VAL="${NIC}" ; export VAL + return + fi + done < ${TMPDIR}/.niclist + fi + + VAL="" ; export VAL + return +}; + +# Function which simply enables plain dhcp on all detected nics, not fancy lagg interface +enable_plain_dhcp_all() +{ + rm ${TMPDIR}/.niclist >/dev/null 2>/dev/null + # start by getting a list of nics on this system + ${QUERYDIR}/detect-nics.sh > ${TMPDIR}/.niclist + if [ -e "${TMPDIR}/.niclist" ] + then + echo "# Auto-Enabled NICs from pc-sysinstall" >>${FSMNT}/etc/rc.conf + WLANCOUNT="0" + while read line + do + NIC="`echo $line | cut -d ':' -f 1`" + DESC="`echo $line | cut -d ':' -f 2`" + echo_log "Setting $NIC to DHCP on the system." + check_is_wifi ${NIC} + if [ "$?" = "0" ] + then + # We have a wifi device, setup a wlan* entry for it + WLAN="wlan${WLANCOUNT}" + echo "wlans_${NIC}=\"${WLAN}\"" >>${FSMNT}/etc/rc.conf + echo "ifconfig_${WLAN}=\"DHCP\"" >>${FSMNT}/etc/rc.conf + CNIC="${WLAN}" + WLANCOUNT="`expr ${WLANCOUNT} + 1`" + else + echo "ifconfig_${NIC}=\"DHCP\"" >>${FSMNT}/etc/rc.conf + CNIC="${NIC}" + fi + + done < ${TMPDIR}/.niclist + fi +}; + +# Function which enables fancy lagg dhcp on specified wifi +enable_lagg_dhcp() +{ + WIFINIC="$1" + + # Get the first wired nic + get_first_wired_nic + WIRENIC=$VAL + LAGGPORT="laggport ${WIFINIC}" + + echo "# Auto-Enabled NICs from pc-sysinstall" >>${FSMNT}/etc/rc.conf + if [ ! -z "$WIRENIC" ] + then + echo "ifconfig_${WIRENIC}=\"up\"" >> ${FSMNT}/etc/rc.conf + echo "ifconfig_${WIFINIC}=\"\`ifconfig ${WIRENIC} ether\`\"" >> ${FSMNT}/etc/rc.conf + echo "ifconfig_${WIFINIC}=\"ether \${ifconfig_${WIFINIC}##*ether }\"" >> ${FSMNT}/etc/rc.conf + LAGGPORT="laggport ${WIRENIC} ${LAGGPORT}" + fi + + echo "wlans_${WIFINIC}=\"wlan0\"" >> ${FSMNT}/etc/rc.conf + echo "cloned_interfaces=\"lagg0\"" >> ${FSMNT}/etc/rc.conf + echo "ifconfig_lagg0=\"laggproto failover ${LAGGPORT} DHCP\"" >> ${FSMNT}/etc/rc.conf + +}; + +# Function which detects available nics, and runs them to DHCP on the +save_auto_dhcp() +{ + rm ${TMPDIR}/.niclist >/dev/null 2>/dev/null + # start by getting a list of nics on this system + ${QUERYDIR}/detect-nics.sh > ${TMPDIR}/.niclist + if [ -e "${TMPDIR}/.niclist" ] + then + while read line + do + NIC="`echo $line | cut -d ':' -f 1`" + DESC="`echo $line | cut -d ':' -f 2`" + check_is_wifi "${NIC}" + if [ "$?" = "0" ] + then + # We have a wifi device, lets do fancy lagg interface + enable_lagg_dhcp "${NIC}" + return + fi + + done < ${TMPDIR}/.niclist + fi + + # Got here, looks like no wifi, so lets simply enable plain-ole-dhcp + enable_plain_dhcp_all + +}; + + +# Function which saves a manual nic setup to the installed system +save_manual_nic() +{ + # Get the target nic + NIC="$1" + + get_value_from_cfg netSaveIP + NETIP="${VAL}" + + if [ "$NETIP" = "DHCP" ] + then + echo_log "Setting $NIC to DHCP on the system." + echo "ifconfig_${NIC}=\"DHCP\"" >>${FSMNT}/etc/rc.conf + return 0 + fi + + # If we get here, we have a manual setup, lets do so now + + # Set the manual IP + IFARGS="inet ${NETIP}" + + # Check if we have a netmask to set + get_value_from_cfg netSaveMask + NETMASK="${VAL}" + if [ ! -z "${NETMASK}" ] + then + IFARGS="${IFARGS} netmask ${NETMASK}" + fi + + + echo "# Auto-Enabled NICs from pc-sysinstall" >>${FSMNT}/etc/rc.conf + echo "ifconfig_${NIC}=\"${IFARGS}\"" >>${FSMNT}/etc/rc.conf + + # Check if we have a default router to set + get_value_from_cfg netSaveDefaultRouter + NETROUTE="${VAL}" + if [ ! -z "${NETROUTE}" ] + then + echo "defaultrouter=\"${NETROUTE}\"" >>${FSMNT}/etc/rc.conf + fi + + # Check if we have a nameserver to enable + get_value_from_cfg netSaveNameServer + NAMESERVER="${VAL}" + if [ ! -z "${NAMESERVER}" ] + then + echo "nameserver ${NAMESERVER}" >${FSMNT}/etc/resolv.conf + fi + +}; + +# Function which determines if a nic is active / up +is_nic_active() +{ + ifconfig ${1} | grep "status: active" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + return 0 + else + return 1 + fi +}; + + +# Function which detects available nics, and runs DHCP on them until +# a success is found +enable_auto_dhcp() +{ + # start by getting a list of nics on this system + ${QUERYDIR}/detect-nics.sh > ${TMPDIR}/.niclist + while read line + do + NIC="`echo $line | cut -d ':' -f 1`" + DESC="`echo $line | cut -d ':' -f 2`" + + is_nic_active "${NIC}" + if [ "$?" = "0" ] ; then + echo_log "Trying DHCP on $NIC $DESC" + dhclient ${NIC} >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + # Got a valid DHCP IP, we can return now + WRKNIC="$NIC" ; export WRKNIC + return 0 + fi + fi + done < ${TMPDIR}/.niclist + +}; + +# Get the mac address of a target NIC +get_nic_mac() { + FOUNDMAC="`ifconfig ${1} | grep 'ether' | tr -d '\t' | cut -d ' ' -f 2`" + export FOUNDMAC +} + +# Function which performs the manual setup of a target nic in the cfg +enable_manual_nic() +{ + # Get the target nic + NIC="$1" + + # Check that this NIC exists + rc_halt "ifconfig ${NIC}" + + get_value_from_cfg netIP + NETIP="${VAL}" + + if [ "$NETIP" = "DHCP" ] + then + echo_log "Enabling DHCP on $NIC" + rc_halt "dhclient ${NIC}" + return 0 + fi + + # If we get here, we have a manual setup, lets do so now + + # Set the manual IP + rc_halt "ifconfig ${NIC} ${NETIP}" + + # Check if we have a netmask to set + get_value_from_cfg netMask + NETMASK="${VAL}" + if [ ! -z "${NETMASK}" ] + then + rc_halt "ifconfig ${NIC} netmask ${NETMASK}" + fi + + # Check if we have a default router to set + get_value_from_cfg netDefaultRouter + NETROUTE="${VAL}" + if [ ! -z "${NETROUTE}" ] + then + rc_halt "route add default ${NETROUTE}" + fi + + # Check if we have a nameserver to enable + get_value_from_cfg netNameServer + NAMESERVER="${VAL}" + if [ ! -z "${NAMESERVER}" ] + then + echo "nameserver ${NAMESERVER}" >/etc/resolv.conf + fi + + +}; + + +# Function which parses the cfg and enables networking per specified +start_networking() +{ + # Check if we have any networking requested + get_value_from_cfg netDev + if [ -z "${VAL}" ] + then + return 0 + fi + + NETDEV="${VAL}" + if [ "$NETDEV" = "AUTO-DHCP" ] + then + enable_auto_dhcp + else + enable_manual_nic ${NETDEV} + fi + +}; + + +# Function which checks the cfg and enables the specified networking on +# the installed system +save_networking_install() +{ + + # Check if we have any networking requested to save + get_value_from_cfg netSaveDev + if [ -z "${VAL}" ] + then + return 0 + fi + + NETDEV="${VAL}" + if [ "$NETDEV" = "AUTO-DHCP" ] + then + save_auto_dhcp + else + save_manual_nic ${NETDEV} + fi + +}; + diff --git a/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-newfs.sh.svn-base b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-newfs.sh.svn-base new file mode 100644 index 0000000..b1f7f3a --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-newfs.sh.svn-base @@ -0,0 +1,142 @@ +#!/bin/sh +# Functions related to disk operations using newfs + + +# Function which performs the ZFS magic +setup_zfs_filesystem() +{ + PART="$1" + PARTFS="$2" + PARTMNT="$3" + EXT="$4" + PARTGEOM="$5" + ZPOOLOPTS="$6" + ROOTSLICE="`echo ${PART} | rev | cut -b 2- | rev`" + ZPOOLNAME=$(get_zpool_name "${PART}") + + # Sleep a few moments, let the disk catch its breath + sleep 5 + sync + + # Check if we have some custom zpool arguments and use them if so + if [ ! -z "${ZPOOLOPTS}" ] ; then + rc_halt "zpool create -m none -f ${ZPOOLNAME} ${ZPOOLOPTS}" + else + # No zpool options, create pool on single device + rc_halt "zpool create -m none -f ${ZPOOLNAME} ${PART}${EXT}" + fi + + # Disable atime for this zfs partition, speed increase + rc_nohalt "zfs set atime=off ${ZPOOLNAME}" + + # Check if we have multiple zfs mounts specified + for i in `echo ${PARTMNT} | sed 's|,| |g'` + do + # Check if we ended up with needing a zfs bootable partition + if [ "${i}" = "/" -o "${i}" = "/boot" ] + then + if [ "${PARTGEOM}" = "MBR" ] + then + # Lets stamp the proper ZFS boot loader + echo_log "Setting up ZFS boot loader support" + rc_halt "zpool set bootfs=${ZPOOLNAME} ${ZPOOLNAME}" + rc_halt "zpool export ${${ZPOOLNAME}" + rc_halt "dd if=/boot/zfsboot of=/dev/${ROOTSLICE} count=1" + rc_halt "dd if=/boot/zfsboot of=/dev/${PART}${EXT} skip=1 seek=1024" + rc_halt "zpool import ${ZPOOLNAME}" + fi + fi + done + +}; + +# Runs newfs on all the partiions which we've setup with bsdlabel +setup_filesystems() +{ + + # Create the keydir + rm -rf ${GELIKEYDIR} >/dev/null 2>/dev/null + mkdir ${GELIKEYDIR} + + # Lets go ahead and read through the saved partitions we created, and determine if we need to run + # newfs on any of them + for PART in `ls ${PARTDIR}` + do + if [ ! -e "/dev/${PART}" ] + then + exit_err "ERROR: The partition ${PART} does not exist. Failure in bsdlabel?" + fi + + PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`" + PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`" + PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`" + PARTLABEL="`cat ${PARTDIR}/${PART} | cut -d ':' -f 4`" + PARTGEOM="`cat ${PARTDIR}/${PART} | cut -d ':' -f 5`" + PARTXTRAOPTS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 6`" + + # Make sure journaling isn't enabled on this device + if [ -e "/dev/${PART}.journal" ] + then + rc_nohalt "gjournal stop -f ${PART}.journal" + rc_nohalt "gjournal clear ${PART}" + fi + + # Setup encryption if necessary + if [ "${PARTENC}" = "ON" -a "${PARTFS}" != "SWAP" ] + then + echo_log "Creating geli provider for ${PART}" + rc_halt "dd if=/dev/random of=${GELIKEYDIR}/${PART}.key bs=64 count=1" + rc_halt "geli init -b -s 4096 -P -K ${GELIKEYDIR}/${PART}.key /dev/${PART}" + rc_halt "geli attach -p -k ${GELIKEYDIR}/${PART}.key /dev/${PART}" + + EXT=".eli" + else + # No Encryption + EXT="" + fi + + case ${PARTFS} in + UFS) echo_log "NEWFS: /dev/${PART} - ${PARTFS}" + sleep 2 + rc_halt "newfs /dev/${PART}${EXT}" + sleep 2 + rc_halt "sync" + rc_halt "glabel label ${PARTLABEL} /dev/${PART}${EXT}" + rc_halt "sync" + sleep 2 + ;; + UFS+S) echo_log "NEWFS: /dev/${PART} - ${PARTFS}" + sleep 2 + rc_halt "newfs -U /dev/${PART}${EXT}" + sleep 2 + rc_halt "sync" + rc_halt "glabel label ${PARTLABEL} /dev/${PART}${EXT}" + rc_halt "sync" + sleep 2 + ;; + UFS+J) echo_log "NEWFS: /dev/${PART} - ${PARTFS}" + sleep 2 + rc_halt "newfs /dev/${PART}${EXT}" + sleep 2 + rc_halt "gjournal label -f /dev/${PART}${EXT}" + sleep 2 + rc_halt "newfs -O 2 -J /dev/${PART}${EXT}.journal" + sleep 2 + rc_halt "sync" + rc_halt "glabel label ${PARTLABEL} /dev/${PART}${EXT}.journal" + rc_halt "sync" + sleep 2 + ;; + ZFS) echo_log "NEWFS: /dev/${PART} - ${PARTFS}" + setup_zfs_filesystem "${PART}" "${PARTFS}" "${PARTMNT}" "${EXT}" "${PARTGEOM}" "${PARTXTRAOPTS}" + ;; + SWAP) rc_halt "sync" + rc_halt "glabel label ${PARTLABEL} /dev/${PART}${EXT}" + rc_halt "sync" + sleep 2 + ;; + *) exit_err "ERROR: Got unknown file-system type $PARTFS" ;; + esac + + done +}; diff --git a/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-parse.sh.svn-base b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-parse.sh.svn-base new file mode 100644 index 0000000..1fa138d --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-parse.sh.svn-base @@ -0,0 +1,205 @@ +#!/bin/sh +# functions.sh +# Library of functions which pc-sysinstall may call upon for parsing the config + +# which gets the value of a setting in the provided line +get_value_from_string() +{ + if [ ! -z "${1}" ] + then + VAL="`echo ${1} | cut -d '=' -f 2`" + export VAL + else + echo "Error: Did we forgot to supply a string to parse?" + exit 1 + fi +}; + +# Get the value from the cfg file including spaces +get_value_from_cfg_with_spaces() +{ + if [ ! -z "${1}" ] + then + VAL=`grep "^${1}=" ${CFGF} | head -n 1 | cut -d '=' -f 2` + export VAL + else + exit_err "Error: Did we forgot to supply a setting to grab?" + fi +}; + + +# Get the value from the cfg file +get_value_from_cfg() +{ + if [ ! -z "${1}" ] + then + VAL=`grep "^${1}=" ${CFGF} | head -n 1 | cut -d '=' -f 2 | tr -d ' '` + export VAL + else + exit_err "Error: Did we forgot to supply a setting to grab?" + fi +}; + +# Checks the value of a setting in the provided line with supplied possibilities +# 1 = setting we are checking, 2 = list of valid values +if_check_value_exists() +{ + if [ ! -z "${1}" -a ! -z "${2}" ] + then + # Get the first occurance of the setting from the config, strip out whitespace + + VAL=`grep "^${1}" ${CFGF} | head -n 1 | cut -d '=' -f 2 | tr -d ' '` + if [ -z "${VAL}" ] + then + # This value doesn't exist, lets return + return 0 + fi + + + VALID="1" + for i in ${2} + do + if [ "$VAL" = "${i}" ] + then + VALID="0" + fi + done + if [ "$VALID" = "1" ] + then + exit_err "Error: ${1} is set to unknown value $VAL" + fi + else + exit_err "Error: Did we forgot to supply a string to parse and setting to grab?" + fi +}; + +# Checks the value of a setting in the provided line with supplied possibilities +# 1 = setting we are checking, 2 = list of valid values +check_value() +{ + if [ ! -z "${1}" -a ! -z "${2}" ] + then + # Get the first occurance of the setting from the config, strip out whitespace + VAL=`grep "^${1}" ${CFGF} | head -n 1 | cut -d '=' -f 2 | tr -d ' '` + VALID="1" + for i in ${2} + do + if [ "$VAL" = "${i}" ] + then + VALID="0" + fi + done + if [ "$VALID" = "1" ] + then + exit_err "Error: ${1} is set to unknown value $VAL" + fi + else + exit_err "Error: Did we forgot to supply a string to parse and setting to grab?" + fi +}; + +# Checks for the presense of the supplied arguements in the config file +# 1 = values to confirm exist +file_sanity_check() +{ + if [ ! -z "$CFGF" -a ! -z "$1" ] + then + for i in $1 + do + grep "^${i}=" $CFGF >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + LN=`grep "^${i}=" ${CFGF} | head -n 1 | cut -d '=' -f 2 | tr -d ' '` + if [ -z "${LN}" ] + then + echo "Error: Config fails sanity test! ${i}= is empty" + exit 1 + fi + else + echo "Error: Config fails sanity test! Missing ${i}=" + exit 1 + fi + done + else + echo "Error: Missing config file, and / or values to sanity check for!" + exit 1 + fi +}; + + +# Function which merges the contents of a new config into the specified old one +# Only works with <val>= type configurations +merge_config() +{ + OLDCFG="${1}" + NEWCFG="${2}" + FINALCFG="${3}" + + # Copy our oldcfg to the new one, which will be used as basis + cp ${OLDCFG} ${FINALCFG} + + # Remove blank lines from new file + cat ${NEWCFG} | sed '/^$/d' > ${FINALCFG}.tmp + + # Set our marker if we've found any + FOUNDMERGE="NO" + + while read newline + do + echo ${newline} | grep "^#" >/dev/null 2>/dev/null + if [ "$?" != "0" ] ; then + VAL="`echo ${newline} | cut -d '=' -f 1`" + cat ${OLDCFG} | grep ${VAL} >/dev/null 2>/dev/null + if [ "$?" != "0" ] ; then + if [ "${FOUNDMERGE}" = "NO" ] ; then + echo "" >> ${FINALCFG} + echo "# Auto-merged values from newer ${NEWCFG}" >> ${FINALCFG} + FOUNDMERGE="YES" + fi + echo "${newline}" >> ${FINALCFG} + fi + fi + done < ${FINALCFG}.tmp + rm ${FINALCFG}.tmp + +}; + +# Loop to check for a specified mount-point in a list +check_for_mount() +{ + MNTS="${1}" + FINDMNT="${2}" + + # Check if we found a valid root partition + for CHECKMNT in `echo ${MNTS} | sed 's|,| |g'` + do + if [ "${CHECKMNT}" = "${FINDMNT}" ] ; then + return 0 + fi + done + + return 1 +}; + +# Function which returns the next line in the specified config file +get_next_cfg_line() +{ + CURFILE="$1" + CURLINE="$2" + + FOUND="1" + + while read line + do + if [ "$FOUND" = "0" ] ; then + VAL="$line" ; export VAL + return + fi + if [ "$line" = "${CURLINE}" ] ; then + FOUND="0" + fi + done <${CURFILE} + + # Got here, couldn't find this line or at end of file, set VAL to "" + VAL="" ; export VAL +}; diff --git a/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-runcommands.sh.svn-base b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-runcommands.sh.svn-base new file mode 100644 index 0000000..307119d --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-runcommands.sh.svn-base @@ -0,0 +1,76 @@ +#!/bin/sh +# Functions which runs commands on the system + +. ${BACKEND}/functions.sh +. ${BACKEND}/functions-parse.sh + +run_chroot_cmd() +{ + CMD="$@" + echo_log "Running chroot command: ${CMD}" + echo "$CMD" >${FSMNT}/.runcmd.sh + chmod 755 ${FSMNT}/.runcmd.sh + chroot ${FSMNT} sh /.runcmd.sh + rm ${FSMNT}/.runcmd.sh +}; + +run_chroot_script() +{ + SCRIPT="$@" + SBASE=`basename $SCRIPT` + + cp ${SCRIPT} ${FSMNT}/.$SBASE + chmod 755 ${FSMNT}/.${SBASE} + + echo_log "Running chroot script: ${SCRIPT}" + chroot ${FSMNT} /.${SBASE} + + rm ${FSMNT}/.${SBASE} +}; + + +run_ext_cmd() +{ + CMD="$@" + # Make sure to export FSMNT, in case cmd needs it + export FSMNT + echo_log "Running external command: ${CMD}" + echo "${CMD}"> ${TMPDIR}/.runcmd.sh + chmod 755 ${TMPDIR}/.runcmd.sh + sh ${TMPDIR}/.runcmd.sh + rm ${TMPDIR}/.runcmd.sh +}; + + +# Starts the user setup +run_commands() +{ + while read line + do + # Check if we need to run any chroot command + echo $line | grep ^runCommand= >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + get_value_from_string "$line" + run_chroot_cmd "$VAL" + fi + + # Check if we need to run any chroot script + echo $line | grep ^runScript= >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + get_value_from_string "$line" + run_chroot_script "$VAL" + fi + + # Check if we need to run any chroot command + echo $line | grep ^runExtCommand= >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + get_value_from_string "$line" + run_ext_cmd "$VAL" + fi + + done <${CFGF} + +}; diff --git a/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-unmount.sh.svn-base b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-unmount.sh.svn-base new file mode 100644 index 0000000..abd2491 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-unmount.sh.svn-base @@ -0,0 +1,175 @@ +#!/bin/sh +# Functions which unmount all mounted disk filesystems + +# Script that adds our gmirror devices for syncing +start_gmirror_sync() +{ + + cd ${MIRRORCFGDIR} + for DISK in `ls *` + do + MIRRORDISK="`cat ${DISK} | cut -d ':' -f 1`" + MIRRORBAL="`cat ${DISK} | cut -d ':' -f 2`" + MIRRORNAME="`cat ${DISK} | cut -d ':' -f 3`" + + # Start the mirroring service + rc_halt "gmirror insert ${MIRRORNAME} /dev/${MIRRORDISK}" + + done + +}; + +# Unmounts all our mounted file-systems +unmount_all_filesystems() +{ + # Copy the logfile to disk before we unmount + cp ${LOGOUT} ${FSMNT}/root/pc-sysinstall.log + cd / + + # Start by unmounting any ZFS partitions + zfs_cleanup_unmount + + # Lets read our partition list, and unmount each + ################################################################## + for PART in `ls ${PARTDIR}` + do + + PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`" + PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`" + PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`" + PARTLABEL="`cat ${PARTDIR}/${PART} | cut -d ':' -f 4`" + + if [ "${PARTENC}" = "ON" ] + then + EXT=".eli" + else + EXT="" + fi + + #if [ "${PARTFS}" = "SWAP" ] + #then + # rc_nohalt "swapoff /dev/${PART}${EXT}" + #fi + + # Check if we've found "/", and unmount that last + if [ "$PARTMNT" != "/" -a "${PARTMNT}" != "none" -a "${PARTFS}" != "ZFS" ] + then + rc_halt "umount -f /dev/${PART}${EXT}" + + # Re-check if we are missing a label for this device and create it again if so + if [ ! -e "/dev/label/${PARTLABEL}" ] + then + case ${PARTFS} in + UFS) glabel label ${PARTLABEL} /dev/${PART}${EXT} ;; + UFS+S) glabel label ${PARTLABEL} /dev/${PART}${EXT} ;; + UFS+J) glabel label ${PARTLABEL} /dev/${PART}${EXT}.journal ;; + *) ;; + esac + fi + fi + + # Check if we've found "/" and make sure the label exists + if [ "$PARTMNT" = "/" -a "${PARTFS}" != "ZFS" ] + then + if [ ! -e "/dev/label/${PARTLABEL}" ] + then + case ${PARTFS} in + UFS) ROOTRELABEL="glabel label ${PARTLABEL} /dev/${PART}${EXT}" ;; + UFS+S) ROOTRELABEL="glabel label ${PARTLABEL} /dev/${PART}${EXT}" ;; + UFS+J) ROOTRELABEL="glabel label ${PARTLABEL} /dev/${PART}${EXT}.journal" ;; + *) ;; + esac + fi + fi + done + + # Last lets the /mnt partition + ######################################################### + rc_nohalt "umount -f ${FSMNT}" + + # If are using a ZFS on "/" set it to legacy + if [ ! -z "${FOUNDZFSROOT}" ] + then + rc_halt "zfs set mountpoint=legacy ${FOUNDZFSROOT}" + fi + + # If we need to relabel "/" do it now + if [ ! -z "${ROOTRELABEL}" ] + then + ${ROOTRELABEL} + fi + + # Unmount our CDMNT + rc_nohalt "umount -f ${CDMNT}" + + # Check if we need to run any gmirror syncing + ls ${MIRRORCFGDIR}/* >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + # Lets start syncing now + start_gmirror_sync + fi + + # Import any pools, so they are active at shutdown and ready to boot potentially + zpool import -a + +}; + +# Unmounts any filesystems after a failure +unmount_all_filesystems_failure() +{ + cd / + + # if we did a fresh install, start unmounting + if [ "${INSTALLMODE}" = "fresh" ] + then + + # Lets read our partition list, and unmount each + ################################################################## + if [ -d "${PARTDIR}" ] + then + for PART in `ls ${PARTDIR}` + do + + PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`" + PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`" + PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`" + + #if [ "${PARTFS}" = "SWAP" ] + #then + # if [ "${PARTENC}" = "ON" ] + # then + # rc_nohalt "swapoff /dev/${PART}.eli" + # else + # rc_nohalt "swapoff /dev/${PART}" + # fi + #fi + + # Check if we've found "/" again, don't need to mount it twice + if [ "$PARTMNT" != "/" -a "${PARTMNT}" != "none" -a "${PARTFS}" != "ZFS" ] + then + rc_nohalt "umount -f /dev/${PART}" + rc_nohalt "umount -f ${FSMNT}${PARTMNT}" + fi + done + + # Last lets the /mnt partition + ######################################################### + rc_nohalt "umount -f ${FSMNT}" + + fi + else + # We are doing a upgrade, try unmounting any of these filesystems + chroot ${FSMNT} /sbin/umount -a >>${LOGOUT} >>${LOGOUT} + umount -f ${FSMNT}/usr >>${LOGOUT} 2>>${LOGOUT} + umount -f ${FSMNT}/dev >>${LOGOUT} 2>>${LOGOUT} + umount -f ${FSMNT} >>${LOGOUT} 2>>${LOGOUT} + rc_nohalt "sh ${TMPDIR}/.upgrade-unmount" + fi + + # Unmount our CDMNT + rc_nohalt "umount ${CDMNT}" + + # Import any pools, so they are active at shutdown and ready to boot potentially + zpool import -a +}; diff --git a/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-upgrade.sh.svn-base b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-upgrade.sh.svn-base new file mode 100644 index 0000000..08f80e7 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-upgrade.sh.svn-base @@ -0,0 +1,259 @@ +#!/bin/sh +# Functions which perform the mounting / unmount for upgrades + + +mount_target_slice() +{ + MPART="${1}" + + # Import any zpools + zpool import -a + + # Set a variable of files we want to make backups of before doing upgrade + BKFILES="/etc/rc.conf /boot/loader.conf" + + if [ -e "/dev/${MPART}a.journal" ] + then + rc_halt "mount /dev/${MPART}.journal ${FSMNT}" + elif [ -e "/dev/${MPART}a" ] + then + mount /dev/${MPART}a ${FSMNT} + if [ "$?" != "0" ] + then + # Try ZFS on this slice + mount -t zfs ${MPART}a ${FSMNT} + if [ "${?}" != "0" ] + then + exit_err "Failed to mount ${MPART}" + fi + fi + fi + + mount -t devfs devfs ${FSMNT}/dev + chroot ${FSMNT} /sbin/mount -a >>${LOGOUT} 2>>${LOGOUT} + chroot ${FSMNT} umount /proc >/dev/null 2>/dev/null + chroot ${FSMNT} umount /compat/linux/proc >/dev/null 2>/dev/null + + # Save which partition was mounted, so we may unmount it later + echo "umount -f /dev/${MPART}a" >>${TMPDIR}/.upgrade-unmount + + # Now before we start the upgrade, make sure we set our noschg flags + echo_log "Cleaning up old filesystem... Please wait..." + rc_halt "chflags -R noschg ${FSMNT}" + + # Make backup copies of some files + for i in ${BKFILES} + do + cp ${FSMNT}${i} ${FSMNT}${i}.preUpgrade >/dev/null 2>/dev/null + done + + # Remove some old dirs + rm -rf ${FSMNT}/etc/rc.d >/dev/null 2>/dev/null + + # If we are doing PC-BSD install, lets cleanup old pkgs on disk + if [ "$INSTALLTYPE" != "FreeBSD" ] + then + echo_log "Removing old packages, this may take a while... Please wait..." + echo '#/bin/sh +for i in `pkg_info -E \*` +do + echo "Uninstalling package: ${i}" + pkg_delete -f ${i} >/dev/null 2>/dev/null +done +' >${FSMNT}/.cleanPkgs.sh + chmod 755 ${FSMNT}/.cleanPkgs.sh + chroot ${FSMNT} /.cleanPkgs.sh + rm ${FSMNT}/.cleanPkgs.sh + run_chroot_cmd "pkg_delete -f \*" >/dev/null 2>/dev/null + run_chroot_cmd "rm -rf /usr/PCBSD" >/dev/null 2>/dev/null + run_chroot_cmd "rm -rf /PCBSD" >/dev/null 2>/dev/null + run_chroot_cmd "rm -rf /var/db/pkgs" >/dev/null 2>/dev/null + run_chroot_cmd "rm -rf /usr/local32" >/dev/null 2>/dev/null + run_chroot_cmd "rm -rf /usr/sbin" >/dev/null 2>/dev/null + run_chroot_cmd "rm -rf /usr/lib" >/dev/null 2>/dev/null + run_chroot_cmd "rm -rf /usr/bin" >/dev/null 2>/dev/null + run_chroot_cmd "rm -rf /boot/kernel" >/dev/null 2>/dev/null + run_chroot_cmd "rm -rf /sbin" >/dev/null 2>/dev/null + run_chroot_cmd "rm -rf /bin" >/dev/null 2>/dev/null + run_chroot_cmd "rm -rf /lib" >/dev/null 2>/dev/null + run_chroot_cmd "rm -rf /libexec" >/dev/null 2>/dev/null + fi + +} + +# Mount the target upgrade partitions +mount_upgrade() +{ + + # Start with disk0 + disknum="0" + + # Make sure we remove the old upgrade-mount script + rm -rf ${TMPDIR}/.upgrade-unmount >/dev/null 2>/dev/null + + # We are ready to start mounting, lets read the config and do it + while read line + do + echo $line | grep "^disk${disknum}=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + + # Found a disk= entry, lets get the disk we are working on + get_value_from_string "${line}" + strip_white_space "$VAL" + DISK="$VAL" + + # Before we go further, lets confirm this disk really exists + if [ ! -e "/dev/${DISK}" ] + then + exit_err "ERROR: The disk ${DISK} does not exist!" + fi + fi + + echo $line | grep "^partition=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + # Found a partition= entry, lets read / set it + get_value_from_string "${line}" + strip_white_space "$VAL" + PTYPE="$VAL" + + # We are using free space, figure out the slice number + if [ "${PTYPE}" = "free" -o "${PTYPE}" = "all" ] + then + exit_err "ERROR: Invalid upgrade partition=${PTYPE}" + fi + fi + + echo $line | grep "^commitDiskPart" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + # Found our flag to commit this disk setup / lets do sanity check and do it + if [ ! -z "${DISK}" -a ! -z "${PTYPE}" ] + then + case ${PTYPE} in + s1|s2|s3|s4) tmpSLICE="${DISK}${PTYPE}a" ;; + *) exit_err "ERROR: Unknown PTYPE: $PTYPE" ;; + esac + + if [ ! -e "/dev/${tmpSLICE}" ] + then + exit_err "ERROR: /dev/${tmpSLICE} does not exist! Mount failed!" + fi + + # Start mounting this slice + mount_target_slice "${DISK}${PTYPE}" + + # Increment our disk counter to look for next disk and unset + unset PTYPE DISK + disknum="`expr $disknum + 1`" + else + exit_err "ERROR: commitDiskPart was called without procceding disk<num>= and partition= entries!!!" + fi + fi + + done <${CFGF} + +}; + +copy_skel_files_upgrade() +{ + + # Now make sure we fix any user profile scripts, which cause problems from 7.x->8.x + echo '#!/bin/sh + +cd /home +for i in `ls` +do + + # Backup the old profile dirs + if [ -d "${i}" ] + then + mv /home/${i}/.kde4 /home/${i}/.kde4.preUpgrade >/dev/null 2>/dev/null + mv /home/${i}/.kde /home/${i}/.kde.preUpgrade >/dev/null 2>/dev/null + mv /home/${i}/.fluxbox /home/${i}/.fluxbox.preUpgrade >/dev/null 2>/dev/null + + # Copy over the skel directories + tar cv --exclude "./dot.*" -f - -C /usr/share/skel . 2>/dev/null | tar xvf - -C /home/${i} 2>/dev/null + + for j in `ls /usr/share/skel/dot*` + do + dname=`echo ${j} | sed s/dot//` + cp /usr/share/skel/${j} /home/${i}/${dname} + done + + chown -R ${i}:${i} /home/${i} + fi + +done +' >${FSMNT}/.fixUserProfile.sh + chmod 755 ${FSMNT}/.fixUserProfile.sh + chroot ${FSMNT} /.fixUserProfile.sh >/dev/null 2>/dev/null + rm ${FSMNT}/.fixUserProfile.sh + + + + # if the user wants to keep their original .kde4 profile + ########################################################################### + get_value_from_cfg "upgradeKeepDesktopProfile" + if [ "$VAL" = "YES" -o "$VAL" = "yes" ] ; then + echo '#!/bin/sh + cd /home +for i in `ls` +do + # Import the old config again + if [ -d "${i}/.kde4.preUpgrade" ] + then + # Copy over the skel directories + tar cv -f - -C /home/${i}/.kde4.preUpgrade . 2>/dev/null | tar xvf - -C /home/${i}/.kde4 2>/dev/null + chown -R ${i}:${i} /home/${i}/.kde4 + fi +done +' >${FSMNT}/.fixUserProfile.sh + chmod 755 ${FSMNT}/.fixUserProfile.sh + chroot ${FSMNT} /.fixUserProfile.sh >/dev/null 2>/dev/null + rm ${FSMNT}/.fixUserProfile.sh + + fi + +}; + +# Function which merges some configuration files with the new defaults +merge_old_configs() +{ + + # Merge the loader.conf with old + cp ${FSMNT}/boot/loader.conf ${FSMNT}/boot/loader.conf.new + merge_config "${FSMNT}/boot/loader.conf.preUpgrade" "${FSMNT}/boot/loader.conf.new" "${FSMNT}/boot/loader.conf" + rm ${FSMNT}/boot/loader.conf.new + + # Merge the rc.conf with old + cp ${FSMNT}/etc/rc.conf ${FSMNT}/etc/rc.conf.new + merge_config "${FSMNT}/etc/rc.conf.preUpgrade" "${FSMNT}/etc/rc.conf.new" "${FSMNT}/etc/rc.conf" + rm ${FSMNT}/etc/rc.conf.new + +}; + +# Function which unmounts all the mounted file-systems +unmount_upgrade() +{ + + # If on PC-BSD, make sure we copy any fixed skel files + if [ "$INSTALLTYPE" != "FreeBSD" ] ; then + copy_skel_files_upgrade + fi + + cd / + + # Unmount FS + chroot ${FSMNT} /sbin/umount -a >/dev/null 2>/dev/null + umount ${FSMNT}/usr >/dev/null 2>/dev/null + umount ${FSMNT}/var >/dev/null 2>/dev/null + umount ${FSMNT}/dev >/dev/null 2>/dev/null + umount ${FSMNT} >/dev/null 2>/dev/null + + # Run our saved unmount script for these file-systems + rc_nohalt "sh ${TMPDIR}/.upgrade-unmount" + + umount ${CDMNT} +}; diff --git a/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-users.sh.svn-base b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-users.sh.svn-base new file mode 100644 index 0000000..e413807 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions-users.sh.svn-base @@ -0,0 +1,149 @@ +#!/bin/sh +# Functions which runs commands on the system + +. ${BACKEND}/functions.sh +. ${BACKEND}/functions-parse.sh + + +# Function which checks and sets up auto-login for a user if specified +check_autologin() +{ + get_value_from_cfg autoLoginUser + if [ ! -z "${VAL}" -a "${INSTALLTYPE}" = "PCBSD" ] + then + AUTOU="${VAL}" + # Add the auto-login user line + sed -i.bak "s/AutoLoginUser=/AutoLoginUser=${AUTOU}/g" ${FSMNT}/usr/local/kde4/share/config/kdm/kdmrc + + # Add the auto-login user line + sed -i.bak "s/AutoLoginEnable=false/AutoLoginEnable=true/g" ${FSMNT}/usr/local/kde4/share/config/kdm/kdmrc + + fi +}; + +# Function which actually runs the adduser command on the filesystem +add_user() +{ + ARGS="${1}" + + if [ -e "${FSMNT}/.tmpPass" ] + then + # Add a user with a supplied password + run_chroot_cmd "cat /.tmpPass | pw useradd ${ARGS}" + rc_halt "rm ${FSMNT}/.tmpPass" + else + # Add a user with no password + run_chroot_cmd "cat /.tmpPass | pw useradd ${ARGS}" + fi + +}; + +# Function which reads in the config, and adds any users specified +setup_users() +{ + + # We are ready to start setting up the users, lets read the config + while read line + do + + echo $line | grep "^userName=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + get_value_from_string "${line}" + USERNAME="$VAL" + fi + + echo $line | grep "^userComment=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + get_value_from_string "${line}" + USERCOMMENT="$VAL" + fi + + echo $line | grep "^userPass=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + get_value_from_string "${line}" + USERPASS="$VAL" + fi + + echo $line | grep "^userShell=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + get_value_from_string "${line}" + strip_white_space "$VAL" + USERSHELL="$VAL" + fi + + echo $line | grep "^userHome=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + get_value_from_string "${line}" + USERHOME="$VAL" + fi + + echo $line | grep "^userGroups=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + get_value_from_string "${line}" + USERGROUPS="$VAL" + fi + + + echo $line | grep "^commitUser" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + # Found our flag to commit this user, lets check and do it + if [ ! -z "${USERNAME}" ] + then + + # Now add this user to the system, by building our args list + ARGS="-n ${USERNAME}" + + if [ ! -z "${USERCOMMENT}" ] + then + ARGS="${ARGS} -c \"${USERCOMMENT}\"" + fi + + if [ ! -z "${USERPASS}" ] + then + ARGS="${ARGS} -h 0" + echo "${USERPASS}" >${FSMNT}/.tmpPass + else + ARGS="${ARGS} -h -" + rm ${FSMNT}/.tmpPass 2>/dev/null 2>/dev/null + fi + + if [ ! -z "${USERSHELL}" ] + then + ARGS="${ARGS} -s \"${USERSHELL}\"" + else + ARGS="${ARGS} -s \"/nonexistant\"" + fi + + if [ ! -z "${USERHOME}" ] + then + ARGS="${ARGS} -m -d \"${USERHOME}\"" + fi + + if [ ! -z "${USERGROUPS}" ] + then + ARGS="${ARGS} -G \"${USERGROUPS}\"" + fi + + add_user "${ARGS}" + + # Unset our vars before looking for any more users + unset USERNAME USERCOMMENT USERPASS USERSHELL USERHOME USERGROUPS + else + exit_err "ERROR: commitUser was called without any userName= entry!!!" + fi + fi + + done <${CFGF} + + + # Check if we need to enable a user to auto-login to the desktop + check_autologin + +}; diff --git a/PCBSD/pc-sysinstall/backend/.svn/text-base/functions.sh.svn-base b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions.sh.svn-base new file mode 100644 index 0000000..a4975c3 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/.svn/text-base/functions.sh.svn-base @@ -0,0 +1,249 @@ +#!/bin/sh +# functions.sh +# Library of functions which pc-sysinstall may call upon + +# Function which displays the help-index file +display_help() +{ + if [ -e "${PROGDIR}/doc/help-index" ] + then + cat ${PROGDIR}/doc/help-index + else + echo "Error: ${PROGDIR}/doc/help-index not found" + exit 1 + fi +}; + +# Function which displays the help for a specified command +display_command_help() +{ + if [ -z "$1" ] + then + echo "Error: No command specified to display help for" + exit 1 + fi + + if [ -e "${PROGDIR}/doc/help-${1}" ] + then + cat ${PROGDIR}/doc/help-${1} + else + echo "Error: ${PROGDIR}/doc/help-${1} not found" + exit 1 + fi +}; + +# Function to convert bytes to megabytes +convert_byte_to_megabyte() +{ + if [ -z "${1}" ] + then + echo "Error: No bytes specified!" + exit 1 + fi + + expr -e ${1} / 1048576 +}; + +# Function to convert blocks to megabytes +convert_blocks_to_megabyte() +{ + if [ -z "${1}" ] ; then + echo "Error: No blocks specified!" + exit 1 + fi + + expr -e ${1} / 2048 +}; + +# Takes $1 and strips the whitespace out of it, returns VAL +strip_white_space() +{ + if [ -z "${1}" ] + then + echo "Error: No value setup to strip whitespace from!" + + exit 1 + fi + + VAL=`echo "$1" | tr -d ' '` + export VAL +}; + +# Displays an error message and exits with error 1 +exit_err() +{ + # Echo the message for the users benefit + echo "$1" + + # Save this error to the log file + echo "${1}" >>$LOGOUT + + # Check if we need to unmount any file-systems after this failure + unmount_all_filesystems_failure + + echo "For more details see log file: $LOGOUT" + + exit 1 +}; + +# Run-command, don't halt if command exits with non-0 +rc_nohalt() +{ + CMD="$1" + + if [ -z "${CMD}" ] + then + exit_err "Error: missing argument in rc_nohalt()" + fi + + echo "Running: ${CMD}" >>${LOGOUT} + ${CMD} >>${LOGOUT} 2>>${LOGOUT} + +}; + +# Run-command, halt if command exits with non-0 +rc_halt() +{ + CMD="$1" + + if [ -z "${CMD}" ] + then + exit_err "Error: missing argument in rc_halt()" + fi + + echo "Running: ${CMD}" >>${LOGOUT} + ${CMD} >>${LOGOUT} 2>>${LOGOUT} + STATUS="$?" + if [ "${STATUS}" != "0" ] + then + exit_err "Error ${STATUS}: ${CMD}" + fi +}; + +# Run-command w/echo to screen, halt if command exits with non-0 +rc_halt_echo() +{ + CMD="$1" + + if [ -z "${CMD}" ] + then + exit_err "Error: missing argument in rc_halt_echo()" + fi + + echo "Running: ${CMD}" >>${LOGOUT} + ${CMD} 2>&1 | tee -a ${LOGOUT} + STATUS="$?" + if [ "$STATUS" != "0" ] + then + exit_err "Error ${STATUS}: $CMD" + fi + +}; + +# Run-command w/echo, don't halt if command exits with non-0 +rc_nohalt_echo() +{ + CMD="$1" + + if [ -z "${CMD}" ] + then + exit_err "Error: missing argument in rc_nohalt_echo()" + fi + + echo "Running: ${CMD}" >>${LOGOUT} + ${CMD} 2>&1 | tee -a ${LOGOUT} + +}; + +# Echo to the screen and to the log +echo_log() +{ + STR="$1" + + if [ -z "${STR}" ] + then + exit_err "Error: missing argument in echo_log()" + fi + + echo "${STR}" | tee -a ${LOGOUT} +}; + +# Function which uses "fetch" to download a file, and display a progress report +fetch_file() +{ + +FETCHFILE="$1" +FETCHOUTFILE="$2" +EXITFAILED="$3" + +SIZEFILE="${TMPDIR}/.fetchSize" +EXITFILE="${TMPDIR}/.fetchExit" + +rm ${SIZEFILE} 2>/dev/null >/dev/null +rm ${FETCHOUTFILE} 2>/dev/null >/dev/null + +fetch -s "${FETCHFILE}" >${SIZEFILE} +SIZE="`cat ${SIZEFILE}`" +SIZE="`expr ${SIZE} / 1024`" +echo "FETCH: ${FETCHFILE}" +echo "FETCH: ${FETCHOUTFILE}" >>${LOGOUT} + +( fetch -o ${FETCHOUTFILE} "${FETCHFILE}" >/dev/null 2>/dev/null ; echo "$?" > ${EXITFILE} ) & +PID="$!" +while +z=1 +do + + if [ -e "${FETCHOUTFILE}" ] + then + DSIZE=`du -k ${FETCHOUTFILE} | tr -d '\t' | cut -d '/' -f 1` + echo "SIZE: ${SIZE} DOWNLOADED: ${DSIZE}" + echo "SIZE: ${SIZE} DOWNLOADED: ${DSIZE}" >>${LOGOUT} + fi + + # Check if the download is finished + ps -p ${PID} >/dev/null 2>/dev/null + if [ "$?" != "0" ] + then + break; + fi + + sleep 2 +done + +echo "FETCHDONE" + +EXIT="`cat ${EXITFILE}`" +if [ "${EXIT}" != "0" -a "$EXITFAILED" = "1" ] +then + exit_err "Error: Failed to download ${FETCHFILE}" +fi + +return $EXIT + +}; + +# Function to return a the zpool name for this device +get_zpool_name() +{ + DEVICE="$1" + + # Set the base name we use for zpools + BASENAME="tank" + + if [ ! -d "${TMPDIR}/.zpools" ] ; then + mkdir -p ${TMPDIR}/.zpools + fi + + if [ -e "${TMPDIR}/.zpools/${DEVICE}" ] ; then + cat ${TMPDIR}/.zpools/${DEVICE} + return 0 + else + # Need to generate a zpool name for this device + NUM=`ls ${TMPDIR}/.zpools/ | wc -l | sed 's| ||g'` + NEWNAME="${BASENAME}${NUM}" + echo "$NEWNAME" >${TMPDIR}/.zpools/${DEVICE} + echo "${NEWNAME}" + return + fi +}; diff --git a/PCBSD/pc-sysinstall/backend/.svn/text-base/parseconfig.sh.svn-base b/PCBSD/pc-sysinstall/backend/.svn/text-base/parseconfig.sh.svn-base new file mode 100644 index 0000000..9bf92b8 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/.svn/text-base/parseconfig.sh.svn-base @@ -0,0 +1,138 @@ +#!/bin/sh +# Main install configuration parsing script +# + +# Source our functions scripts +. ${BACKEND}/functions.sh +. ${BACKEND}/functions-bsdlabel.sh +. ${BACKEND}/functions-cleanup.sh +. ${BACKEND}/functions-disk.sh +. ${BACKEND}/functions-extractimage.sh +. ${BACKEND}/functions-installcomponents.sh +. ${BACKEND}/functions-localize.sh +. ${BACKEND}/functions-mountdisk.sh +. ${BACKEND}/functions-networking.sh +. ${BACKEND}/functions-newfs.sh +. ${BACKEND}/functions-parse.sh +. ${BACKEND}/functions-runcommands.sh +. ${BACKEND}/functions-unmount.sh +. ${BACKEND}/functions-upgrade.sh +. ${BACKEND}/functions-users.sh + +# Check that the config file exists +if [ ! -e "${1}" ] +then + echo "ERROR: Install configuration $1 does not exist!" + exit 1 +fi + +# Set our config file variable +CFGF="$1" + +# Check the dirname of the provided CFGF and make sure its a full path +DIR="`dirname ${CFGF}`" +if [ "${DIR}" = "." ] +then + CFGF="`pwd`/${CFGF}" +fi +export CFGF + +# Start by doing a sanity check, which will catch any obvious mistakes in the config +file_sanity_check "installMode disk0 partition bootManager installType installMedium packageType" + +# We passed the Sanity check, lets grab some of the universal config settings and store them +check_value installMode "fresh upgrade" +check_value bootManager "bsd none" +check_value installType "PCBSD FreeBSD" +check_value installMedium "dvd usb ftp rsync" +check_value packageType "uzip tar rsync split" +check_value partition "all ALL s1 s2 s3 s4 free FREE" +if_check_value_exists mirrorbal "load prefer round-robin split" + +# We passed all sanity checks! Yay, lets start the install +echo "File Sanity Check -> OK" + +# Lets load the various universal settings now +get_value_from_cfg installMode +INSTALLMODE="${VAL}" ; export INSTALLMODE + +get_value_from_cfg installType +INSTALLTYPE="${VAL}" ; export INSTALLTYPE + +get_value_from_cfg installMedium +INSTALLMEDIUM="${VAL}" ; export INSTALLMEDIUM + +get_value_from_cfg packageType +PACKAGETYPE="${VAL}" ; export PACKAGETYPE + +# Check if we are doing any networking setup +start_networking + +# If we are not doing an upgrade, lets go ahead and setup the disk +if [ "${INSTALLMODE}" = "fresh" ] +then + + # Lets start setting up the disk slices now + setup_disk_slice + + # Disk setup complete, now lets parse WORKINGSLICES and setup the bsdlabels + setup_disk_label + + # Now we've setup the bsdlabels, lets go ahead and run newfs / zfs + # to setup the filesystems + setup_filesystems + + # Lets mount the partitions now + mount_all_filesystems + + # We are ready to begin extraction, lets start now + init_extraction + + # Check if we have any optional modules to load + install_components + + # Do any localization in configuration + run_localize + + # Save any networking config on the installed system + save_networking_install + + # Now add any users + setup_users + + # Now run any commands specified + run_commands + + # Do any last cleanup / setup before unmounting + run_final_cleanup + + # Unmount and finish up + unmount_all_filesystems + + echo_log "Installation finished!" + exit 0 + +else + # We're going to do an upgrade, skip all the disk setup + # and start by mounting the target drive/slices + mount_upgrade + + # Start the extraction process + init_extraction + + # Do any localization in configuration + run_localize + + # Now run any commands specified + run_commands + + # Merge any old configuration files + merge_old_configs + + # All finished, unmount the file-systems + unmount_upgrade + + echo_log "Upgrade finished!" + exit 0 +fi + diff --git a/PCBSD/pc-sysinstall/backend/.svn/text-base/startautoinstall.sh.svn-base b/PCBSD/pc-sysinstall/backend/.svn/text-base/startautoinstall.sh.svn-base new file mode 100644 index 0000000..a7103fb --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/.svn/text-base/startautoinstall.sh.svn-base @@ -0,0 +1,111 @@ +#!/bin/sh +# Script which reads the pc-autoinstall.conf directive, and begins the install +# + +# Source our functions scripts +. ${BACKEND}/functions.sh +. ${BACKEND}/functions-networking.sh +. ${BACKEND}/functions-parse.sh + +# Check that the config file exists +if [ ! -e "${1}" ] +then + echo "ERROR: Install configuration $1 does not exist!" + exit 1 +fi + +# Set our config file variable +CONF=${1} +INSTALL_CFG="/tmp/pc-sysinstall.cfg" + +# Check if the config file is on disk as well +PCCFG=`grep "pc_config:" ${CONF} | grep -v "^#" | sed "s|pc_config: ||g" | sed "s|pc_config:||g"` +SHUTDOWN_CMD=`grep "shutdown_cmd:" ${CONF} | grep -v "^#" | sed "s|shutdown_cmd: ||g" | sed "s|shutdown_cmd:||g"` +CONFIRM_INS=`grep "confirm_install:" ${CONF} | grep -v "^#" | sed "s|confirm_install: ||g" | sed "s|confirm_install:||g"` + +# Check that this isn't a http / ftp file we need to fetch later +echo "${PCCFG}" | grep -e "^http" -e "^ftp" > /dev/null 2>/dev/null +if [ "$?" != "0" ] +then + # Copy over the install cfg file, if not done already + if [ ! -e "${INSTALL_CFG}" ] + then + cp ${PCCFG} ${INSTALL_CFG} + fi + # Make sure we have the file which was copied into /tmp previously + if [ ! -e "${INSTALL_CFG}" ] + then + echo "Error: ${INSTALL_CFG} is missing! Exiting in 10 seconds..." + sleep 10 + exit 150 + fi +else + # We need to fetch a remote file, check and set any nic options before doing so + NICCFG=`grep "nic_config:" ${CONF} | grep -v "^#" | sed "s|nic_config: ||g" | sed "s|nic_config:||g"` + if [ "${NICCFG}" = "dhcp-all" -o "${NICCFG}" = "DHCP-ALL" ] + then + # Try to auto-enable dhcp on any nics we find + enable_auto_dhcp + else + echo "Running command \"ifconfig ${NICCFG}\"" + ifconfig ${NICCFG} + WRKNIC="`echo ${NICCFG} | cut -d ' ' -f 1`" + NICDNS=`grep "nic_dns:" ${CONF} | grep -v "^#" | sed "s|nic_dns: ||g" | sed "s|nic_dns:||g"` + NICGATE=`grep "nic_gateway:" ${CONF} | grep -v "^#" | sed "s|nic_gateway: ||g" | sed "s|nic_gateway:||g"` + + echo "nameserver ${NICDNS}" >/etc/resolv.conf + + echo "Running command \"route add default ${NICGATE}\"" + route add default ${NICGATE} + fi + + get_nic_mac "$WRKNIC" + nic_mac="${FOUNDMAC}" + + PCCFG=`echo ${PCCFG} | sed "s|%%NIC_MAC%%|${nic_mac}|g"` + + # Now try to fetch the remove file + echo "Fetching cfg with: \"fetch -o ${INSTALL_CFG} ${PCCFG}\"" + fetch -o "${INSTALL_CFG}" "${PCCFG}" + if [ "$?" != "0" ] + then + echo "ERROR: Failed to fetch ${PCCFG}, install aborted" + exit 150 + fi + +fi + +# If we end up with a valid config, lets proccede +if [ -e "${INSTALL_CFG}" ] +then + + if [ "${CONFIRM_INS}" != "no" -a "${CONFIRM_INS}" != "NO" ] + then + echo "Type in 'install' to begin automated installation. Warning: Data on target disks may be destroyed!" + read tmp + case $tmp in + install|INSTALL) ;; + *) echo "Install canceled!" ; exit 150 ;; + esac + fi + + ${PROGDIR}/pc-sysinstall -c ${INSTALL_CFG} + if [ "$?" = "0" ] + then + if [ ! -z "$SHUTDOWN_CMD" ] + then + ${SHUTDOWN_CMD} + else + echo "SUCCESS: Installation finished! Press ENTER to rebooot." + read tmp + shutdown -r now + fi + else + echo "ERROR: Installation failed, press ENTER to drop to shell." + read tmp + /bin/csh + fi +else + echo "ERROR: Failed to get /tmp/pc-sysinstall.cfg for automated install..." + exit 150 +fi diff --git a/PCBSD/pc-sysinstall/backend/functions-bsdlabel.sh b/PCBSD/pc-sysinstall/backend/functions-bsdlabel.sh new file mode 100644 index 0000000..af7813e --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/functions-bsdlabel.sh @@ -0,0 +1,592 @@ +#!/bin/sh +# Functions related to disk operations using bsdlabel + +# Check if we are are provided a geli password on the nextline of the config +check_for_enc_pass() +{ + CURLINE="${1}" + + get_next_cfg_line "${CFGF}" "${CURLINE}" + echo ${VAL} | grep "^encpass=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + # Found a password, return it + get_value_from_string "${VAL}" + return + fi + + VAL="" ; export VAL + return -1 +}; + +# On check on the disk-label line if we have any extra vars for this device +# Only enabled for ZFS devices now, may add other xtra options in future for other FS's +get_fs_line_xvars() +{ + ACTIVEDEV="${1}" + LINE="${2}" + + echo $LINE | grep ' (' >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + + # See if we are looking for ZFS specific options + echo $LINE | grep '^ZFS' >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + ZTYPE="NONE" + ZFSVARS="`echo $LINE | cut -d '(' -f 2- | cut -d ')' -f 1`" + + # Check if we are doing raidz setup + echo $ZFSVARS | grep "^raidz:" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + ZTYPE="raidz" + ZFSVARS="`echo $ZFSVARS | sed 's|raidz: ||g' | sed 's|raidz:||g'`" + fi + + echo $ZFSVARS | grep "^mirror:" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + ZTYPE="mirror" + ZFSVARS="`echo $ZFSVARS | sed 's|mirror: ||g' | sed 's|mirror:||g'`" + _nZFS="" + + # Using mirroring, setup boot partitions on each disk + for i in $ZFSVARS + do + is_disk "$i" + if [ "$?" = "0" ] ; then + init_gpt_full_disk "$i" + rc_halt "gpart add -t freebsd-zfs ${i}" + rc_halt "gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ${i}" + _nZFS="$_nZFS ${i}p2" + else + _nZFS="$_nZFS ${i}" + fi + done + ZFSVARS=`echo "$_nZFS" | tr -s ' '` + fi + + # Return the ZFS options + if [ "${ZTYPE}" = "NONE" ] ; then + VAR="${ACTIVEDEV} ${ZFSVARS}" + else + VAR="${ZTYPE} ${ACTIVEDEV} ${ZFSVARS}" + fi + export VAR + return + fi # End of ZFS block + + + fi # End of xtra-options block + + # If we got here, set VAR to empty and export + VAR="" + export VAR + return +}; + +# Function which creates a unique label name for the specified mount +gen_glabel_name() +{ + MOUNT="$1" + TYPE="$2" + NUM="0" + MAXNUM="20" + + # Check if we are doing /, and rename it + if [ "$MOUNT" = "/" ] + then + NAME="rootfs" + else + # If doing a swap partition, also rename it + if [ "${TYPE}" = "SWAP" ] + then + NAME="swap" + else + NAME="`echo $MOUNT | sed 's|/||g' | sed 's| ||g'`" + fi + fi + + # Loop through and break when we find our first available label + while + Z=1 + do + glabel status | grep "${NAME}${NUM}" >/dev/null 2>/dev/null + if [ "$?" != "0" ] + then + break + else + NUM="`expr ${NUM} + 1`" + fi + + if [ $NUM -gt $MAXNUM ] + then + exit_err "Cannot allocate additional glabel name for $NAME" + break + fi + done + + + VAL="${NAME}${NUM}" + export VAL +}; + +# Function to setup / stamp a legacy MBR bsdlabel +setup_mbr_partitions() +{ + + DISKTAG="$1" + WRKSLICE="$2" + FOUNDPARTS="1" + + + # Lets setup the BSDLABEL + BSDLABEL="${TMPDIR}/bsdLabel-${WRKSLICE}" + export BSDLABEL + rm $BSDLABEL >/dev/null 2>/dev/null + echo "# /dev/${WRKSLICE}" >>$BSDLABEL + echo "8 partitions:" >>$BSDLABEL + echo "# size offset fstype bsize bps/cpg" >>$BSDLABEL + + PARTLETTER="a" + + # Lets read in the config file now and populate this + while read line + do + # Check for data on this slice + echo $line | grep "^${DISKTAG}-part=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + # Found a slice- entry, lets get the slice info + get_value_from_string "${line}" + STRING="$VAL" + FOUNDPARTS="0" + + # We need to split up the string now, and pick out the variables + FS=`echo $STRING | tr -s '\t' ' ' | cut -d ' ' -f 1` + SIZE=`echo $STRING | tr -s '\t' ' ' | cut -d ' ' -f 2` + MNT=`echo $STRING | tr -s '\t' ' ' | cut -d ' ' -f 3` + + # Check if we have a .eli extension on this FS + echo ${FS} | grep ".eli" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + FS="`echo ${FS} | cut -d '.' -f 1`" + ENC="ON" + check_for_enc_pass "${line}" + if [ "${VAL}" != "" ] ; then + # We have a user supplied password, save it for later + ENCPASS="${VAL}" + fi + else + ENC="OFF" + fi + + # Check if the user tried to setup / as an encrypted partition + check_for_mount "${MNT}" "/" + if [ "${?}" = "0" -a "${ENC}" = "ON" ] + then + USINGENCROOT="0" ; export USINGENCROOT + fi + + # Now check that these values are sane + case $FS in + UFS|UFS+S|UFS+J|ZFS|SWAP) ;; + *) exit_err "ERROR: Invalid file system specified on $line" ;; + esac + + # Check that we have a valid size number + expr $SIZE + 1 >/dev/null 2>/dev/null + if [ "$?" != "0" ]; then + exit_err "ERROR: The size specified on $line is invalid" + fi + + # Check that the mount-point starts with / + echo "$MNT" | grep -e "^/" -e "^none" >/dev/null 2>/dev/null + if [ "$?" != "0" ]; then + exit_err "ERROR: The mount-point specified on $line is invalid" + fi + + if [ "$SIZE" = "0" ] + then + SOUT="*" + else + SOUT="${SIZE}M" + fi + + # OK, we passed all tests, now lets put these values into a config + # If the part + if [ "${PARTLETTER}" = "a" ] + then + if [ "$FS" = "SWAP" ] + then + echo "a: ${SOUT} * swap 0 0" >>${BSDLABEL} + else + echo "a: ${SOUT} 0 4.2BSD 0 0" >>${BSDLABEL} + fi + + # Check if we found a valid root partition + check_for_mount "${MNT}" "/" + if [ "$?" = "0" ] ; then + FOUNDROOT="0" ; export FOUNDROOT + fi + + # Check if we have a "/boot" instead + check_for_mount "${MNT}" "/boot" + if [ "${?}" = "0" ] ; then + USINGBOOTPART="0" ; export USINGBOOTPART + if [ "${FS}" != "UFS" -a "${FS}" != "UFS+S" -a "${FS}" != "UFS+J" ] + then + exit_err "/boot partition must be formatted with UFS" + fi + fi + + else + # Done with the a: partitions + + # Check if we found a valid root partition not on a: + check_for_mount "${MNT}" "/" + if [ "${?}" = "0" ] ; then + FOUNDROOT="1" ; export FOUNDROOT + fi + + # Check if we have a /boot partition, and fail since its not first + check_for_mount "${MNT}" "/boot" + if [ "${?}" = "0" ] ; then + exit_err "/boot partition must be first partition" + fi + + + if [ "$FS" = "SWAP" ] + then + echo "${PARTLETTER}: ${SOUT} * swap" >>${BSDLABEL} + else + echo "${PARTLETTER}: ${SOUT} * 4.2BSD" >>${BSDLABEL} + fi + fi + + # Generate a unique label name for this mount + gen_glabel_name "${MNT}" "${FS}" + PLABEL="${VAL}" + + # Get any extra options for this fs / line + get_fs_line_xvars "${WRKSLICE}${PARTLETTER}" "${STRING}" + XTRAOPTS="${VAR}" + + # Save this data to our partition config dir + echo "${FS}:${MNT}:${ENC}:${PLABEL}:MBR:${XTRAOPTS}" >${PARTDIR}/${WRKSLICE}${PARTLETTER} + + # If we have a enc password, save it as well + if [ ! -z "${ENCPASS}" ] ; then + echo "${ENCPASS}" >${PARTDIR}-enc/${WRKSLICE}${PARTLETTER}-encpass + fi + + # This partition letter is used, get the next one + case ${PARTLETTER} in + a) PARTLETTER="b" ;; + b) # When we hit b, add the special c: setup for bsdlabel + echo "c: * * unused" >>${BSDLABEL} + PARTLETTER="d" ;; + d) PARTLETTER="e" ;; + e) PARTLETTER="f" ;; + f) PARTLETTER="g" ;; + g) PARTLETTER="h" ;; + h) PARTLETTER="ERR" ;; + *) exit_err "ERROR: bsdlabel only supports up to letter h for partitions." ;; + esac + + fi # End of subsection locating a slice in config + + echo $line | grep "^commitDiskLabel" >/dev/null 2>/dev/null + if [ "$?" = "0" -a "${FOUNDPARTS}" = "0" ] + then + # Found our flag to commit this label setup, check that we found at least 1 partition and do it + if [ "${PARTLETTER}" != "a" ] + then + # Check if we only had 1 partition, and make sure we add "c:" section to label + if [ "${PARTLETTER}" = "b" ] + then + echo "c: * * unused" >>${BSDLABEL} + fi + + echo "bsdlabel -R -B /dev/${WRKSLICE} ${BSDLABEL}" + bsdlabel -R -B ${WRKSLICE} ${BSDLABEL} + + break + else + exit_err "ERROR: commitDiskLabel was called without any partition entries for it!" + fi + fi + done <${CFGF} +}; + +# Function to setup partitions using gpt +setup_gpt_partitions() +{ + DISKTAG="$1" + DISK="$2" + FOUNDPARTS="1" + + # Lets read in the config file now and setup our GPT partitions + CURPART="2" + while read line + do + # Check for data on this slice + echo $line | grep "^${DISKTAG}-part=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + FOUNDPARTS="0" + # Found a slice- entry, lets get the slice info + get_value_from_string "${line}" + STRING="$VAL" + + # We need to split up the string now, and pick out the variables + FS=`echo $STRING | tr -s '\t' ' ' | cut -d ' ' -f 1` + SIZE=`echo $STRING | tr -s '\t' ' ' | cut -d ' ' -f 2` + MNT=`echo $STRING | tr -s '\t' ' ' | cut -d ' ' -f 3` + + # Check if we have a .eli extension on this FS + echo ${FS} | grep ".eli" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + FS="`echo ${FS} | cut -d '.' -f 1`" + ENC="ON" + check_for_enc_pass "${line}" + if [ "${VAL}" != "" ] ; then + # We have a user supplied password, save it for later + ENCPASS="${VAL}" + fi + else + ENC="OFF" + fi + + # Check if the user tried to setup / as an encrypted partition + check_for_mount "${MNT}" "/" + if [ "${?}" = "0" -a "${ENC}" = "ON" ] + then + USINGENCROOT="0" ; export USINGENCROOT + fi + + # Now check that these values are sane + case $FS in + UFS|UFS+S|UFS+J|ZFS|SWAP) ;; + *) exit_err "ERROR: Invalid file system specified on $line" ;; + esac + + # Check that we have a valid size number + expr $SIZE + 1 >/dev/null 2>/dev/null + if [ "$?" != "0" ]; then + exit_err "ERROR: The size specified on $line is invalid" + fi + + # Check that the mount-point starts with / + echo "$MNT" | grep -e "^/" -e "^none" >/dev/null 2>/dev/null + if [ "$?" != "0" ]; then + exit_err "ERROR: The mount-point specified on $line is invalid" + fi + + if [ "$SIZE" = "0" ] + then + SOUT="" + else + SOUT="-s ${SIZE}M" + fi + + # Check if we found a valid root partition + check_for_mount "${MNT}" "/" + if [ "${?}" = "0" ] ; then + if [ "${CURPART}" = "2" ] ; then + FOUNDROOT="0" ; export FOUNDROOT + else + FOUNDROOT="1" ; export FOUNDROOT + fi + fi + + check_for_mount "${MNT}" "/boot" + if [ "${?}" = "0" ] ; then + if [ "${CURPART}" = "2" ] ; then + USINGBOOTPART="0" ; export USINGBOOTPART + if [ "${FS}" != "UFS" -a "${FS}" != "UFS+S" -a "${FS}" != "UFS+J" ] + then + exit_err "/boot partition must be formatted with UFS" + fi + else + exit_err "/boot partition must be first partition" + fi + fi + + # Generate a unique label name for this mount + gen_glabel_name "${MNT}" "${FS}" + PLABEL="${VAL}" + + # Get any extra options for this fs / line + get_fs_line_xvars "${DISK}p${CURPART}" "${STRING}" + XTRAOPTS="${VAR}" + + # Figure out the gpart type to use + case ${FS} in + ZFS) PARTYPE="freebsd-zfs" ;; + SWAP) PARTYPE="freebsd-swap" ;; + *) PARTYPE="freebsd-ufs" ;; + esac + + # Create the partition + rc_halt "gpart add ${SOUT} -t ${PARTYPE} ${DISK}" + + # Check if this is a root / boot partition, and stamp the right loader + for TESTMNT in `echo ${MNT} | sed 's|,| |g'` + do + if [ "${TESTMNT}" = "/" -a -z "${BOOTTYPE}" ] ; then + BOOTTYPE="${PARTYPE}" + fi + if [ "${TESTMNT}" = "/boot" ] ; then + BOOTTYPE="${PARTYPE}" + fi + done + + # Save this data to our partition config dir + echo "${FS}:${MNT}:${ENC}:${PLABEL}:GPT:${XTRAOPTS}" >${PARTDIR}/${DISK}p${CURPART} + + # Clear out any headers + sleep 2 + dd if=/dev/zero of=${DISK}p${CURPART} count=2048 >/dev/null 2>/dev/null + + # If we have a enc password, save it as well + if [ ! -z "${ENCPASS}" ] ; then + echo "${ENCPASS}" >${PARTDIR}-enc/${DISK}p${CURPART}-encpass + fi + + # Increment our parts counter + CURPART="`expr ${CURPART} + 1`" + + fi # End of subsection locating a slice in config + + echo $line | grep "^commitDiskLabel" >/dev/null 2>/dev/null + if [ "$?" = "0" -a "${FOUNDPARTS}" = "0" ] + then + + # If this is the boot disk, stamp the right gptboot + if [ ! -z "${BOOTTYPE}" ] ; then + case ${BOOTTYPE} in + freebsd-ufs) rc_halt "gpart bootcode -p /boot/gptboot -i 1 ${DISK}" ;; + freebsd-zfs) rc_halt "gpart bootcode -p /boot/gptzfsboot -i 1 ${DISK}" ;; + esac + fi + + + # Found our flag to commit this label setup, check that we found at least 1 partition + if [ "${CURPART}" = "2" ] ; then + exit_err "ERROR: commitDiskLabel was called without any partition entries for it!" + fi + + break + fi + done <${CFGF} +}; + +# Reads through the config and sets up a BSDLabel for the given slice +populate_disk_label() +{ + if [ -z "${1}" ] + then + exit_err "ERROR: populate_disk_label() called without argument!" + fi + + # Set some vars from the given working slice + disk="`echo $1 | cut -d '-' -f 1`" + slicenum="`echo $1 | cut -d '-' -f 2`" + type="`echo $1 | cut -d '-' -f 3`" + + # Set WRKSLICE based upon format we are using + if [ "$type" = "mbr" ] ; then + wrkslice="${disk}s${slicenum}" + fi + if [ "$type" = "gpt" ] ; then + wrkslice="${disk}p${slicenum}" + fi + + if [ -e "${SLICECFGDIR}/${wrkslice}" ] + then + disktag="`cat ${SLICECFGDIR}/${wrkslice}`" + else + exit_err "ERROR: Missing SLICETAG data. This shouldn't happen - please let the developers know" + fi + + # Using Traditional MBR for dual-booting + if [ "$type" = "mbr" ] ; then + setup_mbr_partitions "${disktag}" "${wrkslice}" + fi + + # Using entire disk mode, use GPT for this + if [ "$type" = "gpt" ] ; then + setup_gpt_partitions "${disktag}" "${disk}" + fi + +}; + +# Function which reads in the disk slice config, and performs it +setup_disk_label() +{ + # We are ready to start setting up the label, lets read the config and do the actions + + # First confirm that we have a valid WORKINGSLICES + if [ -z "${WORKINGSLICES}" ]; then + exit_err "ERROR: No slices were setup! Please report this to the maintainers" + fi + + # Check that the slices we have did indeed get setup and gpart worked + for i in $WORKINGSLICES + do + disk="`echo $i | cut -d '-' -f 1`" + pnum="`echo $i | cut -d '-' -f 2`" + type="`echo $i | cut -d '-' -f 3`" + if [ "$type" = "mbr" -a ! -e "/dev/${disk}s${pnum}" ] ; then + exit_err "ERROR: The partition ${i} doesn't exist! gpart failure!" + fi + if [ "$type" = "gpt" -a ! -e "/dev/${disk}p${pnum}" ] ; then + exit_err "ERROR: The partition ${i} doesn't exist! gpart failure!" + fi + done + + # Setup some files which we'll be referring to + LABELLIST="${TMPDIR}/workingLabels" + export LABELLIST + rm $LABELLIST >/dev/null 2>/dev/null + + # Set our flag to determine if we've got a valid root partition in this setup + FOUNDROOT="-1" + export FOUNDROOT + + # Check if we are using a /boot partition + USINGBOOTPART="1" + export USINGBOOTPART + + # Set encryption on root check + USINGENCROOT="1" ; export USINGENCROOT + + # Make the tmp directory where we'll store FS info & mount-points + rm -rf ${PARTDIR} >/dev/null 2>/dev/null + mkdir -p ${PARTDIR} >/dev/null 2>/dev/null + rm -rf ${PARTDIR}-enc >/dev/null 2>/dev/null + mkdir -p ${PARTDIR}-enc >/dev/null 2>/dev/null + + for i in $WORKINGSLICES + do + populate_disk_label "${i}" + done + + # Check if we made a root partition + if [ "$FOUNDROOT" = "-1" ] + then + exit_err "ERROR: No root (/) partition specified!!" + fi + + # Check if we made a root partition + if [ "$FOUNDROOT" = "1" -a "${USINGBOOTPART}" != "0" ] + then + exit_err "ERROR: (/) partition isn't first partition on disk!" + fi + + if [ "${USINGENCROOT}" = "0" -a "${USINGBOOTPART}" != "0" ] + then + exit_err "ERROR: Can't encrypt (/) with no (/boot) partition!" + fi +}; + diff --git a/PCBSD/pc-sysinstall/backend/functions-cleanup.sh b/PCBSD/pc-sysinstall/backend/functions-cleanup.sh new file mode 100644 index 0000000..2c7ffd0 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/functions-cleanup.sh @@ -0,0 +1,386 @@ +#!/bin/sh +# Functions which perform the final cleanup after an install + +# Finishes up with ZFS setup before unmounting +zfs_cleanup_unmount() +{ + # Loop through our FS and see if we have any ZFS partitions to cleanup + for PART in `ls ${PARTDIR}` + do + PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`" + PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`" + ZPOOLNAME=$(get_zpool_name "${PART}") + + if [ "$PARTFS" = "ZFS" ] + then + # Check if we have multiple zfs mounts specified + for ZMNT in `echo ${PARTMNT} | sed 's|,| |g'` + do + if [ "${ZMNT}" = "/" ] + then + # Make sure we haven't already added the zfs boot line when + # Creating a dedicated "/boot" partition + cat ${FSMNT}/boot/loader.conf 2>/dev/null | grep "vfs.root.mountfrom=" >/dev/null 2>/dev/null + if [ "$?" != "0" ] ; then + echo "vfs.root.mountfrom=\"zfs:${ZPOOLNAME}\"" >> ${FSMNT}/boot/loader.conf + fi + FOUNDZFSROOT="${ZPOOLNAME}" ; export FOUNDZFSROOT + fi + done + FOUNDZFS="1" + fi + done + + if [ ! -z "${FOUNDZFS}" ] + then + # Check if we need to add our ZFS flags to rc.conf, src.conf and loader.conf + cat ${FSMNT}/boot/loader.conf 2>/dev/null | grep 'zfs_load="YES"' >/dev/null 2>/dev/null + if [ "$?" != "0" ] + then + echo 'zfs_load="YES"' >>${FSMNT}/boot/loader.conf + fi + cat ${FSMNT}/etc/rc.conf 2>/dev/null | grep 'zfs_enable="YES"' >/dev/null 2>/dev/null + if [ "$?" != "0" ] + then + echo 'zfs_enable="YES"' >>${FSMNT}/etc/rc.conf + fi + + sleep 2 + # Copy over any ZFS cache data + cp /boot/zfs/* ${FSMNT}/boot/zfs/ + + # Copy the hostid so that our zfs cache works + cp /etc/hostid ${FSMNT}/etc/hostid + fi + + # Loop through our FS and see if we have any ZFS partitions to cleanup + for PART in `ls ${PARTDIR}` + do + PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`" + PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`" + PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`" + ZPOOLNAME=$(get_zpool_name "${PART}") + + if [ "$PARTFS" = "ZFS" ] + then + # Check if we have multiple zfs mounts specified + for ZMNT in `echo ${PARTMNT} | sed 's|,| |g'` + do + PARTMNTREV="${ZMNT} ${PARTMNTREV}" + done + + for ZMNT in ${PARTMNTREV} + do + if [ "${ZMNT}" != "/" ] + then + rc_halt "zfs set mountpoint=${ZMNT} ${ZPOOLNAME}${ZMNT}" + rc_halt "zfs unmount ${ZPOOLNAME}${ZMNT}" + sleep 2 + fi + done + fi + done + +}; + +# Function which performs the specific setup for using a /boot partition +setup_dedicated_boot_part() +{ + ROOTFS="${1}" + ROOTFSTYPE="${2}" + BOOTFS="${3}" + BOOTMNT="${4}" + + # Set the root mount in loader.conf + echo "vfs.root.mountfrom=\"${ROOTFSTYPE}:${ROOTFS}\"" >> ${FSMNT}/boot/loader.conf + rc_halt "mkdir -p ${FSMNT}/${BOOTMNT}/boot" + rc_halt "mv ${FSMNT}/boot/* ${FSMNT}${BOOTMNT}/boot/" + rc_halt "mv ${FSMNT}${BOOTMNT}/boot ${FSMNT}/boot/" + rc_halt "umount /dev/${BOOTFS}" + rc_halt "mount /dev/${BOOTFS} ${FSMNT}${BOOTMNT}" + rc_halt "rmdir ${FSMNT}/boot" + + # Strip the '/' from BOOTMNT before making symlink + BOOTMNTNS="`echo ${BOOTMNT} | sed 's|/||g'`" + rc_halt "chroot ${FSMNT} ln -s ${BOOTMNTNS}/boot /boot" + +}; + +# Function which creates the /etc/fstab for the installed system +setup_fstab() +{ + FSTAB="${FSMNT}/etc/fstab" + rm ${FSTAB} >/dev/null 2>/dev/null + + # Create the header + echo "# Device Mountpoint FStype Options Dump Pass" >> ${FSTAB} + + # Loop through the partitions, and start creating /etc/fstab + for PART in `ls ${PARTDIR}` + do + PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`" + PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`" + PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`" + PARTLABEL="`cat ${PARTDIR}/${PART} | cut -d ':' -f 4`" + + DRIVE="`echo ${PART} | rev | cut -b 4- | rev`" + # Check if this device is being mirrored + if [ -e "${MIRRORCFGDIR}/${DRIVE}" ] + then + # This device is apart of a gmirror, lets reset PART to correct value + MDRIVE="mirror/`cat ${MIRRORCFGDIR}/${DRIVE} | cut -d ':' -f 3`" + TMP="`echo ${PART} | rev | cut -b -3 | rev`" + PART="${MDRIVE}${TMP}" + PARTLABEL="" + fi + + # Unset EXT + EXT="" + + # Figure out if we are using a glabel, or the raw name for this entry + if [ ! -z "${PARTLABEL}" ] + then + DEVICE="label/${PARTLABEL}" + else + # Check if using encryption + if [ "${PARTENC}" = "ON" ] ; then + EXT=".eli" + fi + + if [ "${PARTFS}" = "UFS+J" ] ; then + EXT="${EXT}.journal" + fi + DEVICE="${PART}${EXT}" + fi + + + # Set our ROOTFSTYPE for loader.conf if necessary + check_for_mount "${PARTMNT}" "/" + if [ "$?" = "0" ] ; then + if [ "${PARTFS}" = "ZFS" ] ; then + ROOTFSTYPE="zfs" + XPOOLNAME=$(get_zpool_name "${PART}") + ROOTFS="${ZPOOLNAME}" + else + ROOTFS="${DEVICE}" + ROOTFSTYPE="ufs" + fi + fi + + # Only create non-zfs partitions + if [ "${PARTFS}" != "ZFS" ] + then + + # Make sure geom_journal is loaded + if [ "${PARTFS}" = "UFS+J" ] ; then + setup_gjournal + fi + + # Save the BOOTFS for call at the end + if [ "${PARTMNT}" = "/boot" ] ; then + BOOTFS="${PART}${EXT}" + BOOTMNT="${BOOT_PART_MOUNT}" + PARTMNT="${BOOTMNT}" + fi + + # Echo out the fstab entry now + if [ "${PARTFS}" = "SWAP" ] + then + echo "/dev/${DEVICE} none swap sw 0 0" >> ${FSTAB} + else + echo "/dev/${DEVICE} ${PARTMNT} ufs rw,noatime 1 1" >> ${FSTAB} + fi + + fi # End of ZFS Check + done + + # Setup some specific PC-BSD fstab options + if [ "$INSTALLTYPE" != "FreeBSD" ] + then + echo "procfs /proc procfs rw 0 0" >> ${FSTAB} + echo "linprocfs /compat/linux/proc linprocfs rw 0 0" >> ${FSTAB} + echo "tmpfs /tmp tmpfs rw,mode=1777 0 0" >> ${FSTAB} + fi + + # If we have a dedicated /boot, run the post-install setup of it now + if [ ! -z "${BOOTMNT}" ] ; then + setup_dedicated_boot_part "${ROOTFS}" "${ROOTFSTYPE}" "${BOOTFS}" "${BOOTMNT}" + fi + +}; + +# Setup our disk mirroring with gmirror +setup_gmirror() +{ + NUM="0" + + cd ${MIRRORCFGDIR} + for DISK in `ls *` + do + MIRRORDISK="`cat ${DISK} | cut -d ':' -f 1`" + MIRRORBAL="`cat ${DISK} | cut -d ':' -f 2`" + + # Create this mirror device + gmirror label -vb $MIRRORBAL gm${NUM} /dev/${DISK} + + sleep 3 + + # Save the gm<num> device in our config + echo "${MIRRORDISK}:${MIRRORBAL}:gm${NUM}" > ${DISK} + + sleep 3 + + NUM="`expr ${NUM} + 1`" + done + + + cat ${FSMNT}/boot/loader.conf 2>/dev/null | grep 'geom_mirror_load="YES"' >/dev/null 2>/dev/null + if [ "$?" != "0" ] + then + echo 'geom_mirror_load="YES"' >>${FSMNT}/boot/loader.conf + fi + +}; + +# Function which saves geli keys and sets up loading of them at boot +setup_geli_loading() +{ + + # Make our keys dir + mkdir -p ${FSMNT}/boot/keys >/dev/null 2>/dev/null + + cd ${GELIKEYDIR} + for KEYFILE in `ls *` + do + # Figure out the partition name based on keyfile name removing .key + PART="`echo ${KEYFILE} | cut -d '.' -f 1`" + + # Add the entries to loader.conf to start this geli provider at boot + echo "geli_${PART}_keyfile0_load=\"YES\"" >> ${FSMNT}/boot/loader.conf + echo "geli_${PART}_keyfile0_type=\"${PART}:geli_keyfile0\"" >> ${FSMNT}/boot/loader.conf + echo "geli_${PART}_keyfile0_name=\"/boot/keys/${KEYFILE}\"" >> ${FSMNT}/boot/loader.conf + + # If we have a passphrase, set it up now + if [ -e "${PARTDIR}-enc/${PART}-encpass" ] ; then + cat ${PARTDIR}-enc/${PART}-encpass | geli setkey -S -n 0 -p -k ${KEYFILE} -K ${KEYFILE} ${PART} + geli configure -b ${PART} + fi + + # Copy the key to the disk + cp ${KEYFILE} ${FSMNT}/boot/keys/${KEYFILE} + done + + # Make sure we have geom_eli set to load at boot + cat ${FSMNT}/boot/loader.conf 2>/dev/null | grep 'geom_eli_load="YES"' >/dev/null 2>/dev/null + if [ "$?" != "0" ] + then + echo 'geom_eli_load="YES"' >>${FSMNT}/boot/loader.conf + fi + +}; + + +# Function to generate a random hostname if none was specified +gen_hostname() +{ + RAND="`jot -r 1 1 9000`" + + if [ "$INSTALLTYPE" = "FreeBSD" ] + then + VAL="freebsd-${RAND}" + else + VAL="pcbsd-${RAND}" + fi + + export VAL + +}; + +# Function which sets up the hostname for the system +setup_hostname() +{ + + get_value_from_cfg hostname + HOSTNAME="${VAL}" + + # If we don't have a hostname, make one up + if [ -z "${HOSTNAME}" ] + then + gen_hostname + HOSTNAME="${VAL}" + fi + + # Clean up any saved hostname + cat ${FSMNT}/etc/rc.conf | grep -v "hostname=" >${FSMNT}/etc/rc.conf.new + mv ${FSMNT}/etc/rc.conf.new ${FSMNT}/etc/rc.conf + + # Set the hostname now + echo_log "Setting hostname: ${HOSTNAME}" + echo "hostname=\"${HOSTNAME}\"" >> ${FSMNT}/etc/rc.conf + sed -i -e "s|my.domain|${HOSTNAME} ${HOSTNAME}|g" ${FSMNT}/etc/hosts + +}; + + +# Check and make sure geom_journal is enabled on the system +setup_gjournal() +{ + + # Make sure we have geom_journal set to load at boot + cat ${FSMNT}/boot/loader.conf 2>/dev/null | grep 'geom_journal_load="YES"' >/dev/null 2>/dev/null + if [ "$?" != "0" ] + then + echo 'geom_journal_load="YES"' >>${FSMNT}/boot/loader.conf + fi + +}; + +# Function which sets the root password from the install config +set_root_pw() +{ + get_value_from_cfg_with_spaces rootPass + PW="${VAL}" + + # If we don't have a root pass, return + if [ -z "${PW}" ] + then + return 0 + fi + + echo_log "Setting root password" + echo "${PW}" > ${FSMNT}/.rootpw + run_chroot_cmd "cat /.rootpw | pw usermod root -h 0" + rc_halt "rm ${FSMNT}/.rootpw" + +}; + + +run_final_cleanup() +{ + + # Check if we need to run any gmirror setup + ls ${MIRRORCFGDIR}/* >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + # Lets setup gmirror now + setup_gmirror + fi + + # Check if we need to save any geli keys + ls ${GELIKEYDIR}/* >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + # Lets setup geli loading + setup_geli_loading + fi + + # Set a hostname on the install system + setup_hostname + + # Set the root_pw if it is specified + set_root_pw + + # Generate the fstab for the installed system + setup_fstab + +}; diff --git a/PCBSD/pc-sysinstall/backend/functions-disk.sh b/PCBSD/pc-sysinstall/backend/functions-disk.sh new file mode 100644 index 0000000..17cfb63 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/functions-disk.sh @@ -0,0 +1,646 @@ +#!/bin/sh +# Functions related to disk operations using gpart + +# See if device is a full disk or partition/slice +is_disk() { + for dsk in `sysctl -n kern.disks` + do + if [ "$dsk" = "${1}" ] ; then return 0 ; fi + done + + return 1 +} + +# Get a MBR partitions sysid +get_partition_sysid_mbr() +{ + INPART="0" + DISK="$1" + PARTNUM=`echo ${2} | sed "s|${DISK}s||g"` + fdisk ${DISK} >${TMPDIR}/disk-${DISK} 2>/dev/null + while read i + do + echo "$i" | grep "The data for partition" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + INPART="0" + PART="`echo ${i} | cut -d ' ' -f 5`" + if [ "$PART" = "$PARTNUM" ] ; then + INPART="1" + fi + fi + + # In the partition section + if [ "$INPART" = "1" ] ; then + echo "$i" | grep "^sysid" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + SYSID="`echo ${i} | tr -s '\t' ' ' | cut -d ' ' -f 2`" + break + fi + + fi + + done < ${TMPDIR}/disk-${DISK} + rm ${TMPDIR}/disk-${DISK} + + VAL="${SYSID}" + export VAL +}; + +# Get the partitions MBR label +get_partition_label_mbr() +{ + INPART="0" + DISK="$1" + PARTNUM=`echo ${2} | sed "s|${DISK}s||g"` + fdisk ${DISK} >${TMPDIR}/disk-${DISK} 2>/dev/null + while read i + do + echo "$i" | grep "The data for partition" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + INPART="0" + PART="`echo ${i} | cut -d ' ' -f 5`" + if [ "$PART" = "$PARTNUM" ] ; then + INPART="1" + fi + fi + + # In the partition section + if [ "$INPART" = "1" ] ; then + echo "$i" | grep "^sysid" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + LABEL="`echo ${i} | tr -s '\t' ' ' | cut -d ',' -f 2-10`" + break + fi + + fi + + done < ${TMPDIR}/disk-${DISK} + rm ${TMPDIR}/disk-${DISK} + + VAL="${LABEL}" + export VAL +}; + +# Get a GPT partitions label +get_partition_label_gpt() +{ + DISK="${1}" + PARTNUM=`echo ${2} | sed "s|${DISK}p||g"` + + gpart show ${DISK} >${TMPDIR}/disk-${DISK} + while read i + do + SLICE="`echo ${i} | grep -v ${DISK} | grep -v ' free ' |tr -s '\t' ' ' | cut -d ' ' -f 3`" + if [ "${SLICE}" = "${PARTNUM}" ] ; then + LABEL="`echo ${i} | grep -v ${DISK} | grep -v ' free ' |tr -s '\t' ' ' | cut -d ' ' -f 4`" + break + fi + done <${TMPDIR}/disk-${DISK} + rm ${TMPDIR}/disk-${DISK} + + VAL="${LABEL}" + export VAL +}; + +# Get a partitions startblock +get_partition_startblock() +{ + DISK="${1}" + PARTNUM=`echo ${2} | sed "s|${DISK}p||g" | sed "s|${DISK}s||g"` + + gpart show ${DISK} >${TMPDIR}/disk-${DISK} + while read i + do + SLICE="`echo ${i} | grep -v ${DISK} | grep -v ' free ' |tr -s '\t' ' ' | cut -d ' ' -f 3`" + if [ "$SLICE" = "${PARTNUM}" ] ; then + SB="`echo ${i} | grep -v ${DISK} | grep -v ' free ' |tr -s '\t' ' ' | cut -d ' ' -f 1`" + break + fi + done <${TMPDIR}/disk-${DISK} + rm ${TMPDIR}/disk-${DISK} + + VAL="${SB}" + export VAL +}; + +# Get a partitions blocksize +get_partition_blocksize() +{ + DISK="${1}" + PARTNUM=`echo ${2} | sed "s|${DISK}p||g" | sed "s|${DISK}s||g"` + + gpart show ${DISK} >${TMPDIR}/disk-${DISK} + while read i + do + SLICE="`echo ${i} | grep -v ${DISK} | grep -v ' free ' |tr -s '\t' ' ' | cut -d ' ' -f 3`" + if [ "$SLICE" = "${PARTNUM}" ] ; then + BS="`echo ${i} | grep -v ${DISK} | grep -v ' free ' |tr -s '\t' ' ' | cut -d ' ' -f 2`" + break + fi + done <${TMPDIR}/disk-${DISK} + rm ${TMPDIR}/disk-${DISK} + + VAL="${BS}" + export VAL +}; + +# Function which returns the partitions on a target disk +get_disk_partitions() +{ + gpart show ${1} >/dev/null 2>/dev/null + if [ "$?" != "0" ] ; then + VAL="" ; export VAL + return + fi + + gpart show ${1} | grep "MBR" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + type="MBR" + else + type="GPT" + fi + + SLICES="`gpart show ${1} | grep -v ${1} | grep -v ' free ' |tr -s '\t' ' ' | cut -d ' ' -f 4 | sed '/^$/d'`" + for i in ${SLICES} + do + case $type in + MBR) name="${1}s${i}" ;; + GPT) name="${1}p${i}";; + *) name="${1}s${i}";; + esac + if [ -z "${RSLICES}" ] + then + RSLICES="${name}" + else + RSLICES="${RSLICES} ${name}" + fi + done + + VAL="${RSLICES}" ; export VAL +}; + +# Function which returns a target disks cylinders +get_disk_cyl() +{ + cyl=`diskinfo -v ${1} | grep "# Cylinders" | tr -s ' ' | cut -f 2` + VAL="${cyl}" ; export VAL +}; + +# Function which returns a target disks sectors +get_disk_sectors() +{ + sec=`diskinfo -v ${1} | grep "# Sectors" | tr -s ' ' | cut -f 2` + VAL="${sec}" ; export VAL +}; + +# Function which returns a target disks heads +get_disk_heads() +{ + head=`diskinfo -v ${1} | grep "# Heads" | tr -s ' ' | cut -f 2` + VAL="${head}" ; export VAL +}; + +# Function which exports all zpools, making them safe to overwrite potentially +export_all_zpools() { + # Export any zpools + for i in `zpool list -H -o name` + do + zpool export -f ${i} + done +}; + +# Function to delete all gparts before starting an install +delete_all_gpart() +{ + echo_log "Deleting all gparts" + DISK="$1" + + # Check for any swaps to stop + for i in `gpart show ${DISK} 2>/dev/null | grep 'freebsd-swap' | tr -s ' ' | cut -d ' ' -f 4` + do + swapoff /dev/${DISK}s${i}b >/dev/null 2>/dev/null + swapoff /dev/${DISK}p${i} >/dev/null 2>/dev/null + done + + # Delete the gparts now + for i in `gpart show ${DISK} 2>/dev/null | tr -s ' ' | cut -d ' ' -f 4` + do + if [ "${i}" != "${DISK}" -a "${i}" != "-" ] ; then + rc_nohalt "gpart delete -i ${i} ${DISK}" + fi + done + + rc_nohalt "dd if=/dev/zero of=/dev/${DISK} count=3000" + +}; + +# Function to export all zpools before starting an install +stop_all_zfs() +{ + # Export all zpools again, so that we can overwrite these partitions potentially + for i in `zpool list -H -o name` + do + zpool export -f ${i} + done +}; + +# Function which stops all gmirrors before doing any disk manipulation +stop_all_gmirror() +{ + DISK="${1}" + GPROV="`gmirror list | grep ". Name: mirror/" | cut -d '/' -f 2`" + for gprov in $GPROV + do + gmirror list | grep "Name: ${DISK}" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + echo_log "Stopping mirror $gprov $DISK" + rc_nohalt "gmirror remove $gprov $DISK" + rc_nohalt "dd if=/dev/zero of=/dev/${DISK} count=4096" + fi + done +}; + +# Make sure we don't have any geli providers active on this disk +stop_all_geli() +{ + DISK="${1}" + cd /dev + + for i in `ls ${DISK}*` + do + echo $i | grep '.eli' >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + echo_log "Detaching GELI on ${i}" + rc_halt "geli detach ${i}" + fi + done + +}; + +# Function which reads in the disk slice config, and performs it +setup_disk_slice() +{ + + # Cleanup any slice / mirror dirs + rm -rf ${SLICECFGDIR} >/dev/null 2>/dev/null + mkdir ${SLICECFGDIR} + rm -rf ${MIRRORCFGDIR} >/dev/null 2>/dev/null + mkdir ${MIRRORCFGDIR} + + # Start with disk0 + disknum="0" + + # Make sure all zpools are exported + export_all_zpools + + # We are ready to start setting up the disks, lets read the config and do the actions + while read line + do + echo $line | grep "^disk${disknum}=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + + # Found a disk= entry, lets get the disk we are working on + get_value_from_string "${line}" + strip_white_space "$VAL" + DISK="$VAL" + + # Before we go further, lets confirm this disk really exists + if [ ! -e "/dev/${DISK}" ] + then + exit_err "ERROR: The disk ${DISK} does not exist!" + fi + + # Make sure we stop any gmirrors on this disk + stop_all_gmirror ${DISK} + + # Make sure we stop any geli stuff on this disk + stop_all_geli ${DISK} + + # Make sure we don't have any zpools loaded + stop_all_zfs + + fi + + # Lets look if this device will be mirrored on another disk + echo $line | grep "^mirror=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + + # Found a disk= entry, lets get the disk we are working on + get_value_from_string "${line}" + strip_white_space "$VAL" + MIRRORDISK="$VAL" + + # Before we go further, lets confirm this disk really exists + if [ ! -e "/dev/${MIRRORDISK}" ] + then + exit_err "ERROR: The mirror disk ${MIRRORDISK} does not exist!" + fi + fi + + # Lets see if we have been given a mirror balance choice + echo $line | grep "^mirrorbal=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + + # Found a disk= entry, lets get the disk we are working on + get_value_from_string "${line}" + strip_white_space "$VAL" + MIRRORBAL="$VAL" + fi + + echo $line | grep "^partition=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + # Found a partition= entry, lets read / set it + get_value_from_string "${line}" + strip_white_space "$VAL" + PTYPE="$VAL" + + # We are using free space, figure out the slice number + if [ "${PTYPE}" = "free" -o "${PTYPE}" = "FREE" ] + then + # Lets figure out what number this slice will be + LASTSLICE="`gpart show ${DISK} | grep -v ${DISK} | grep -v ' free' |tr -s '\t' ' ' | cut -d ' ' -f 4 | sed '/^$/d' | tail -n 1`" + if [ -z "${LASTSLICE}" ] + then + LASTSLICE="1" + else + LASTSLICE="`expr $LASTSLICE + 1`" + fi + + if [ $LASTSLICE -gt 4 ] + then + exit_err "ERROR: BSD only supports primary partitions, and there are none availble on $DISK" + fi + + fi + fi + + echo $line | grep "^bootManager=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + # Found a bootManager= entry, lets read /set it + get_value_from_string "${line}" + strip_white_space "$VAL" + BMANAGER="$VAL" + fi + + echo $line | grep "^commitDiskPart" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + # Found our flag to commit this disk setup / lets do sanity check and do it + if [ ! -z "${DISK}" -a ! -z "${PTYPE}" ] + then + case ${PTYPE} in + all|ALL) tmpSLICE="${DISK}p1" + run_gpart_full "${DISK}" "${BMANAGER}" ;; + s1|s2|s3|s4) tmpSLICE="${DISK}${PTYPE}" + # Get the number of the slice we are working on + s="`echo ${PTYPE} | awk '{print substr($0,length,1)}'`" + run_gpart_slice "${DISK}" "${BMANAGER}" "${s}" ;; + free|FREE) tmpSLICE="${DISK}s${LASTSLICE}" + run_gpart_free "${DISK}" "${LASTSLICE}" "${BMANAGER}" ;; + *) exit_err "ERROR: Unknown PTYPE: $PTYPE" ;; + esac + + # Now save which disk<num> this is, so we can parse it later during slice partition setup + echo "disk${disknum}" >${SLICECFGDIR}/$tmpSLICE + + # Save any mirror config + if [ ! -z "$MIRRORDISK" ] + then + # Default to round-robin if the user didn't specify + if [ -z "$MIRRORBAL" ] + then + MIRRORBAL="round-robin" + fi + echo "$MIRRORDISK:$MIRRORBAL" >${MIRRORCFGDIR}/$DISK + fi + + + # Increment our disk counter to look for next disk and unset + unset BMANAGER PTYPE DISK MIRRORDISK MIRRORBAL + disknum="`expr $disknum + 1`" + else + exit_err "ERROR: commitDiskPart was called without procceding disk<num>= and partition= entries!!!" + fi + fi + + done <${CFGF} + +}; + +# Stop all gjournals on disk / slice +stop_gjournal() { + DISK="$1" + # Check if we need to shutdown any journals on this drive + ls /dev/${DISK}*.journal >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + cd /dev + for i in `ls ${DISK}*.journal` + do + rawjournal="`echo ${i} | cut -d '.' -f 1`" + gjournal stop -f ${rawjournal} >>${LOGOUT} 2>>${LOGOUT} + gjournal clear ${rawjournal} >>${LOGOUT} 2>>${LOGOUT} + done + fi +} ; + +# Function which runs gpart and creates a single large slice +init_gpt_full_disk() +{ + DISK=$1 + + # Set our sysctl so we can overwrite any geom using drives + sysctl kern.geom.debugflags=16 >>${LOGOUT} 2>>${LOGOUT} + + # Stop any journaling + stop_gjournal "${DISK}" + + # Remove any existing partitions + delete_all_gpart "${DISK}" + + #Erase any existing bootloader + echo_log "Cleaning up ${DISK}" + rc_halt "dd if=/dev/zero of=/dev/${DISK} count=2048" + + sleep 2 + + echo_log "Running gpart on ${DISK}" + rc_halt "gpart create -s GPT ${DISK}" + rc_halt "gpart add -s 128 -t freebsd-boot ${DISK}" + + echo_log "Stamping boot sector on ${DISK}" + rc_halt "gpart bootcode -b /boot/pmbr ${DISK}" + +} + +# Function which runs gpart and creates a single large slice +run_gpart_full() +{ + DISK=$1 + + init_gpt_full_disk "$DISK" + + slice="${DISK}-1-gpt" + + # Lets save our slice, so we know what to look for in the config file later on + if [ -z "$WORKINGSLICES" ] + then + WORKINGSLICES="${slice}" + export WORKINGSLICES + else + WORKINGSLICES="${WORKINGSLICES} ${slice}" + export WORKINGSLICES + fi +}; + +# Function which runs gpart on a specified s1-4 slice +run_gpart_slice() +{ + DISK=$1 + if [ ! -z "$2" ] + then + BMANAGER="$2" + fi + + # Set the slice we will use later + slice="${1}s${3}" + + # Set our sysctl so we can overwrite any geom using drives + sysctl kern.geom.debugflags=16 >>${LOGOUT} 2>>${LOGOUT} + + # Get the number of the slice we are working on + slicenum="$3" + + # Stop any journaling + stop_gjournal "${slice}" + + # Make sure we have disabled swap on this drive + if [ -e "${slice}b" ] + then + swapoff ${slice}b >/dev/null 2>/dev/null + swapoff ${slice}b.eli >/dev/null 2>/dev/null + fi + + # Modify partition type + echo_log "Running gpart modify on ${DISK}" + rc_halt "gpart modify -t freebsd -i ${slicenum} ${DISK}" + sleep 2 + + # Clean up old partition + echo_log "Cleaning up $slice" + rc_halt "dd if=/dev/zero of=/dev/${DISK}s${slicenum} count=1024" + + sleep 1 + + if [ "${BMANAGER}" = "bsd" ] + then + echo_log "Stamping boot sector on ${DISK}" + rc_halt "gpart bootcode -b /boot/boot0 ${DISK}" + fi + + # Set the slice to the format we'll be using for gpart later + slice="${1}-${3}-mbr" + + # Lets save our slice, so we know what to look for in the config file later on + if [ -z "$WORKINGSLICES" ] + then + WORKINGSLICES="${slice}" + export WORKINGSLICES + else + WORKINGSLICES="${WORKINGSLICES} ${slice}" + export WORKINGSLICES + fi +}; + +# Function which runs gpart and creates a new slice from free disk space +run_gpart_free() +{ + DISK=$1 + SLICENUM=$2 + if [ ! -z "$3" ] + then + BMANAGER="$3" + fi + + # Set our sysctl so we can overwrite any geom using drives + sysctl kern.geom.debugflags=16 >>${LOGOUT} 2>>${LOGOUT} + + slice="${DISK}s${SLICENUM}" + slicenum="${SLICENUM}" + + # Working on the first slice, make sure we have MBR setup + gpart show ${DISK} >/dev/null 2>/dev/null + if [ "$?" != "0" -a "$SLICENUM" = "1" ] ; then + echo_log "Initializing disk, no existing MBR setup" + rc_halt "gpart create -s mbr ${DISK}" + fi + + # Lets get the starting block first + if [ "${slicenum}" = "1" ] + then + startblock="63" + else + # Lets figure out where the prior slice ends + checkslice="`expr ${slicenum} - 1`" + + # Get starting block of this slice + sblk=`gpart show ${DISK} | grep -v ${DISK} | tr -s '\t' ' ' | sed '/^$/d' | grep " ${checkslice} " | cut -d ' ' -f 2` + blksize=`gpart show ${DISK} | grep -v ${DISK} | tr -s '\t' ' ' | sed '/^$/d' | grep " ${checkslice} " | cut -d ' ' -f 3` + startblock="`expr ${sblk} + ${blksize}`" + fi + + # No slice after the new slice, lets figure out the free space remaining and use it + # Get the cyl of this disk + get_disk_cyl "${DISK}" + cyl="${VAL}" + + # Get the heads of this disk + get_disk_heads "${DISK}" + head="${VAL}" + + # Get the tracks/sectors of this disk + get_disk_sectors "${DISK}" + sec="${VAL}" + + # Multiply them all together to get our total blocks + totalblocks="`expr ${cyl} \* ${head}`" + totalblocks="`expr ${totalblocks} \* ${sec}`" + + + # Now set the ending block to the total disk block size + sizeblock="`expr ${totalblocks} - ${startblock}`" + + # Install new partition setup + echo_log "Running gpart on ${DISK}" + rc_halt "gpart add -b ${startblock} -s ${sizeblock} -t freebsd -i ${slicenum} ${DISK}" + sleep 2 + + echo_log "Cleaning up $slice" + rc_halt "dd if=/dev/zero of=/dev/${slice} count=1024" + + sleep 1 + + if [ "${BMANAGER}" = "bsd" ] + then + echo_log "Stamping boot sector on ${DISK}" + rc_halt "gpart bootcode -b /boot/boot0 ${DISK}" + fi + + slice="${DISK}-${SLICENUM}-mbr" + # Lets save our slice, so we know what to look for in the config file later on + if [ -z "$WORKINGSLICES" ] + then + WORKINGSLICES="${slice}" + export WORKINGSLICES + else + WORKINGSLICES="${WORKINGSLICES} ${slice}" + export WORKINGSLICES + fi +}; diff --git a/PCBSD/pc-sysinstall/backend/functions-extractimage.sh b/PCBSD/pc-sysinstall/backend/functions-extractimage.sh new file mode 100644 index 0000000..394cfad --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/functions-extractimage.sh @@ -0,0 +1,289 @@ +#!/bin/sh +# Functions which perform the extraction / installation of system to disk + +. ${BACKEND}/functions-mountoptical.sh + +# Performs the extraction of data to disk from a uzip or tar archive +start_extract_uzip_tar() +{ + if [ -z "$INSFILE" ] + then + exit_err "ERROR: Called extraction with no install file set!" + fi + + # Check if we have a .count file, and echo it out for a front-end to use in progress bars + if [ -e "${INSFILE}.count" ] + then + echo "INSTALLCOUNT: `cat ${INSFILE}.count`" + fi + + # Check if we are doing an upgrade, and if so use our exclude list + if [ "${INSTALLMODE}" = "upgrade" ] + then + TAROPTS="-X ${PROGDIR}/conf/exclude-from-upgrade" + else + TAROPTS="" + fi + + echo_log "pc-sysinstall: Starting Extraction" + + case ${PACKAGETYPE} in + uzip) # Start by mounting the uzip image + MDDEVICE=`mdconfig -a -t vnode -o readonly -f ${INSFILE}` + mkdir -p ${FSMNT}.uzip + mount -r /dev/${MDDEVICE}.uzip ${FSMNT}.uzip + if [ "$?" != "0" ] + then + exit_err "ERROR: Failed mounting the ${INSFILE}" + fi + cd ${FSMNT}.uzip + + # Copy over all the files now! + tar cvf - . 2>/dev/null | tar -xpv -C ${FSMNT} ${TAROPTS} -f - 2>&1 | tee -a ${FSMNT}/.tar-extract.log + if [ "$?" != "0" ] + then + cd / + echo "TAR failure occured:" >>${LOGOUT} + cat ${FSMNT}/.tar-extract.log | grep "tar:" >>${LOGOUT} + umount ${FSMNT}.uzip + mdconfig -d -u ${MDDEVICE} + exit_err "ERROR: Failed extracting the tar image" + fi + + # All finished, now lets umount and cleanup + cd / + umount ${FSMNT}.uzip + mdconfig -d -u ${MDDEVICE} + ;; + tar) tar -xpv -C ${FSMNT} -f ${INSFILE} ${TAROPTS} >&1 2>&1 + if [ "$?" != "0" ] + then + exit_err "ERROR: Failed extracting the tar image" + fi + ;; + esac + + # Check if this was a FTP download and clean it up now + if [ "${INSTALLMEDIUM}" = "ftp" ] + then + echo_log "Cleaning up downloaded archive" + rm ${INSFILE} + rm ${INSFILE}.count >/dev/null 2>/dev/null + rm ${INSFILE}.md5 >/dev/null 2>/dev/null + fi + + echo_log "pc-sysinstall: Extraction Finished" + +}; + +# Performs the extraction of data to disk from a directory with split files +start_extract_split() +{ + if [ -z "${INSDIR}" ] + then + exit_err "ERROR: Called extraction with no install directory set!" + fi + + echo_log "pc-sysinstall: Starting Extraction" + + # Used by install.sh + DESTDIR="${FSMNT}" + export DESTDIR + + HERE=`pwd` + DIRS=`ls -d ${INSDIR}/*|grep -Ev '(uzip|kernels|src)'` + for dir in ${DIRS} + do + cd "${dir}" + if [ -f "install.sh" ] + then + echo "Extracting" `basename ${dir}` + echo "y" | sh install.sh >/dev/null + if [ "$?" != "0" ] + then + exit_err "ERROR: Failed extracting ${dir}" + fi + else + exit_err "ERROR: ${dir}/install.sh does not exist" + fi + done + cd "${HERE}" + + KERNELS=`ls -d ${INSDIR}/*|grep kernels` + cd "${KERNELS}" + if [ -f "install.sh" ] + then + echo "Extracting" `basename ${KERNELS}` + echo "y" | sh install.sh generic >/dev/null + if [ "$?" != "0" ] + then + exit_err "ERROR: Failed extracting ${KERNELS}" + fi + echo 'kernel="GENERIC"' > "${FSMNT}/boot/loader.conf" + else + exit_err "ERROR: ${KERNELS}/install.sh does not exist" + fi + cd "${HERE}" + + SOURCE=`ls -d ${INSDIR}/*|grep src` + cd "${SOURCE}" + if [ -f "install.sh" ] + then + echo "Extracting" `basename ${SOURCE}` + echo "y" | sh install.sh all >/dev/null + if [ "$?" != "0" ] + then + exit_err "ERROR: Failed extracting ${SOURCE}" + fi + else + exit_err "ERROR: ${SOURCE}/install.sh does not exist" + fi + cd "${HERE}" + + echo_log "pc-sysinstall: Extraction Finished" +}; + +# Function which will attempt to fetch the install file before we start +# the install +fetch_install_file() +{ + get_value_from_cfg ftpPath + if [ -z "$VAL" ] + then + exit_err "ERROR: Install medium was set to ftp, but no ftpPath was provided!" + fi + + FTPPATH="${VAL}" + + # Check if we have a /usr partition to save the download + if [ -d "${FSMNT}/usr" ] + then + OUTFILE="${FSMNT}/usr/.fetch-${INSFILE}" + else + OUTFILE="${FSMNT}/.fetch-${INSFILE}" + fi + + # Do the fetch of the archive now + fetch_file "${FTPPATH}/${INSFILE}" "${OUTFILE}" "1" + + # Check to see if there is a .count file for this install + fetch_file "${FTPPATH}/${INSFILE}.count" "${OUTFILE}.count" "0" + + # Check to see if there is a .md5 file for this install + fetch_file "${FTPPATH}/${INSFILE}.md5" "${OUTFILE}.md5" "0" + + # Done fetching, now reset the INSFILE to our downloaded archived + INSFILE="${OUTFILE}" ; export INSFILE + +}; + +# Function which does the rsync download from the server specifed in cfg +start_rsync_copy() +{ + # Load our rsync config values + get_value_from_cfg rsyncPath + if [ -z "${VAL}" ]; then + exit_err "ERROR: rsyncPath is unset! Please check your config and try again." + fi + RSYNCPATH="${VAL}" ; export RSYNCPATH + + get_value_from_cfg rsyncHost + if [ -z "${VAL}" ]; then + exit_err "ERROR: rsyncHost is unset! Please check your config and try again." + fi + RSYNCHOST="${VAL}" ; export RSYNCHOST + + get_value_from_cfg rsyncUser + if [ -z "${VAL}" ]; then + exit_err "ERROR: rsyncUser is unset! Please check your config and try again." + fi + RSYNCUSER="${VAL}" ; export RSYNCUSER + + get_value_from_cfg rsyncPort + if [ -z "${VAL}" ]; then + exit_err "ERROR: rsyncPort is unset! Please check your config and try again." + fi + RSYNCPORT="${VAL}" ; export RSYNCPORT + + COUNT="1" + while + z=1 + do + if [ ${COUNT} -gt ${RSYNCTRIES} ] + then + exit_err "ERROR: Failed rsync command!" + break + fi + + rsync -avvzHsR \ + --rsync-path="rsync --fake-super" \ + -e "ssh -p ${RSYNCPORT}" \ + ${RSYNCUSER}@${RSYNCHOST}:${RSYNCPATH}/./ ${FSMNT} + if [ "$?" != "0" ] + then + echo "Rsync failed! Tries: ${COUNT}" + else + break + fi + + COUNT="`expr ${COUNT} + 1`" + done + +}; + + +# Entrance function, which starts the installation process +init_extraction() +{ + # Figure out what file we are using to install from via the config + get_value_from_cfg installFile + + if [ ! -z "${VAL}" ] + then + INSFILE="${VAL}" ; export INSFILE + else + # If no installFile specified, try our defaults + if [ "$INSTALLTYPE" = "FreeBSD" ] + then + case $PACKAGETYPE in + uzip) INSFILE="${FBSD_UZIP_FILE}" ;; + tar) INSFILE="${FBSD_TAR_FILE}" ;; + split) + INSDIR="${FBSD_BRANCH_DIR}" + + # This is to trick opt_mount into not failing + INSFILE="${INSDIR}" + ;; + esac + else + case $PACKAGETYPE in + uzip) INSFILE="${UZIP_FILE}" ;; + tar) INSFILE="${TAR_FILE}" ;; + esac + fi + export INSFILE + fi + + # Lets start by figuring out what medium we are using + case ${INSTALLMEDIUM} in + dvd|usb) # Lets start by mounting the disk + opt_mount + if [ ! -z "${INSDIR}" ] + then + INSDIR="${CDMNT}/${INSDIR}" ; export INSDIR + start_extract_split + + else + INSFILE="${CDMNT}/${INSFILE}" ; export INSFILE + start_extract_uzip_tar + fi + ;; + ftp) fetch_install_file + start_extract_uzip_tar + ;; + rsync) start_rsync_copy + ;; + *) exit_err "ERROR: Unknown install medium" ;; + esac + +}; diff --git a/PCBSD/pc-sysinstall/backend/functions-installcomponents.sh b/PCBSD/pc-sysinstall/backend/functions-installcomponents.sh new file mode 100644 index 0000000..cb3b0a6 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/functions-installcomponents.sh @@ -0,0 +1,140 @@ +#!/bin/sh +# Functions which check and load any optional modules specified in the config + +. ${BACKEND}/functions.sh +. ${BACKEND}/functions-parse.sh + +copy_component() +{ + COMPONENT="$1" + FAILED="0" + CFILES="" + + # Check the type, and set the components subdir properly + TYPE="`grep 'type:' ${COMPDIR}/${COMPONENT}/component.cfg | cut -d ' ' -f 2`" + if [ "${TYPE}" = "PBI" ] + then + SUBDIR="PBI" + else + SUBDIR="components" + fi + + # Lets start by downloading / copying the files this component needs + while read line + do + CFILE="`echo $line | cut -d ':' -f 1`" + CFILEMD5="`echo $line | cut -d ':' -f 2`" + CFILE2MD5="`echo $line | cut -d ':' -f 3`" + + + case ${INSTALLMEDIUM} in + dvd|usb) # On both dvd / usb, we can just copy the file + cp ${CDMNT}/${COMPFILEDIR}/${SUBDIR}/${CFILE} \ + ${FSMNT}/${COMPTMPDIR} >>${LOGOUT} 2>>${LOGOUT} + RESULT="$?" + ;; + ftp) get_value_from_cfg ftpPath + if [ -z "$VAL" ] + then + exit_err "ERROR: Install medium was set to ftp, but no ftpPath was provided!" + fi + FTPPATH="${VAL}" + + fetch_file "${FTPPATH}/${COMPFILEDIR}/${SUBDIR}/${CFILE}" "${FSMNT}/${COMPTMPDIR}/${CFILE}" "0" + RESULT="$?" + ;; + esac + + if [ "${RESULT}" != "0" ] + then + echo_log "WARNING: Failed to copy ${CFILE}" + FAILED="1" + else + # Now lets check the MD5 to confirm the file is valid + CHECKMD5=`md5 -q ${FSMNT}/${COMPTMPDIR}/${CFILE}` + if [ "${CHECKMD5}" != "${CFILEMD5}" -a "${CHECKMD5}" != "${CFILE2MD5}" ] + then + echo_log "WARNING: ${CFILE} failed md5 checksum" + FAILED="1" + else + if [ -z "${CFILES}" ] + then + CFILES="${CFILE}" + else + CFILES="${CFILES},${CFILE}" + fi + fi + fi + + + done < ${COMPDIR}/${COMPONENT}/distfiles + + if [ "${FAILED}" = "0" ] + then + # Now install the component + run_component_install ${COMPONENT} ${CFILES} + fi + +}; + +run_component_install() +{ + COMPONENT="$1" + CFILES="$1" + + # Lets install this component now + # Start by making a wrapper script which sets the variables + # for the component to use + echo "#!/bin/sh +COMPTMPDIR=\"${COMPTMPDIR}\" +export COMPTMPDIR +CFILE=\"${CFILE}\" +export CFILE + +sh ${COMPTMPDIR}/install.sh + +" >${FSMNT}/.componentwrapper.sh + chmod 755 ${FSMNT}/.componentwrapper.sh + + # Copy over the install script for this component + cp ${COMPDIR}/${COMPONENT}/install.sh ${FSMNT}/${COMPTMPDIR}/ + + echo_log "INSTALL COMPONENT: ${i}" + chroot ${FSMNT} /.componentwrapper.sh >>${LOGOUT} 2>>${LOGOUT} + rm ${FSMNT}/.componentwrapper.sh + + +}; + +# Check for any modules specified, and begin loading them +install_components() +{ + # First, lets check and see if we even have any optional modules + get_value_from_cfg installComponents + if [ ! -z "${VAL}" ] + then + # Lets start by cleaning up the string and getting it ready to parse + strip_white_space ${VAL} + COMPONENTS=`echo ${VAL} | sed -e "s|,| |g"` + for i in $COMPONENTS + do + if [ ! -e "${COMPDIR}/${i}/install.sh" -o ! -e "${COMPDIR}/${i}/distfiles" ] + then + echo_log "WARNING: Component ${i} doesn't seem to exist" + else + + # Make the tmpdir on the disk + mkdir -p ${FSMNT}/${COMPTMPDIR} >>${LOGOUT} 2>>${LOGOUT} + + # Start by grabbing the component files + copy_component ${i} + + # Remove the tmpdir now + rm -rf ${FSMNT}/${COMPTMPDIR} >>${LOGOUT} 2>>${LOGOUT} + + fi + done + + fi + +}; diff --git a/PCBSD/pc-sysinstall/backend/functions-localize.sh b/PCBSD/pc-sysinstall/backend/functions-localize.sh new file mode 100644 index 0000000..02dfd61 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/functions-localize.sh @@ -0,0 +1,449 @@ +#!/bin/sh +# Functions which runs commands on the system + +. ${BACKEND}/functions.sh +. ${BACKEND}/functions-parse.sh + + +# Function which localizes a FreeBSD install +localize_freebsd() +{ + sed -i.bak "s/lang=en_US/lang=${LOCALE}/g" ${FSMNT}/etc/login.conf + rm ${FSMNT}/etc/login.conf.bak +}; + + +# Function which localizes a PC-BSD install +localize_pcbsd() +{ + #Change the skel files + ########################################################################## + sed -i.bak "s/Country=us/Country=${COUNTRY}/g" ${FSMNT}/usr/share/skel/.kde4/share/config/kdeglobals + sed -i.bak "s/Country=us/Country=${COUNTRY}/g" ${FSMNT}/root/.kde4/share/config/kdeglobals + sed -i.bak "s/Language=en_US/Language=${SETLANG}:${LOCALE}/g" ${FSMNT}/usr/share/skel/.kde4/share/config/kdeglobals + sed -i.bak "s/Language=en_US/Language=${SETLANG}:${LOCALE}/g" ${FSMNT}/root/.kde4/share/config/kdeglobals + + #Change KDM Langs + ########################################################################## + sed -i.bak "s/Language=en_US/Language=${LOCALE}.UTF-8/g" ${FSMNT}/usr/local/kde4/share/config/kdm/kdmrc + + # Check if we have a localized splash screen and copy it + if [ -e "${FSMNT}/usr/PCBSD/splash-screens/loading-screen-${SETLANG}.pcx" ] + then + cp ${FSMNT}/usr/PCBSD/splash-screens/loading-screen-${SETLANG}.pcx ${FSMNT}/boot/loading-screen.pcx + fi + +}; + +localize_x_keyboard() +{ + KEYMOD="$1" + KEYLAY="$2" + KEYVAR="$3" + COUNTRY="$4" + SETXKBMAP="" + + if [ "${COUNTRY}" = "NONE" ] || [ "${COUNTRY}" = "us" ]; + then + #In this case we don't need any additional language + COUNTRY="" + else + COUNTRY=",${COUNTRY}" + fi + + if [ "${KEYMOD}" != "NONE" ] + then + SETXKBMAP="-model ${KEYMOD}" + KXMODEL="${KEYMOD}" + else + KXMODEL="pc104" + fi + + if [ "${KEYLAY}" != "NONE" ] + then + localize_key_layout "$KEYLAY" + SETXKBMAP="${SETXKBMAP} -layout ${KEYLAY}" + KXLAYOUT="${KEYLAY}" + else + KXLAYOUT="us" + fi + + if [ "${KEYVAR}" != "NONE" ] + then + SETXKBMAP="${SETXKBMAP} -variant ${KEYVAR}" + KXVAR="(${KEYVAR})" + else + KXVAR="" + fi + + # Setup .xprofile with our setxkbmap call now + if [ ! -z "${SETXKBMAP}" ] + then + if [ ! -e "${FSMNT}/usr/share/skel/.xprofile" ] + then + echo "#!/bin/sh" >${FSMNT}/usr/share/skel/.xprofile + fi + + # Save the keyboard layout for user / root X logins + echo "setxkbmap ${SETXKBMAP}" >>${FSMNT}/usr/share/skel/.xprofile + chmod 755 ${FSMNT}/usr/share/skel/.xprofile + cp ${FSMNT}/usr/share/skel/.xprofile ${FSMNT}/root/.xprofile + + # Save it for KDM + echo "setxkbmap ${SETXKBMAP}" >>${FSMNT}/usr/local/kde4/share/config/kdm/Xsetup + fi + + + # Create the kxkbrc configuration using these options + echo "[Layout] +DisplayNames=${KXLAYOUT}${COUNTRY} +IndicatorOnly=false +LayoutList=${KXLAYOUT}${KXVAR}${COUNTRY} +Model=${KXMODEL} +Options= +ResetOldOptions=true +ShowFlag=true +ShowSingle=false +SwitchMode=WinClass +Use=true " >${FSMNT}/usr/share/skel/.kde4/share/config/kxkbrc + +}; + +localize_key_layout() +{ + + KEYLAYOUT="$1" + + # Set the keylayout in rc.conf + case ${KEYLAYOUT} in + am) KEYLAYOUT_CONSOLE="hy.armscii-8" ;; + ch) KEYLAYOUT_CONSOLE="swissgerman.iso" ;; + cz) KEYLAYOUT_CONSOLE="cz.iso2" ;; + de) KEYLAYOUT_CONSOLE="german.iso" ;; + dk) KEYLAYOUT_CONSOLE="danish.iso" ;; + ee) KEYLAYOUT_CONSOLE="estonian.iso" ;; + es) KEYLAYOUT_CONSOLE="spanish.iso" ;; + fi) KEYLAYOUT_CONSOLE="finnish.iso" ;; + is) KEYLAYOUT_CONSOLE="icelandic.iso" ;; + jp) KEYLAYOUT_CONSOLE="jp.106" ;; + nl) KEYLAYOUT_CONSOLE="dutch.iso.acc" ;; + no) KEYLAYOUT_CONSOLE="norwegian.iso" ;; + pl) KEYLAYOUT_CONSOLE="pl_PL.ISO8859-2" ;; + ru) KEYLAYOUT_CONSOLE="ru.koi8-r" ;; + sk) KEYLAYOUT_CONSOLE="sk.iso2" ;; + se) KEYLAYOUT_CONSOLE="swedish.iso" ;; + tr) KEYLAYOUT_CONSOLE="tr.iso9.q" ;; + gb) KEYLAYOUT_CONSOLE="uk.iso" ;; + *) if [ ! -z "${KEYLAYOUT}" ] + then + KEYLAYOUT_CONSOLE="${KEYLAYOUT}.iso" + fi + ;; + esac + + if [ ! -z "${KEYLAYOUT_CONSOLE}" ] + then + echo "keymap=\"${KEYLAYOUT_CONSOLE}\"" >>${FSMNT}/etc/rc.conf + fi + +}; + +# Function which prunes other l10n files from the KDE install +localize_prune_langs() +{ + get_value_from_cfg localizeLang + KEEPLANG="$VAL" + if [ -z "$KEEPLANG" ] ; then + KEEPLANG="en" + fi + export KEEPLANG + + echo_log "Pruning other l10n files, keeping ${KEEPLANG}" + + # Create the script to do uninstalls + echo '#!/bin/sh + + for i in `pkg_info | grep "kde-l10n" | cut -d " " -f 1` + do + echo "$i" | grep "${KEEPLANG}-kde" + if [ "$?" != "0" ] ; then + pkg_delete ${i} + fi + done + ' > ${FSMNT}/.pruneLangs.sh + + chmod 755 ${FSMNT}/.pruneLangs.sh + chroot ${FSMNT} /.pruneLangs.sh >/dev/null 2>/dev/null + rm ${FSMNT}/.pruneLangs.sh + +}; + +# Function which sets COUNTRY SETLANG and LOCALE based upon $1 +localize_get_codes() +{ + TARGETLANG="${1}" + # Setup the presets for the specific lang + case $TARGETLANG in + af) COUNTRY="C" + SETLANG="af" + LOCALE="af_ZA" + ;; + ar) COUNTRY="C" + SETLANG="ar" + LOCALE="en_US" + ;; + az) COUNTRY="C" + SETLANG="az" + LOCALE="en_US" + ;; + ca) COUNTRY="es" + SETLANG="es:ca" + LOCALE="ca_ES" + ;; + be) COUNTRY="be" + SETLANG="be" + LOCALE="be_BY" + ;; + bn) COUNTRY="bn" + SETLANG="bn" + LOCALE="en_US" + ;; + bg) COUNTRY="bg" + SETLANG="bg" + LOCALE="bg_BG" + ;; + cs) COUNTRY="cz" + SETLANG="cs" + LOCALE="cs_CZ" + ;; + da) COUNTRY="dk" + SETLANG="da" + LOCALE="da_DK" + ;; + de) COUNTRY="de" + SETLANG="de" + LOCALE="de_DE" + ;; + en_GB) COUNTRY="gb" + SETLANG="en_GB:cy" + LOCALE="en_GB" + ;; + el) COUNTRY="gr" + SETLANG="el:gr" + LOCALE="el_GR" + ;; + es) COUNTRY="es" + SETLANG="es" + LOCALE="es_ES" + ;; + es_LA) COUNTRY="us" + SETLANG="es:en_US" + LOCALE="es_ES" + ;; + et) COUNTRY="ee" + SETLANG="et" + LOCALE="et_EE" + ;; + fr) COUNTRY="fr" + SETLANG="fr" + LOCALE="fr_FR" + ;; + he) COUNTRY="il" + SETLANG="he:ar" + LOCALE="he_IL" + ;; + hr) COUNTRY="hr" + SETLANG="hr" + LOCALE="hr_HR" + ;; + hu) COUNTRY="hu" + SETLANG="hu" + LOCALE="hu_HU" + ;; + it) COUNTRY="it" + SETLANG="it" + LOCALE="it_IT" + ;; + ja) COUNTRY="jp" + SETLANG="ja" + LOCALE="ja_JP" + ;; + ko) COUNTRY="kr" + SETLANG="ko" + LOCALE="ko_KR" + ;; + nl) COUNTRY="nl" + SETLANG="nl" + LOCALE="nl_NL" + ;; + nn) COUNTRY="no" + SETLANG="nn" + LOCALE="en_US" + ;; + pa) COUNTRY="pa" + SETLANG="pa" + LOCALE="en_US" + ;; + pl) COUNTRY="pl" + SETLANG="pl" + LOCALE="pl_PL" + ;; + pt) COUNTRY="pt" + SETLANG="pt" + LOCALE="pt_PT" + ;; + pt_BR) COUNTRY="br" + SETLANG="pt_BR" + LOCALE="pt_BR" + ;; + ru) COUNTRY="ru" + SETLANG="ru" + LOCALE="ru_RU" + ;; + sl) COUNTRY="si" + SETLANG="sl" + LOCALE="sl_SI" + ;; + sk) COUNTRY="sk" + SETLANG="sk" + LOCALE="sk_SK" + ;; + sv) COUNTRY="se" + SETLANG="sv" + LOCALE="sv_SE" + ;; + uk) COUNTRY="ua" + SETLANG="uk" + LOCALE="uk_UA" + ;; + vi) COUNTRY="vn" + SETLANG="vi" + LOCALE="en_US" + ;; + zh_CN) COUNTRY="cn" + SETLANG="zh_CN" + LOCALE="zh_CN" + ;; + zh_TW) COUNTRY="tw" + SETLANG="zh_TW" + LOCALE="zh_TW" + ;; + *) COUNTRY="C" + SETLANG="${TARGETLANG}" + LOCALE="en_US" + ;; + esac + + export COUNTRY SETLANG LOCALE + +}; + +# Function which sets the timezone on the system +set_timezone() +{ + TZONE="$1" + cp ${FSMNT}/usr/share/zoneinfo/${TZONE} ${FSMNT}/etc/localtime +}; + +# Function which enables / disables NTP +set_ntp() +{ + ENABLED="$1" + if [ "$ENABLED" = "yes" -o "${ENABLED}" = "YES" ] + then + cat ${FSMNT}/etc/rc.conf 2>/dev/null | grep 'ntpd_enable="YES"' >/dev/null 2>/dev/null + if [ "$?" != "0" ] + then + echo 'ntpd_enable="YES"' >>${FSMNT}/etc/rc.conf + echo 'ntpd_sync_on_start="YES"' >>${FSMNT}/etc/rc.conf + fi + else + cat ${FSMNT}/etc/rc.conf 2>/dev/null | grep 'ntpd_enable="YES"' >/dev/null 2>/dev/null + if [ "$?" != "0" ] + then + sed -i.bak 's|ntpd_enable="YES"||g' ${FSMNT}/etc/rc.conf + fi + fi +}; + +# Starts checking for localization directives +run_localize() +{ + KEYLAYOUT="NONE" + KEYMOD="NONE" + KEYVAR="NONE" + LANGUAGE="NONE" + + while read line + do + # Check if we need to do any localization + echo $line | grep "^localizeLang=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + + # Set our country / lang / locale variables + get_value_from_string "$line" + localize_get_codes ${VAL} + + get_value_from_string "$line" + # If we are doing PC-BSD install, localize it as well as FreeBSD base + if [ "${INSTALLTYPE}" != "FreeBSD" ] + then + localize_pcbsd "$VAL" + LANGUAGE="$VAL" + fi + localize_freebsd "$VAL" + fi + + # Check if we need to do any keylayouts + echo $line | grep "^localizeKeyLayout=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + get_value_from_string "$line" + KEYLAYOUT="$VAL" + fi + + # Check if we need to do any key models + echo $line | grep "^localizeKeyModel=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + get_value_from_string "$line" + KEYMOD="$VAL" + fi + + # Check if we need to do any key variant + echo $line | grep "^localizeKeyVariant=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + get_value_from_string "$line" + KEYVAR="$VAL" + fi + + + # Check if we need to set a timezone + echo $line | grep "^timeZone=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + get_value_from_string "$line" + set_timezone "$VAL" + fi + + # Check if we need to set a timezone + echo $line | grep "^enableNTP=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + get_value_from_string "$line" + set_ntp "$VAL" + fi + done <${CFGF} + + if [ "${INSTALLTYPE}" != "FreeBSD" ] ; then + # Do our X keyboard localization + localize_x_keyboard "${KEYMOD}" "${KEYLAYOUT}" "${KEYVAR}" "${COUNTRY}" + fi + + # Check if we want to prunt any other KDE lang files to save some disk space + get_value_from_cfg localizePrune + if [ "${VAL}" = "yes" -o "${VAL}" = "YES" ] ; then + localize_prune_langs + fi + + # Update the login.conf db, even if we didn't localize, its a good idea to make sure its up2date + run_chroot_cmd "/usr/bin/cap_mkdb /etc/login.conf" >/dev/null 2>/dev/null + +}; diff --git a/PCBSD/pc-sysinstall/backend/functions-mountdisk.sh b/PCBSD/pc-sysinstall/backend/functions-mountdisk.sh new file mode 100644 index 0000000..112e299 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/functions-mountdisk.sh @@ -0,0 +1,164 @@ +#!/bin/sh +# Functions related mounting the newly formatted disk partitions + +# Mounts all the specified partition to the mount-point +mount_partition() +{ + if [ -z "${1}" -o -z "${2}" -o -z "${3}" ] + then + exit_err "ERROR: Missing arguments for mount_partition" + fi + + PART="${1}" + PARTFS="${2}" + MNTPOINT="${3}" + MNTFLAGS="${4}" + + # Setup the MNTOPTS + if [ -z "${MNTOPTS}" ] + then + MNTFLAGS="-o rw" + else + MNTFLAGS="-o rw,${MNTFLAGS}" + fi + + + #We are on ZFS, lets setup this mount-point + if [ "${PARTFS}" = "ZFS" ] + then + ZPOOLNAME=$(get_zpool_name "${PART}") + + # Check if we have multiple zfs mounts specified + for ZMNT in `echo ${MNTPOINT} | sed 's|,| |g'` + do + # First make sure we create the mount point + if [ ! -d "${FSMNT}${ZMNT}" ] ; then + mkdir -p ${FSMNT}${ZMNT} >>${LOGOUT} 2>>${LOGOUT} + fi + + if [ "${ZMNT}" = "/" ] ; then + ZNAME="" + else + ZNAME="${ZMNT}" + echo_log "zfs create -p ${ZPOOLNAME}${ZNAME}" + rc_halt "zfs create -p ${ZPOOLNAME}${ZNAME}" + fi + sleep 2 + rc_halt "zfs set mountpoint=${FSMNT}${ZNAME} ${ZPOOLNAME}${ZNAME}" + + # Disable atime for this zfs partition, speed increase + rc_nohalt "zfs set atime=off ${ZPOOLNAME}${ZNAME}" + done + + else + # If we are not on ZFS, lets do the mount now + # First make sure we create the mount point + if [ ! -d "${FSMNT}${MNTPOINT}" ] + then + mkdir -p ${FSMNT}${MNTPOINT} >>${LOGOUT} 2>>${LOGOUT} + fi + + echo_log "mount ${MNTFLAGS} /dev/${PART} -> ${FSMNT}${MNTPOINT}" + sleep 2 + rc_halt "mount ${MNTFLAGS} /dev/${PART} ${FSMNT}${MNTPOINT}" + fi + +}; + +# Mounts all the new file systems to prepare for installation +mount_all_filesystems() +{ + # Make sure our mount point exists + mkdir -p ${FSMNT} >/dev/null 2>/dev/null + + # First lets find and mount the / partition + ######################################################### + for PART in `ls ${PARTDIR}` + do + if [ ! -e "/dev/${PART}" ] + then + exit_err "ERROR: The partition ${PART} does not exist. Failure in bsdlabel?" + fi + + PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`" + PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`" + PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`" + + if [ "${PARTENC}" = "ON" ] + then + EXT=".eli" + else + EXT="" + fi + + # Check for root partition for mounting, including ZFS "/,/usr" type + echo "$PARTMNT" | grep "/," >/dev/null + if [ "$?" = "0" -o "$PARTMNT" = "/" ] + then + case ${PARTFS} in + UFS) mount_partition ${PART}${EXT} ${PARTFS} ${PARTMNT} "noatime" + ;; + UFS+S) mount_partition ${PART}${EXT} ${PARTFS} ${PARTMNT} "noatime" + ;; + UFS+J) mount_partition ${PART}${EXT}.journal ${PARTFS} ${PARTMNT} "async,noatime" + ;; + ZFS) mount_partition ${PART} ${PARTFS} ${PARTMNT} + ;; + *) exit_err "ERROR: Got unknown file-system type $PARTFS" ;; + esac + + fi + + done + + # Now that we've mounted "/" lets do any other remaining mount-points + ################################################################## + for PART in `ls ${PARTDIR}` + do + if [ ! -e "/dev/${PART}" ] + then + exit_err "ERROR: The partition ${PART} does not exist. Failure in bsdlabel?" + fi + + PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`" + PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`" + PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`" + + if [ "${PARTENC}" = "ON" ] + then + EXT=".eli" + else + EXT="" + fi + + # Check if we've found "/" again, don't need to mount it twice + echo "$PARTMNT" | grep "/," >/dev/null + if [ "$?" != "0" -a "$PARTMNT" != "/" ] + then + case ${PARTFS} in + UFS) mount_partition ${PART}${EXT} ${PARTFS} ${PARTMNT} "noatime" + ;; + UFS+S) mount_partition ${PART}${EXT} ${PARTFS} ${PARTMNT} "noatime" + ;; + UFS+J) mount_partition ${PART}${EXT}.journal ${PARTFS} ${PARTMNT} "async,noatime" + ;; + ZFS) mount_partition ${PART} ${PARTFS} ${PARTMNT} + ;; + SWAP) # Lets enable this swap now + if [ "$PARTENC" = "ON" ] + then + echo_log "Enabling encrypted swap on /dev/${PART}" + rc_halt "geli onetime -d -e 3des ${PART}" + sleep 5 + rc_halt "swapon /dev/${PART}.eli" + else + echo_log "swapon ${PART}" + sleep 5 + rc_halt "swapon /dev/${PART}" + fi + ;; + *) exit_err "ERROR: Got unknown file-system type $PARTFS" ;; + esac + fi + done +}; diff --git a/PCBSD/pc-sysinstall/backend/functions-mountoptical.sh b/PCBSD/pc-sysinstall/backend/functions-mountoptical.sh new file mode 100644 index 0000000..c4c324d --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/functions-mountoptical.sh @@ -0,0 +1,126 @@ +#!/bin/sh +# Functions which perform mounting / unmounting and switching of optical / usb media + +. ${BACKEND}/functions.sh +. ${BACKEND}/functions-parse.sh + +# Displays an optical failure message +opt_fail() +{ + # If we got here, we must not have a DVD/USB we can find :( + get_value_from_cfg installInteractive + if [ "${VAL}" = "yes" ] + then + # We are running interactive, and didn't find a DVD, prompt user again + echo_log "DISK ERROR: Unable to find installation disk!" + echo_log "Please insert the installation disk and press enter." + read tmp + else + exit_err "ERROR: Unable to locate installation DVD/USB" + fi +}; + +# Performs the extraction of data to disk +opt_mount() +{ + FOUND="0" + + # Ensure we have a directory where its supposed to be + if [ ! -d "${CDMNT}" ] + then + mkdir -p ${CDMNT} + fi + + + # Start by checking if we already have a cd mounted at CDMNT + mount | grep "${CDMNT} " >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + if [ -e "${CDMNT}/${INSFILE}" ] + then + echo "MOUNTED" >${TMPDIR}/cdmnt + echo_log "FOUND DVD: MOUNTED" + FOUND="1" + return + fi + + # failed to find optical disk + opt_fail + return + fi + +# Setup our loop to search for installation media + while + z=1 + do + + # Loop though and look for an installation disk + for i in `ls -1 /dev/acd* /dev/cd* /dev/scd* /dev/rscd* 2>/dev/null` + do + # Find the CD Device + /sbin/mount_cd9660 $i ${CDMNT} + + # Check the package type to see if we have our install data + if [ -e "${CDMNT}/${INSFILE}" ] + then + echo "${i}" >${TMPDIR}/cdmnt + echo_log "FOUND DVD: ${i}" + FOUND="1" + break + fi + /sbin/umount ${CDMNT} >/dev/null 2>/dev/null + done + + # If no DVD found, try USB + if [ "$FOUND" != "1" ] + then + # Loop though and look for an installation disk + for i in `ls -1 /dev/da* 2>/dev/null` + do + # Check if we can mount this device UFS + /sbin/mount -r $i ${CDMNT} + + # Check the package type to see if we have our install data + if [ -e "${CDMNT}/${INSFILE}" ] + then + echo "${i}" >${TMPDIR}/cdmnt + echo_log "FOUND USB: ${i}" + FOUND="1" + break + fi + /sbin/umount ${CDMNT} >/dev/null 2>/dev/null + + # Also check if it is a FAT mount + /sbin/mount -r -t msdosfs $i ${CDMNT} + + # Check the package type to see if we have our install data + if [ -e "${CDMNT}/${INSFILE}" ] + then + echo "${i}" >${TMPDIR}/cdmnt + echo_log "FOUND USB: ${i}" + FOUND="1" + break + fi + /sbin/umount ${CDMNT} >/dev/null 2>/dev/null + done + fi # End of USB Check + + + if [ "$FOUND" = "1" ] + then + break + fi + + # Failed to find a disk, take action now + opt_fail + + done + +}; + +# Function to unmount optical media +opt_umount() +{ + /sbin/umount ${CDMNT} >/dev/null 2>/dev/null +}; + diff --git a/PCBSD/pc-sysinstall/backend/functions-networking.sh b/PCBSD/pc-sysinstall/backend/functions-networking.sh new file mode 100644 index 0000000..eca2321 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/functions-networking.sh @@ -0,0 +1,330 @@ +#!/bin/sh +# Functions which perform our networking setup + +# Function which creates a kde4 .desktop file for the PC-BSD net tray +create_desktop_nettray() +{ + NIC="${1}" + echo "#!/usr/bin/env xdg-open +[Desktop Entry] +Exec=/usr/local/kde4/bin/pc-nettray ${NIC} +Icon=network +StartupNotify=false +Type=Application" > ${FSMNT}/usr/share/skel/.kde4/Autostart/tray-${NIC}.desktop + chmod 744 ${FSMNT}/usr/share/skel/.kde4/Autostart/tray-${NIC}.desktop + +}; + +# Function which checks is a nic is wifi or not +check_is_wifi() +{ + NIC="$1" + ifconfig ${NIC} | grep "802.11" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + return 0 + else + return 1 + fi +}; + +# Function to get the first available wired nic, used for lagg0 setup +get_first_wired_nic() +{ + rm ${TMPDIR}/.niclist >/dev/null 2>/dev/null + # start by getting a list of nics on this system + ${QUERYDIR}/detect-nics.sh > ${TMPDIR}/.niclist + if [ -e "${TMPDIR}/.niclist" ] + then + while read line + do + NIC="`echo $line | cut -d ':' -f 1`" + check_is_wifi ${NIC} + if [ "$?" != "0" ] + then + VAL="${NIC}" ; export VAL + return + fi + done < ${TMPDIR}/.niclist + fi + + VAL="" ; export VAL + return +}; + +# Function which simply enables plain dhcp on all detected nics, not fancy lagg interface +enable_plain_dhcp_all() +{ + rm ${TMPDIR}/.niclist >/dev/null 2>/dev/null + # start by getting a list of nics on this system + ${QUERYDIR}/detect-nics.sh > ${TMPDIR}/.niclist + if [ -e "${TMPDIR}/.niclist" ] + then + echo "# Auto-Enabled NICs from pc-sysinstall" >>${FSMNT}/etc/rc.conf + WLANCOUNT="0" + while read line + do + NIC="`echo $line | cut -d ':' -f 1`" + DESC="`echo $line | cut -d ':' -f 2`" + echo_log "Setting $NIC to DHCP on the system." + check_is_wifi ${NIC} + if [ "$?" = "0" ] + then + # We have a wifi device, setup a wlan* entry for it + WLAN="wlan${WLANCOUNT}" + echo "wlans_${NIC}=\"${WLAN}\"" >>${FSMNT}/etc/rc.conf + echo "ifconfig_${WLAN}=\"DHCP\"" >>${FSMNT}/etc/rc.conf + CNIC="${WLAN}" + WLANCOUNT="`expr ${WLANCOUNT} + 1`" + else + echo "ifconfig_${NIC}=\"DHCP\"" >>${FSMNT}/etc/rc.conf + CNIC="${NIC}" + fi + + done < ${TMPDIR}/.niclist + fi +}; + +# Function which enables fancy lagg dhcp on specified wifi +enable_lagg_dhcp() +{ + WIFINIC="$1" + + # Get the first wired nic + get_first_wired_nic + WIRENIC=$VAL + LAGGPORT="laggport ${WIFINIC}" + + echo "# Auto-Enabled NICs from pc-sysinstall" >>${FSMNT}/etc/rc.conf + if [ ! -z "$WIRENIC" ] + then + echo "ifconfig_${WIRENIC}=\"up\"" >> ${FSMNT}/etc/rc.conf + echo "ifconfig_${WIFINIC}=\"\`ifconfig ${WIRENIC} ether\`\"" >> ${FSMNT}/etc/rc.conf + echo "ifconfig_${WIFINIC}=\"ether \${ifconfig_${WIFINIC}##*ether }\"" >> ${FSMNT}/etc/rc.conf + LAGGPORT="laggport ${WIRENIC} ${LAGGPORT}" + fi + + echo "wlans_${WIFINIC}=\"wlan0\"" >> ${FSMNT}/etc/rc.conf + echo "cloned_interfaces=\"lagg0\"" >> ${FSMNT}/etc/rc.conf + echo "ifconfig_lagg0=\"laggproto failover ${LAGGPORT} DHCP\"" >> ${FSMNT}/etc/rc.conf + +}; + +# Function which detects available nics, and runs them to DHCP on the +save_auto_dhcp() +{ + rm ${TMPDIR}/.niclist >/dev/null 2>/dev/null + # start by getting a list of nics on this system + ${QUERYDIR}/detect-nics.sh > ${TMPDIR}/.niclist + if [ -e "${TMPDIR}/.niclist" ] + then + while read line + do + NIC="`echo $line | cut -d ':' -f 1`" + DESC="`echo $line | cut -d ':' -f 2`" + check_is_wifi "${NIC}" + if [ "$?" = "0" ] + then + # We have a wifi device, lets do fancy lagg interface + enable_lagg_dhcp "${NIC}" + return + fi + + done < ${TMPDIR}/.niclist + fi + + # Got here, looks like no wifi, so lets simply enable plain-ole-dhcp + enable_plain_dhcp_all + +}; + + +# Function which saves a manual nic setup to the installed system +save_manual_nic() +{ + # Get the target nic + NIC="$1" + + get_value_from_cfg netSaveIP + NETIP="${VAL}" + + if [ "$NETIP" = "DHCP" ] + then + echo_log "Setting $NIC to DHCP on the system." + echo "ifconfig_${NIC}=\"DHCP\"" >>${FSMNT}/etc/rc.conf + return 0 + fi + + # If we get here, we have a manual setup, lets do so now + + # Set the manual IP + IFARGS="inet ${NETIP}" + + # Check if we have a netmask to set + get_value_from_cfg netSaveMask + NETMASK="${VAL}" + if [ ! -z "${NETMASK}" ] + then + IFARGS="${IFARGS} netmask ${NETMASK}" + fi + + + echo "# Auto-Enabled NICs from pc-sysinstall" >>${FSMNT}/etc/rc.conf + echo "ifconfig_${NIC}=\"${IFARGS}\"" >>${FSMNT}/etc/rc.conf + + # Check if we have a default router to set + get_value_from_cfg netSaveDefaultRouter + NETROUTE="${VAL}" + if [ ! -z "${NETROUTE}" ] + then + echo "defaultrouter=\"${NETROUTE}\"" >>${FSMNT}/etc/rc.conf + fi + + # Check if we have a nameserver to enable + get_value_from_cfg netSaveNameServer + NAMESERVER="${VAL}" + if [ ! -z "${NAMESERVER}" ] + then + echo "nameserver ${NAMESERVER}" >${FSMNT}/etc/resolv.conf + fi + +}; + +# Function which determines if a nic is active / up +is_nic_active() +{ + ifconfig ${1} | grep "status: active" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + return 0 + else + return 1 + fi +}; + + +# Function which detects available nics, and runs DHCP on them until +# a success is found +enable_auto_dhcp() +{ + # start by getting a list of nics on this system + ${QUERYDIR}/detect-nics.sh > ${TMPDIR}/.niclist + while read line + do + NIC="`echo $line | cut -d ':' -f 1`" + DESC="`echo $line | cut -d ':' -f 2`" + + is_nic_active "${NIC}" + if [ "$?" = "0" ] ; then + echo_log "Trying DHCP on $NIC $DESC" + dhclient ${NIC} >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + # Got a valid DHCP IP, we can return now + WRKNIC="$NIC" ; export WRKNIC + return 0 + fi + fi + done < ${TMPDIR}/.niclist + +}; + +# Get the mac address of a target NIC +get_nic_mac() { + FOUNDMAC="`ifconfig ${1} | grep 'ether' | tr -d '\t' | cut -d ' ' -f 2`" + export FOUNDMAC +} + +# Function which performs the manual setup of a target nic in the cfg +enable_manual_nic() +{ + # Get the target nic + NIC="$1" + + # Check that this NIC exists + rc_halt "ifconfig ${NIC}" + + get_value_from_cfg netIP + NETIP="${VAL}" + + if [ "$NETIP" = "DHCP" ] + then + echo_log "Enabling DHCP on $NIC" + rc_halt "dhclient ${NIC}" + return 0 + fi + + # If we get here, we have a manual setup, lets do so now + + # Set the manual IP + rc_halt "ifconfig ${NIC} ${NETIP}" + + # Check if we have a netmask to set + get_value_from_cfg netMask + NETMASK="${VAL}" + if [ ! -z "${NETMASK}" ] + then + rc_halt "ifconfig ${NIC} netmask ${NETMASK}" + fi + + # Check if we have a default router to set + get_value_from_cfg netDefaultRouter + NETROUTE="${VAL}" + if [ ! -z "${NETROUTE}" ] + then + rc_halt "route add default ${NETROUTE}" + fi + + # Check if we have a nameserver to enable + get_value_from_cfg netNameServer + NAMESERVER="${VAL}" + if [ ! -z "${NAMESERVER}" ] + then + echo "nameserver ${NAMESERVER}" >/etc/resolv.conf + fi + + +}; + + +# Function which parses the cfg and enables networking per specified +start_networking() +{ + # Check if we have any networking requested + get_value_from_cfg netDev + if [ -z "${VAL}" ] + then + return 0 + fi + + NETDEV="${VAL}" + if [ "$NETDEV" = "AUTO-DHCP" ] + then + enable_auto_dhcp + else + enable_manual_nic ${NETDEV} + fi + +}; + + +# Function which checks the cfg and enables the specified networking on +# the installed system +save_networking_install() +{ + + # Check if we have any networking requested to save + get_value_from_cfg netSaveDev + if [ -z "${VAL}" ] + then + return 0 + fi + + NETDEV="${VAL}" + if [ "$NETDEV" = "AUTO-DHCP" ] + then + save_auto_dhcp + else + save_manual_nic ${NETDEV} + fi + +}; + diff --git a/PCBSD/pc-sysinstall/backend/functions-newfs.sh b/PCBSD/pc-sysinstall/backend/functions-newfs.sh new file mode 100644 index 0000000..b1f7f3a --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/functions-newfs.sh @@ -0,0 +1,142 @@ +#!/bin/sh +# Functions related to disk operations using newfs + + +# Function which performs the ZFS magic +setup_zfs_filesystem() +{ + PART="$1" + PARTFS="$2" + PARTMNT="$3" + EXT="$4" + PARTGEOM="$5" + ZPOOLOPTS="$6" + ROOTSLICE="`echo ${PART} | rev | cut -b 2- | rev`" + ZPOOLNAME=$(get_zpool_name "${PART}") + + # Sleep a few moments, let the disk catch its breath + sleep 5 + sync + + # Check if we have some custom zpool arguments and use them if so + if [ ! -z "${ZPOOLOPTS}" ] ; then + rc_halt "zpool create -m none -f ${ZPOOLNAME} ${ZPOOLOPTS}" + else + # No zpool options, create pool on single device + rc_halt "zpool create -m none -f ${ZPOOLNAME} ${PART}${EXT}" + fi + + # Disable atime for this zfs partition, speed increase + rc_nohalt "zfs set atime=off ${ZPOOLNAME}" + + # Check if we have multiple zfs mounts specified + for i in `echo ${PARTMNT} | sed 's|,| |g'` + do + # Check if we ended up with needing a zfs bootable partition + if [ "${i}" = "/" -o "${i}" = "/boot" ] + then + if [ "${PARTGEOM}" = "MBR" ] + then + # Lets stamp the proper ZFS boot loader + echo_log "Setting up ZFS boot loader support" + rc_halt "zpool set bootfs=${ZPOOLNAME} ${ZPOOLNAME}" + rc_halt "zpool export ${${ZPOOLNAME}" + rc_halt "dd if=/boot/zfsboot of=/dev/${ROOTSLICE} count=1" + rc_halt "dd if=/boot/zfsboot of=/dev/${PART}${EXT} skip=1 seek=1024" + rc_halt "zpool import ${ZPOOLNAME}" + fi + fi + done + +}; + +# Runs newfs on all the partiions which we've setup with bsdlabel +setup_filesystems() +{ + + # Create the keydir + rm -rf ${GELIKEYDIR} >/dev/null 2>/dev/null + mkdir ${GELIKEYDIR} + + # Lets go ahead and read through the saved partitions we created, and determine if we need to run + # newfs on any of them + for PART in `ls ${PARTDIR}` + do + if [ ! -e "/dev/${PART}" ] + then + exit_err "ERROR: The partition ${PART} does not exist. Failure in bsdlabel?" + fi + + PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`" + PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`" + PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`" + PARTLABEL="`cat ${PARTDIR}/${PART} | cut -d ':' -f 4`" + PARTGEOM="`cat ${PARTDIR}/${PART} | cut -d ':' -f 5`" + PARTXTRAOPTS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 6`" + + # Make sure journaling isn't enabled on this device + if [ -e "/dev/${PART}.journal" ] + then + rc_nohalt "gjournal stop -f ${PART}.journal" + rc_nohalt "gjournal clear ${PART}" + fi + + # Setup encryption if necessary + if [ "${PARTENC}" = "ON" -a "${PARTFS}" != "SWAP" ] + then + echo_log "Creating geli provider for ${PART}" + rc_halt "dd if=/dev/random of=${GELIKEYDIR}/${PART}.key bs=64 count=1" + rc_halt "geli init -b -s 4096 -P -K ${GELIKEYDIR}/${PART}.key /dev/${PART}" + rc_halt "geli attach -p -k ${GELIKEYDIR}/${PART}.key /dev/${PART}" + + EXT=".eli" + else + # No Encryption + EXT="" + fi + + case ${PARTFS} in + UFS) echo_log "NEWFS: /dev/${PART} - ${PARTFS}" + sleep 2 + rc_halt "newfs /dev/${PART}${EXT}" + sleep 2 + rc_halt "sync" + rc_halt "glabel label ${PARTLABEL} /dev/${PART}${EXT}" + rc_halt "sync" + sleep 2 + ;; + UFS+S) echo_log "NEWFS: /dev/${PART} - ${PARTFS}" + sleep 2 + rc_halt "newfs -U /dev/${PART}${EXT}" + sleep 2 + rc_halt "sync" + rc_halt "glabel label ${PARTLABEL} /dev/${PART}${EXT}" + rc_halt "sync" + sleep 2 + ;; + UFS+J) echo_log "NEWFS: /dev/${PART} - ${PARTFS}" + sleep 2 + rc_halt "newfs /dev/${PART}${EXT}" + sleep 2 + rc_halt "gjournal label -f /dev/${PART}${EXT}" + sleep 2 + rc_halt "newfs -O 2 -J /dev/${PART}${EXT}.journal" + sleep 2 + rc_halt "sync" + rc_halt "glabel label ${PARTLABEL} /dev/${PART}${EXT}.journal" + rc_halt "sync" + sleep 2 + ;; + ZFS) echo_log "NEWFS: /dev/${PART} - ${PARTFS}" + setup_zfs_filesystem "${PART}" "${PARTFS}" "${PARTMNT}" "${EXT}" "${PARTGEOM}" "${PARTXTRAOPTS}" + ;; + SWAP) rc_halt "sync" + rc_halt "glabel label ${PARTLABEL} /dev/${PART}${EXT}" + rc_halt "sync" + sleep 2 + ;; + *) exit_err "ERROR: Got unknown file-system type $PARTFS" ;; + esac + + done +}; diff --git a/PCBSD/pc-sysinstall/backend/functions-parse.sh b/PCBSD/pc-sysinstall/backend/functions-parse.sh new file mode 100644 index 0000000..1fa138d --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/functions-parse.sh @@ -0,0 +1,205 @@ +#!/bin/sh +# functions.sh +# Library of functions which pc-sysinstall may call upon for parsing the config + +# which gets the value of a setting in the provided line +get_value_from_string() +{ + if [ ! -z "${1}" ] + then + VAL="`echo ${1} | cut -d '=' -f 2`" + export VAL + else + echo "Error: Did we forgot to supply a string to parse?" + exit 1 + fi +}; + +# Get the value from the cfg file including spaces +get_value_from_cfg_with_spaces() +{ + if [ ! -z "${1}" ] + then + VAL=`grep "^${1}=" ${CFGF} | head -n 1 | cut -d '=' -f 2` + export VAL + else + exit_err "Error: Did we forgot to supply a setting to grab?" + fi +}; + + +# Get the value from the cfg file +get_value_from_cfg() +{ + if [ ! -z "${1}" ] + then + VAL=`grep "^${1}=" ${CFGF} | head -n 1 | cut -d '=' -f 2 | tr -d ' '` + export VAL + else + exit_err "Error: Did we forgot to supply a setting to grab?" + fi +}; + +# Checks the value of a setting in the provided line with supplied possibilities +# 1 = setting we are checking, 2 = list of valid values +if_check_value_exists() +{ + if [ ! -z "${1}" -a ! -z "${2}" ] + then + # Get the first occurance of the setting from the config, strip out whitespace + + VAL=`grep "^${1}" ${CFGF} | head -n 1 | cut -d '=' -f 2 | tr -d ' '` + if [ -z "${VAL}" ] + then + # This value doesn't exist, lets return + return 0 + fi + + + VALID="1" + for i in ${2} + do + if [ "$VAL" = "${i}" ] + then + VALID="0" + fi + done + if [ "$VALID" = "1" ] + then + exit_err "Error: ${1} is set to unknown value $VAL" + fi + else + exit_err "Error: Did we forgot to supply a string to parse and setting to grab?" + fi +}; + +# Checks the value of a setting in the provided line with supplied possibilities +# 1 = setting we are checking, 2 = list of valid values +check_value() +{ + if [ ! -z "${1}" -a ! -z "${2}" ] + then + # Get the first occurance of the setting from the config, strip out whitespace + VAL=`grep "^${1}" ${CFGF} | head -n 1 | cut -d '=' -f 2 | tr -d ' '` + VALID="1" + for i in ${2} + do + if [ "$VAL" = "${i}" ] + then + VALID="0" + fi + done + if [ "$VALID" = "1" ] + then + exit_err "Error: ${1} is set to unknown value $VAL" + fi + else + exit_err "Error: Did we forgot to supply a string to parse and setting to grab?" + fi +}; + +# Checks for the presense of the supplied arguements in the config file +# 1 = values to confirm exist +file_sanity_check() +{ + if [ ! -z "$CFGF" -a ! -z "$1" ] + then + for i in $1 + do + grep "^${i}=" $CFGF >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + LN=`grep "^${i}=" ${CFGF} | head -n 1 | cut -d '=' -f 2 | tr -d ' '` + if [ -z "${LN}" ] + then + echo "Error: Config fails sanity test! ${i}= is empty" + exit 1 + fi + else + echo "Error: Config fails sanity test! Missing ${i}=" + exit 1 + fi + done + else + echo "Error: Missing config file, and / or values to sanity check for!" + exit 1 + fi +}; + + +# Function which merges the contents of a new config into the specified old one +# Only works with <val>= type configurations +merge_config() +{ + OLDCFG="${1}" + NEWCFG="${2}" + FINALCFG="${3}" + + # Copy our oldcfg to the new one, which will be used as basis + cp ${OLDCFG} ${FINALCFG} + + # Remove blank lines from new file + cat ${NEWCFG} | sed '/^$/d' > ${FINALCFG}.tmp + + # Set our marker if we've found any + FOUNDMERGE="NO" + + while read newline + do + echo ${newline} | grep "^#" >/dev/null 2>/dev/null + if [ "$?" != "0" ] ; then + VAL="`echo ${newline} | cut -d '=' -f 1`" + cat ${OLDCFG} | grep ${VAL} >/dev/null 2>/dev/null + if [ "$?" != "0" ] ; then + if [ "${FOUNDMERGE}" = "NO" ] ; then + echo "" >> ${FINALCFG} + echo "# Auto-merged values from newer ${NEWCFG}" >> ${FINALCFG} + FOUNDMERGE="YES" + fi + echo "${newline}" >> ${FINALCFG} + fi + fi + done < ${FINALCFG}.tmp + rm ${FINALCFG}.tmp + +}; + +# Loop to check for a specified mount-point in a list +check_for_mount() +{ + MNTS="${1}" + FINDMNT="${2}" + + # Check if we found a valid root partition + for CHECKMNT in `echo ${MNTS} | sed 's|,| |g'` + do + if [ "${CHECKMNT}" = "${FINDMNT}" ] ; then + return 0 + fi + done + + return 1 +}; + +# Function which returns the next line in the specified config file +get_next_cfg_line() +{ + CURFILE="$1" + CURLINE="$2" + + FOUND="1" + + while read line + do + if [ "$FOUND" = "0" ] ; then + VAL="$line" ; export VAL + return + fi + if [ "$line" = "${CURLINE}" ] ; then + FOUND="0" + fi + done <${CURFILE} + + # Got here, couldn't find this line or at end of file, set VAL to "" + VAL="" ; export VAL +}; diff --git a/PCBSD/pc-sysinstall/backend/functions-runcommands.sh b/PCBSD/pc-sysinstall/backend/functions-runcommands.sh new file mode 100644 index 0000000..307119d --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/functions-runcommands.sh @@ -0,0 +1,76 @@ +#!/bin/sh +# Functions which runs commands on the system + +. ${BACKEND}/functions.sh +. ${BACKEND}/functions-parse.sh + +run_chroot_cmd() +{ + CMD="$@" + echo_log "Running chroot command: ${CMD}" + echo "$CMD" >${FSMNT}/.runcmd.sh + chmod 755 ${FSMNT}/.runcmd.sh + chroot ${FSMNT} sh /.runcmd.sh + rm ${FSMNT}/.runcmd.sh +}; + +run_chroot_script() +{ + SCRIPT="$@" + SBASE=`basename $SCRIPT` + + cp ${SCRIPT} ${FSMNT}/.$SBASE + chmod 755 ${FSMNT}/.${SBASE} + + echo_log "Running chroot script: ${SCRIPT}" + chroot ${FSMNT} /.${SBASE} + + rm ${FSMNT}/.${SBASE} +}; + + +run_ext_cmd() +{ + CMD="$@" + # Make sure to export FSMNT, in case cmd needs it + export FSMNT + echo_log "Running external command: ${CMD}" + echo "${CMD}"> ${TMPDIR}/.runcmd.sh + chmod 755 ${TMPDIR}/.runcmd.sh + sh ${TMPDIR}/.runcmd.sh + rm ${TMPDIR}/.runcmd.sh +}; + + +# Starts the user setup +run_commands() +{ + while read line + do + # Check if we need to run any chroot command + echo $line | grep ^runCommand= >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + get_value_from_string "$line" + run_chroot_cmd "$VAL" + fi + + # Check if we need to run any chroot script + echo $line | grep ^runScript= >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + get_value_from_string "$line" + run_chroot_script "$VAL" + fi + + # Check if we need to run any chroot command + echo $line | grep ^runExtCommand= >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + get_value_from_string "$line" + run_ext_cmd "$VAL" + fi + + done <${CFGF} + +}; diff --git a/PCBSD/pc-sysinstall/backend/functions-unmount.sh b/PCBSD/pc-sysinstall/backend/functions-unmount.sh new file mode 100644 index 0000000..abd2491 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/functions-unmount.sh @@ -0,0 +1,175 @@ +#!/bin/sh +# Functions which unmount all mounted disk filesystems + +# Script that adds our gmirror devices for syncing +start_gmirror_sync() +{ + + cd ${MIRRORCFGDIR} + for DISK in `ls *` + do + MIRRORDISK="`cat ${DISK} | cut -d ':' -f 1`" + MIRRORBAL="`cat ${DISK} | cut -d ':' -f 2`" + MIRRORNAME="`cat ${DISK} | cut -d ':' -f 3`" + + # Start the mirroring service + rc_halt "gmirror insert ${MIRRORNAME} /dev/${MIRRORDISK}" + + done + +}; + +# Unmounts all our mounted file-systems +unmount_all_filesystems() +{ + # Copy the logfile to disk before we unmount + cp ${LOGOUT} ${FSMNT}/root/pc-sysinstall.log + cd / + + # Start by unmounting any ZFS partitions + zfs_cleanup_unmount + + # Lets read our partition list, and unmount each + ################################################################## + for PART in `ls ${PARTDIR}` + do + + PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`" + PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`" + PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`" + PARTLABEL="`cat ${PARTDIR}/${PART} | cut -d ':' -f 4`" + + if [ "${PARTENC}" = "ON" ] + then + EXT=".eli" + else + EXT="" + fi + + #if [ "${PARTFS}" = "SWAP" ] + #then + # rc_nohalt "swapoff /dev/${PART}${EXT}" + #fi + + # Check if we've found "/", and unmount that last + if [ "$PARTMNT" != "/" -a "${PARTMNT}" != "none" -a "${PARTFS}" != "ZFS" ] + then + rc_halt "umount -f /dev/${PART}${EXT}" + + # Re-check if we are missing a label for this device and create it again if so + if [ ! -e "/dev/label/${PARTLABEL}" ] + then + case ${PARTFS} in + UFS) glabel label ${PARTLABEL} /dev/${PART}${EXT} ;; + UFS+S) glabel label ${PARTLABEL} /dev/${PART}${EXT} ;; + UFS+J) glabel label ${PARTLABEL} /dev/${PART}${EXT}.journal ;; + *) ;; + esac + fi + fi + + # Check if we've found "/" and make sure the label exists + if [ "$PARTMNT" = "/" -a "${PARTFS}" != "ZFS" ] + then + if [ ! -e "/dev/label/${PARTLABEL}" ] + then + case ${PARTFS} in + UFS) ROOTRELABEL="glabel label ${PARTLABEL} /dev/${PART}${EXT}" ;; + UFS+S) ROOTRELABEL="glabel label ${PARTLABEL} /dev/${PART}${EXT}" ;; + UFS+J) ROOTRELABEL="glabel label ${PARTLABEL} /dev/${PART}${EXT}.journal" ;; + *) ;; + esac + fi + fi + done + + # Last lets the /mnt partition + ######################################################### + rc_nohalt "umount -f ${FSMNT}" + + # If are using a ZFS on "/" set it to legacy + if [ ! -z "${FOUNDZFSROOT}" ] + then + rc_halt "zfs set mountpoint=legacy ${FOUNDZFSROOT}" + fi + + # If we need to relabel "/" do it now + if [ ! -z "${ROOTRELABEL}" ] + then + ${ROOTRELABEL} + fi + + # Unmount our CDMNT + rc_nohalt "umount -f ${CDMNT}" + + # Check if we need to run any gmirror syncing + ls ${MIRRORCFGDIR}/* >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + # Lets start syncing now + start_gmirror_sync + fi + + # Import any pools, so they are active at shutdown and ready to boot potentially + zpool import -a + +}; + +# Unmounts any filesystems after a failure +unmount_all_filesystems_failure() +{ + cd / + + # if we did a fresh install, start unmounting + if [ "${INSTALLMODE}" = "fresh" ] + then + + # Lets read our partition list, and unmount each + ################################################################## + if [ -d "${PARTDIR}" ] + then + for PART in `ls ${PARTDIR}` + do + + PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`" + PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`" + PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`" + + #if [ "${PARTFS}" = "SWAP" ] + #then + # if [ "${PARTENC}" = "ON" ] + # then + # rc_nohalt "swapoff /dev/${PART}.eli" + # else + # rc_nohalt "swapoff /dev/${PART}" + # fi + #fi + + # Check if we've found "/" again, don't need to mount it twice + if [ "$PARTMNT" != "/" -a "${PARTMNT}" != "none" -a "${PARTFS}" != "ZFS" ] + then + rc_nohalt "umount -f /dev/${PART}" + rc_nohalt "umount -f ${FSMNT}${PARTMNT}" + fi + done + + # Last lets the /mnt partition + ######################################################### + rc_nohalt "umount -f ${FSMNT}" + + fi + else + # We are doing a upgrade, try unmounting any of these filesystems + chroot ${FSMNT} /sbin/umount -a >>${LOGOUT} >>${LOGOUT} + umount -f ${FSMNT}/usr >>${LOGOUT} 2>>${LOGOUT} + umount -f ${FSMNT}/dev >>${LOGOUT} 2>>${LOGOUT} + umount -f ${FSMNT} >>${LOGOUT} 2>>${LOGOUT} + rc_nohalt "sh ${TMPDIR}/.upgrade-unmount" + fi + + # Unmount our CDMNT + rc_nohalt "umount ${CDMNT}" + + # Import any pools, so they are active at shutdown and ready to boot potentially + zpool import -a +}; diff --git a/PCBSD/pc-sysinstall/backend/functions-upgrade.sh b/PCBSD/pc-sysinstall/backend/functions-upgrade.sh new file mode 100644 index 0000000..08f80e7 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/functions-upgrade.sh @@ -0,0 +1,259 @@ +#!/bin/sh +# Functions which perform the mounting / unmount for upgrades + + +mount_target_slice() +{ + MPART="${1}" + + # Import any zpools + zpool import -a + + # Set a variable of files we want to make backups of before doing upgrade + BKFILES="/etc/rc.conf /boot/loader.conf" + + if [ -e "/dev/${MPART}a.journal" ] + then + rc_halt "mount /dev/${MPART}.journal ${FSMNT}" + elif [ -e "/dev/${MPART}a" ] + then + mount /dev/${MPART}a ${FSMNT} + if [ "$?" != "0" ] + then + # Try ZFS on this slice + mount -t zfs ${MPART}a ${FSMNT} + if [ "${?}" != "0" ] + then + exit_err "Failed to mount ${MPART}" + fi + fi + fi + + mount -t devfs devfs ${FSMNT}/dev + chroot ${FSMNT} /sbin/mount -a >>${LOGOUT} 2>>${LOGOUT} + chroot ${FSMNT} umount /proc >/dev/null 2>/dev/null + chroot ${FSMNT} umount /compat/linux/proc >/dev/null 2>/dev/null + + # Save which partition was mounted, so we may unmount it later + echo "umount -f /dev/${MPART}a" >>${TMPDIR}/.upgrade-unmount + + # Now before we start the upgrade, make sure we set our noschg flags + echo_log "Cleaning up old filesystem... Please wait..." + rc_halt "chflags -R noschg ${FSMNT}" + + # Make backup copies of some files + for i in ${BKFILES} + do + cp ${FSMNT}${i} ${FSMNT}${i}.preUpgrade >/dev/null 2>/dev/null + done + + # Remove some old dirs + rm -rf ${FSMNT}/etc/rc.d >/dev/null 2>/dev/null + + # If we are doing PC-BSD install, lets cleanup old pkgs on disk + if [ "$INSTALLTYPE" != "FreeBSD" ] + then + echo_log "Removing old packages, this may take a while... Please wait..." + echo '#/bin/sh +for i in `pkg_info -E \*` +do + echo "Uninstalling package: ${i}" + pkg_delete -f ${i} >/dev/null 2>/dev/null +done +' >${FSMNT}/.cleanPkgs.sh + chmod 755 ${FSMNT}/.cleanPkgs.sh + chroot ${FSMNT} /.cleanPkgs.sh + rm ${FSMNT}/.cleanPkgs.sh + run_chroot_cmd "pkg_delete -f \*" >/dev/null 2>/dev/null + run_chroot_cmd "rm -rf /usr/PCBSD" >/dev/null 2>/dev/null + run_chroot_cmd "rm -rf /PCBSD" >/dev/null 2>/dev/null + run_chroot_cmd "rm -rf /var/db/pkgs" >/dev/null 2>/dev/null + run_chroot_cmd "rm -rf /usr/local32" >/dev/null 2>/dev/null + run_chroot_cmd "rm -rf /usr/sbin" >/dev/null 2>/dev/null + run_chroot_cmd "rm -rf /usr/lib" >/dev/null 2>/dev/null + run_chroot_cmd "rm -rf /usr/bin" >/dev/null 2>/dev/null + run_chroot_cmd "rm -rf /boot/kernel" >/dev/null 2>/dev/null + run_chroot_cmd "rm -rf /sbin" >/dev/null 2>/dev/null + run_chroot_cmd "rm -rf /bin" >/dev/null 2>/dev/null + run_chroot_cmd "rm -rf /lib" >/dev/null 2>/dev/null + run_chroot_cmd "rm -rf /libexec" >/dev/null 2>/dev/null + fi + +} + +# Mount the target upgrade partitions +mount_upgrade() +{ + + # Start with disk0 + disknum="0" + + # Make sure we remove the old upgrade-mount script + rm -rf ${TMPDIR}/.upgrade-unmount >/dev/null 2>/dev/null + + # We are ready to start mounting, lets read the config and do it + while read line + do + echo $line | grep "^disk${disknum}=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + + # Found a disk= entry, lets get the disk we are working on + get_value_from_string "${line}" + strip_white_space "$VAL" + DISK="$VAL" + + # Before we go further, lets confirm this disk really exists + if [ ! -e "/dev/${DISK}" ] + then + exit_err "ERROR: The disk ${DISK} does not exist!" + fi + fi + + echo $line | grep "^partition=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + # Found a partition= entry, lets read / set it + get_value_from_string "${line}" + strip_white_space "$VAL" + PTYPE="$VAL" + + # We are using free space, figure out the slice number + if [ "${PTYPE}" = "free" -o "${PTYPE}" = "all" ] + then + exit_err "ERROR: Invalid upgrade partition=${PTYPE}" + fi + fi + + echo $line | grep "^commitDiskPart" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + # Found our flag to commit this disk setup / lets do sanity check and do it + if [ ! -z "${DISK}" -a ! -z "${PTYPE}" ] + then + case ${PTYPE} in + s1|s2|s3|s4) tmpSLICE="${DISK}${PTYPE}a" ;; + *) exit_err "ERROR: Unknown PTYPE: $PTYPE" ;; + esac + + if [ ! -e "/dev/${tmpSLICE}" ] + then + exit_err "ERROR: /dev/${tmpSLICE} does not exist! Mount failed!" + fi + + # Start mounting this slice + mount_target_slice "${DISK}${PTYPE}" + + # Increment our disk counter to look for next disk and unset + unset PTYPE DISK + disknum="`expr $disknum + 1`" + else + exit_err "ERROR: commitDiskPart was called without procceding disk<num>= and partition= entries!!!" + fi + fi + + done <${CFGF} + +}; + +copy_skel_files_upgrade() +{ + + # Now make sure we fix any user profile scripts, which cause problems from 7.x->8.x + echo '#!/bin/sh + +cd /home +for i in `ls` +do + + # Backup the old profile dirs + if [ -d "${i}" ] + then + mv /home/${i}/.kde4 /home/${i}/.kde4.preUpgrade >/dev/null 2>/dev/null + mv /home/${i}/.kde /home/${i}/.kde.preUpgrade >/dev/null 2>/dev/null + mv /home/${i}/.fluxbox /home/${i}/.fluxbox.preUpgrade >/dev/null 2>/dev/null + + # Copy over the skel directories + tar cv --exclude "./dot.*" -f - -C /usr/share/skel . 2>/dev/null | tar xvf - -C /home/${i} 2>/dev/null + + for j in `ls /usr/share/skel/dot*` + do + dname=`echo ${j} | sed s/dot//` + cp /usr/share/skel/${j} /home/${i}/${dname} + done + + chown -R ${i}:${i} /home/${i} + fi + +done +' >${FSMNT}/.fixUserProfile.sh + chmod 755 ${FSMNT}/.fixUserProfile.sh + chroot ${FSMNT} /.fixUserProfile.sh >/dev/null 2>/dev/null + rm ${FSMNT}/.fixUserProfile.sh + + + + # if the user wants to keep their original .kde4 profile + ########################################################################### + get_value_from_cfg "upgradeKeepDesktopProfile" + if [ "$VAL" = "YES" -o "$VAL" = "yes" ] ; then + echo '#!/bin/sh + cd /home +for i in `ls` +do + # Import the old config again + if [ -d "${i}/.kde4.preUpgrade" ] + then + # Copy over the skel directories + tar cv -f - -C /home/${i}/.kde4.preUpgrade . 2>/dev/null | tar xvf - -C /home/${i}/.kde4 2>/dev/null + chown -R ${i}:${i} /home/${i}/.kde4 + fi +done +' >${FSMNT}/.fixUserProfile.sh + chmod 755 ${FSMNT}/.fixUserProfile.sh + chroot ${FSMNT} /.fixUserProfile.sh >/dev/null 2>/dev/null + rm ${FSMNT}/.fixUserProfile.sh + + fi + +}; + +# Function which merges some configuration files with the new defaults +merge_old_configs() +{ + + # Merge the loader.conf with old + cp ${FSMNT}/boot/loader.conf ${FSMNT}/boot/loader.conf.new + merge_config "${FSMNT}/boot/loader.conf.preUpgrade" "${FSMNT}/boot/loader.conf.new" "${FSMNT}/boot/loader.conf" + rm ${FSMNT}/boot/loader.conf.new + + # Merge the rc.conf with old + cp ${FSMNT}/etc/rc.conf ${FSMNT}/etc/rc.conf.new + merge_config "${FSMNT}/etc/rc.conf.preUpgrade" "${FSMNT}/etc/rc.conf.new" "${FSMNT}/etc/rc.conf" + rm ${FSMNT}/etc/rc.conf.new + +}; + +# Function which unmounts all the mounted file-systems +unmount_upgrade() +{ + + # If on PC-BSD, make sure we copy any fixed skel files + if [ "$INSTALLTYPE" != "FreeBSD" ] ; then + copy_skel_files_upgrade + fi + + cd / + + # Unmount FS + chroot ${FSMNT} /sbin/umount -a >/dev/null 2>/dev/null + umount ${FSMNT}/usr >/dev/null 2>/dev/null + umount ${FSMNT}/var >/dev/null 2>/dev/null + umount ${FSMNT}/dev >/dev/null 2>/dev/null + umount ${FSMNT} >/dev/null 2>/dev/null + + # Run our saved unmount script for these file-systems + rc_nohalt "sh ${TMPDIR}/.upgrade-unmount" + + umount ${CDMNT} +}; diff --git a/PCBSD/pc-sysinstall/backend/functions-users.sh b/PCBSD/pc-sysinstall/backend/functions-users.sh new file mode 100644 index 0000000..e413807 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/functions-users.sh @@ -0,0 +1,149 @@ +#!/bin/sh +# Functions which runs commands on the system + +. ${BACKEND}/functions.sh +. ${BACKEND}/functions-parse.sh + + +# Function which checks and sets up auto-login for a user if specified +check_autologin() +{ + get_value_from_cfg autoLoginUser + if [ ! -z "${VAL}" -a "${INSTALLTYPE}" = "PCBSD" ] + then + AUTOU="${VAL}" + # Add the auto-login user line + sed -i.bak "s/AutoLoginUser=/AutoLoginUser=${AUTOU}/g" ${FSMNT}/usr/local/kde4/share/config/kdm/kdmrc + + # Add the auto-login user line + sed -i.bak "s/AutoLoginEnable=false/AutoLoginEnable=true/g" ${FSMNT}/usr/local/kde4/share/config/kdm/kdmrc + + fi +}; + +# Function which actually runs the adduser command on the filesystem +add_user() +{ + ARGS="${1}" + + if [ -e "${FSMNT}/.tmpPass" ] + then + # Add a user with a supplied password + run_chroot_cmd "cat /.tmpPass | pw useradd ${ARGS}" + rc_halt "rm ${FSMNT}/.tmpPass" + else + # Add a user with no password + run_chroot_cmd "cat /.tmpPass | pw useradd ${ARGS}" + fi + +}; + +# Function which reads in the config, and adds any users specified +setup_users() +{ + + # We are ready to start setting up the users, lets read the config + while read line + do + + echo $line | grep "^userName=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + get_value_from_string "${line}" + USERNAME="$VAL" + fi + + echo $line | grep "^userComment=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + get_value_from_string "${line}" + USERCOMMENT="$VAL" + fi + + echo $line | grep "^userPass=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + get_value_from_string "${line}" + USERPASS="$VAL" + fi + + echo $line | grep "^userShell=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + get_value_from_string "${line}" + strip_white_space "$VAL" + USERSHELL="$VAL" + fi + + echo $line | grep "^userHome=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + get_value_from_string "${line}" + USERHOME="$VAL" + fi + + echo $line | grep "^userGroups=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + get_value_from_string "${line}" + USERGROUPS="$VAL" + fi + + + echo $line | grep "^commitUser" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + # Found our flag to commit this user, lets check and do it + if [ ! -z "${USERNAME}" ] + then + + # Now add this user to the system, by building our args list + ARGS="-n ${USERNAME}" + + if [ ! -z "${USERCOMMENT}" ] + then + ARGS="${ARGS} -c \"${USERCOMMENT}\"" + fi + + if [ ! -z "${USERPASS}" ] + then + ARGS="${ARGS} -h 0" + echo "${USERPASS}" >${FSMNT}/.tmpPass + else + ARGS="${ARGS} -h -" + rm ${FSMNT}/.tmpPass 2>/dev/null 2>/dev/null + fi + + if [ ! -z "${USERSHELL}" ] + then + ARGS="${ARGS} -s \"${USERSHELL}\"" + else + ARGS="${ARGS} -s \"/nonexistant\"" + fi + + if [ ! -z "${USERHOME}" ] + then + ARGS="${ARGS} -m -d \"${USERHOME}\"" + fi + + if [ ! -z "${USERGROUPS}" ] + then + ARGS="${ARGS} -G \"${USERGROUPS}\"" + fi + + add_user "${ARGS}" + + # Unset our vars before looking for any more users + unset USERNAME USERCOMMENT USERPASS USERSHELL USERHOME USERGROUPS + else + exit_err "ERROR: commitUser was called without any userName= entry!!!" + fi + fi + + done <${CFGF} + + + # Check if we need to enable a user to auto-login to the desktop + check_autologin + +}; diff --git a/PCBSD/pc-sysinstall/backend/functions.sh b/PCBSD/pc-sysinstall/backend/functions.sh new file mode 100644 index 0000000..a4975c3 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/functions.sh @@ -0,0 +1,249 @@ +#!/bin/sh +# functions.sh +# Library of functions which pc-sysinstall may call upon + +# Function which displays the help-index file +display_help() +{ + if [ -e "${PROGDIR}/doc/help-index" ] + then + cat ${PROGDIR}/doc/help-index + else + echo "Error: ${PROGDIR}/doc/help-index not found" + exit 1 + fi +}; + +# Function which displays the help for a specified command +display_command_help() +{ + if [ -z "$1" ] + then + echo "Error: No command specified to display help for" + exit 1 + fi + + if [ -e "${PROGDIR}/doc/help-${1}" ] + then + cat ${PROGDIR}/doc/help-${1} + else + echo "Error: ${PROGDIR}/doc/help-${1} not found" + exit 1 + fi +}; + +# Function to convert bytes to megabytes +convert_byte_to_megabyte() +{ + if [ -z "${1}" ] + then + echo "Error: No bytes specified!" + exit 1 + fi + + expr -e ${1} / 1048576 +}; + +# Function to convert blocks to megabytes +convert_blocks_to_megabyte() +{ + if [ -z "${1}" ] ; then + echo "Error: No blocks specified!" + exit 1 + fi + + expr -e ${1} / 2048 +}; + +# Takes $1 and strips the whitespace out of it, returns VAL +strip_white_space() +{ + if [ -z "${1}" ] + then + echo "Error: No value setup to strip whitespace from!" + + exit 1 + fi + + VAL=`echo "$1" | tr -d ' '` + export VAL +}; + +# Displays an error message and exits with error 1 +exit_err() +{ + # Echo the message for the users benefit + echo "$1" + + # Save this error to the log file + echo "${1}" >>$LOGOUT + + # Check if we need to unmount any file-systems after this failure + unmount_all_filesystems_failure + + echo "For more details see log file: $LOGOUT" + + exit 1 +}; + +# Run-command, don't halt if command exits with non-0 +rc_nohalt() +{ + CMD="$1" + + if [ -z "${CMD}" ] + then + exit_err "Error: missing argument in rc_nohalt()" + fi + + echo "Running: ${CMD}" >>${LOGOUT} + ${CMD} >>${LOGOUT} 2>>${LOGOUT} + +}; + +# Run-command, halt if command exits with non-0 +rc_halt() +{ + CMD="$1" + + if [ -z "${CMD}" ] + then + exit_err "Error: missing argument in rc_halt()" + fi + + echo "Running: ${CMD}" >>${LOGOUT} + ${CMD} >>${LOGOUT} 2>>${LOGOUT} + STATUS="$?" + if [ "${STATUS}" != "0" ] + then + exit_err "Error ${STATUS}: ${CMD}" + fi +}; + +# Run-command w/echo to screen, halt if command exits with non-0 +rc_halt_echo() +{ + CMD="$1" + + if [ -z "${CMD}" ] + then + exit_err "Error: missing argument in rc_halt_echo()" + fi + + echo "Running: ${CMD}" >>${LOGOUT} + ${CMD} 2>&1 | tee -a ${LOGOUT} + STATUS="$?" + if [ "$STATUS" != "0" ] + then + exit_err "Error ${STATUS}: $CMD" + fi + +}; + +# Run-command w/echo, don't halt if command exits with non-0 +rc_nohalt_echo() +{ + CMD="$1" + + if [ -z "${CMD}" ] + then + exit_err "Error: missing argument in rc_nohalt_echo()" + fi + + echo "Running: ${CMD}" >>${LOGOUT} + ${CMD} 2>&1 | tee -a ${LOGOUT} + +}; + +# Echo to the screen and to the log +echo_log() +{ + STR="$1" + + if [ -z "${STR}" ] + then + exit_err "Error: missing argument in echo_log()" + fi + + echo "${STR}" | tee -a ${LOGOUT} +}; + +# Function which uses "fetch" to download a file, and display a progress report +fetch_file() +{ + +FETCHFILE="$1" +FETCHOUTFILE="$2" +EXITFAILED="$3" + +SIZEFILE="${TMPDIR}/.fetchSize" +EXITFILE="${TMPDIR}/.fetchExit" + +rm ${SIZEFILE} 2>/dev/null >/dev/null +rm ${FETCHOUTFILE} 2>/dev/null >/dev/null + +fetch -s "${FETCHFILE}" >${SIZEFILE} +SIZE="`cat ${SIZEFILE}`" +SIZE="`expr ${SIZE} / 1024`" +echo "FETCH: ${FETCHFILE}" +echo "FETCH: ${FETCHOUTFILE}" >>${LOGOUT} + +( fetch -o ${FETCHOUTFILE} "${FETCHFILE}" >/dev/null 2>/dev/null ; echo "$?" > ${EXITFILE} ) & +PID="$!" +while +z=1 +do + + if [ -e "${FETCHOUTFILE}" ] + then + DSIZE=`du -k ${FETCHOUTFILE} | tr -d '\t' | cut -d '/' -f 1` + echo "SIZE: ${SIZE} DOWNLOADED: ${DSIZE}" + echo "SIZE: ${SIZE} DOWNLOADED: ${DSIZE}" >>${LOGOUT} + fi + + # Check if the download is finished + ps -p ${PID} >/dev/null 2>/dev/null + if [ "$?" != "0" ] + then + break; + fi + + sleep 2 +done + +echo "FETCHDONE" + +EXIT="`cat ${EXITFILE}`" +if [ "${EXIT}" != "0" -a "$EXITFAILED" = "1" ] +then + exit_err "Error: Failed to download ${FETCHFILE}" +fi + +return $EXIT + +}; + +# Function to return a the zpool name for this device +get_zpool_name() +{ + DEVICE="$1" + + # Set the base name we use for zpools + BASENAME="tank" + + if [ ! -d "${TMPDIR}/.zpools" ] ; then + mkdir -p ${TMPDIR}/.zpools + fi + + if [ -e "${TMPDIR}/.zpools/${DEVICE}" ] ; then + cat ${TMPDIR}/.zpools/${DEVICE} + return 0 + else + # Need to generate a zpool name for this device + NUM=`ls ${TMPDIR}/.zpools/ | wc -l | sed 's| ||g'` + NEWNAME="${BASENAME}${NUM}" + echo "$NEWNAME" >${TMPDIR}/.zpools/${DEVICE} + echo "${NEWNAME}" + return + fi +}; diff --git a/PCBSD/pc-sysinstall/backend/parseconfig.sh b/PCBSD/pc-sysinstall/backend/parseconfig.sh new file mode 100755 index 0000000..9bf92b8 --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/parseconfig.sh @@ -0,0 +1,138 @@ +#!/bin/sh +# Main install configuration parsing script +# + +# Source our functions scripts +. ${BACKEND}/functions.sh +. ${BACKEND}/functions-bsdlabel.sh +. ${BACKEND}/functions-cleanup.sh +. ${BACKEND}/functions-disk.sh +. ${BACKEND}/functions-extractimage.sh +. ${BACKEND}/functions-installcomponents.sh +. ${BACKEND}/functions-localize.sh +. ${BACKEND}/functions-mountdisk.sh +. ${BACKEND}/functions-networking.sh +. ${BACKEND}/functions-newfs.sh +. ${BACKEND}/functions-parse.sh +. ${BACKEND}/functions-runcommands.sh +. ${BACKEND}/functions-unmount.sh +. ${BACKEND}/functions-upgrade.sh +. ${BACKEND}/functions-users.sh + +# Check that the config file exists +if [ ! -e "${1}" ] +then + echo "ERROR: Install configuration $1 does not exist!" + exit 1 +fi + +# Set our config file variable +CFGF="$1" + +# Check the dirname of the provided CFGF and make sure its a full path +DIR="`dirname ${CFGF}`" +if [ "${DIR}" = "." ] +then + CFGF="`pwd`/${CFGF}" +fi +export CFGF + +# Start by doing a sanity check, which will catch any obvious mistakes in the config +file_sanity_check "installMode disk0 partition bootManager installType installMedium packageType" + +# We passed the Sanity check, lets grab some of the universal config settings and store them +check_value installMode "fresh upgrade" +check_value bootManager "bsd none" +check_value installType "PCBSD FreeBSD" +check_value installMedium "dvd usb ftp rsync" +check_value packageType "uzip tar rsync split" +check_value partition "all ALL s1 s2 s3 s4 free FREE" +if_check_value_exists mirrorbal "load prefer round-robin split" + +# We passed all sanity checks! Yay, lets start the install +echo "File Sanity Check -> OK" + +# Lets load the various universal settings now +get_value_from_cfg installMode +INSTALLMODE="${VAL}" ; export INSTALLMODE + +get_value_from_cfg installType +INSTALLTYPE="${VAL}" ; export INSTALLTYPE + +get_value_from_cfg installMedium +INSTALLMEDIUM="${VAL}" ; export INSTALLMEDIUM + +get_value_from_cfg packageType +PACKAGETYPE="${VAL}" ; export PACKAGETYPE + +# Check if we are doing any networking setup +start_networking + +# If we are not doing an upgrade, lets go ahead and setup the disk +if [ "${INSTALLMODE}" = "fresh" ] +then + + # Lets start setting up the disk slices now + setup_disk_slice + + # Disk setup complete, now lets parse WORKINGSLICES and setup the bsdlabels + setup_disk_label + + # Now we've setup the bsdlabels, lets go ahead and run newfs / zfs + # to setup the filesystems + setup_filesystems + + # Lets mount the partitions now + mount_all_filesystems + + # We are ready to begin extraction, lets start now + init_extraction + + # Check if we have any optional modules to load + install_components + + # Do any localization in configuration + run_localize + + # Save any networking config on the installed system + save_networking_install + + # Now add any users + setup_users + + # Now run any commands specified + run_commands + + # Do any last cleanup / setup before unmounting + run_final_cleanup + + # Unmount and finish up + unmount_all_filesystems + + echo_log "Installation finished!" + exit 0 + +else + # We're going to do an upgrade, skip all the disk setup + # and start by mounting the target drive/slices + mount_upgrade + + # Start the extraction process + init_extraction + + # Do any localization in configuration + run_localize + + # Now run any commands specified + run_commands + + # Merge any old configuration files + merge_old_configs + + # All finished, unmount the file-systems + unmount_upgrade + + echo_log "Upgrade finished!" + exit 0 +fi + diff --git a/PCBSD/pc-sysinstall/backend/startautoinstall.sh b/PCBSD/pc-sysinstall/backend/startautoinstall.sh new file mode 100755 index 0000000..a7103fb --- /dev/null +++ b/PCBSD/pc-sysinstall/backend/startautoinstall.sh @@ -0,0 +1,111 @@ +#!/bin/sh +# Script which reads the pc-autoinstall.conf directive, and begins the install +# + +# Source our functions scripts +. ${BACKEND}/functions.sh +. ${BACKEND}/functions-networking.sh +. ${BACKEND}/functions-parse.sh + +# Check that the config file exists +if [ ! -e "${1}" ] +then + echo "ERROR: Install configuration $1 does not exist!" + exit 1 +fi + +# Set our config file variable +CONF=${1} +INSTALL_CFG="/tmp/pc-sysinstall.cfg" + +# Check if the config file is on disk as well +PCCFG=`grep "pc_config:" ${CONF} | grep -v "^#" | sed "s|pc_config: ||g" | sed "s|pc_config:||g"` +SHUTDOWN_CMD=`grep "shutdown_cmd:" ${CONF} | grep -v "^#" | sed "s|shutdown_cmd: ||g" | sed "s|shutdown_cmd:||g"` +CONFIRM_INS=`grep "confirm_install:" ${CONF} | grep -v "^#" | sed "s|confirm_install: ||g" | sed "s|confirm_install:||g"` + +# Check that this isn't a http / ftp file we need to fetch later +echo "${PCCFG}" | grep -e "^http" -e "^ftp" > /dev/null 2>/dev/null +if [ "$?" != "0" ] +then + # Copy over the install cfg file, if not done already + if [ ! -e "${INSTALL_CFG}" ] + then + cp ${PCCFG} ${INSTALL_CFG} + fi + # Make sure we have the file which was copied into /tmp previously + if [ ! -e "${INSTALL_CFG}" ] + then + echo "Error: ${INSTALL_CFG} is missing! Exiting in 10 seconds..." + sleep 10 + exit 150 + fi +else + # We need to fetch a remote file, check and set any nic options before doing so + NICCFG=`grep "nic_config:" ${CONF} | grep -v "^#" | sed "s|nic_config: ||g" | sed "s|nic_config:||g"` + if [ "${NICCFG}" = "dhcp-all" -o "${NICCFG}" = "DHCP-ALL" ] + then + # Try to auto-enable dhcp on any nics we find + enable_auto_dhcp + else + echo "Running command \"ifconfig ${NICCFG}\"" + ifconfig ${NICCFG} + WRKNIC="`echo ${NICCFG} | cut -d ' ' -f 1`" + NICDNS=`grep "nic_dns:" ${CONF} | grep -v "^#" | sed "s|nic_dns: ||g" | sed "s|nic_dns:||g"` + NICGATE=`grep "nic_gateway:" ${CONF} | grep -v "^#" | sed "s|nic_gateway: ||g" | sed "s|nic_gateway:||g"` + + echo "nameserver ${NICDNS}" >/etc/resolv.conf + + echo "Running command \"route add default ${NICGATE}\"" + route add default ${NICGATE} + fi + + get_nic_mac "$WRKNIC" + nic_mac="${FOUNDMAC}" + + PCCFG=`echo ${PCCFG} | sed "s|%%NIC_MAC%%|${nic_mac}|g"` + + # Now try to fetch the remove file + echo "Fetching cfg with: \"fetch -o ${INSTALL_CFG} ${PCCFG}\"" + fetch -o "${INSTALL_CFG}" "${PCCFG}" + if [ "$?" != "0" ] + then + echo "ERROR: Failed to fetch ${PCCFG}, install aborted" + exit 150 + fi + +fi + +# If we end up with a valid config, lets proccede +if [ -e "${INSTALL_CFG}" ] +then + + if [ "${CONFIRM_INS}" != "no" -a "${CONFIRM_INS}" != "NO" ] + then + echo "Type in 'install' to begin automated installation. Warning: Data on target disks may be destroyed!" + read tmp + case $tmp in + install|INSTALL) ;; + *) echo "Install canceled!" ; exit 150 ;; + esac + fi + + ${PROGDIR}/pc-sysinstall -c ${INSTALL_CFG} + if [ "$?" = "0" ] + then + if [ ! -z "$SHUTDOWN_CMD" ] + then + ${SHUTDOWN_CMD} + else + echo "SUCCESS: Installation finished! Press ENTER to rebooot." + read tmp + shutdown -r now + fi + else + echo "ERROR: Installation failed, press ENTER to drop to shell." + read tmp + /bin/csh + fi +else + echo "ERROR: Failed to get /tmp/pc-sysinstall.cfg for automated install..." + exit 150 +fi diff --git a/PCBSD/pc-sysinstall/components/.svn/entries b/PCBSD/pc-sysinstall/components/.svn/entries new file mode 100644 index 0000000..2b1af8a --- /dev/null +++ b/PCBSD/pc-sysinstall/components/.svn/entries @@ -0,0 +1,70 @@ +10 + +dir +6759 +svn://svn.pcbsd.org/pcbsd/current/pc-sysinstall/components +svn://svn.pcbsd.org + + + +2010-05-03T18:12:20.892984Z +6634 +kris + + + + + + + + + + + + + + +212fe199-4beb-da11-a70e-00e08102fd27 + +k3b +dir + +thewarden +dir + +firefox +dir + +wine +dir + +vlc +dir + +opera +dir + +ports +dir + +src +dir + +amarok +dir + +pidgin +dir + +thunderbird +dir + +filezilla +dir + +gimp +dir + +openoffice +dir + diff --git a/PCBSD/pc-sysinstall/components/.svn/lock b/PCBSD/pc-sysinstall/components/.svn/lock new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/.svn/lock diff --git a/PCBSD/pc-sysinstall/components/amarok/.svn/entries b/PCBSD/pc-sysinstall/components/amarok/.svn/entries new file mode 100644 index 0000000..edd0d06 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/amarok/.svn/entries @@ -0,0 +1,164 @@ +10 + +dir +6759 +svn://svn.pcbsd.org/pcbsd/current/pc-sysinstall/components/amarok +svn://svn.pcbsd.org + + + +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + +212fe199-4beb-da11-a70e-00e08102fd27 + +install.sh +file + + + + +2010-05-23T00:20:48.000000Z +e15dcc70de80d6e48c35b3b67be31736 +2009-11-13T19:27:59.556003Z +5019 +kris +has-props + + + + + + + + + + + + + + + + + + + + +176 + +component.cfg +file + + + + +2010-05-23T00:20:48.000000Z +21c503e361aa4b11a551c222c50ad466 +2009-11-13T19:27:59.556003Z +5019 +kris + + + + + + + + + + + + + + + + + + + + + +81 + +component.png +file + + + + +2010-05-23T00:20:48.000000Z +6ad259a29c2903dbd98d0d4bfbf3fa71 +2009-07-10T19:42:19.051400Z +4215 +kris +has-props + + + + + + + + + + + + + + + + + + + + +5676 + +component.cfg.uk +file + + + + +2010-05-23T00:20:48.000000Z +e4086d3eb3bd87d82e7499eafe6ad4de +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + + + + + + + + +106 + diff --git a/PCBSD/pc-sysinstall/components/amarok/.svn/lock b/PCBSD/pc-sysinstall/components/amarok/.svn/lock new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/amarok/.svn/lock diff --git a/PCBSD/pc-sysinstall/components/amarok/.svn/prop-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/amarok/.svn/prop-base/component.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/PCBSD/pc-sysinstall/components/amarok/.svn/prop-base/component.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/PCBSD/pc-sysinstall/components/amarok/.svn/prop-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/amarok/.svn/prop-base/install.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/amarok/.svn/prop-base/install.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/components/amarok/.svn/text-base/component.cfg.svn-base b/PCBSD/pc-sysinstall/components/amarok/.svn/text-base/component.cfg.svn-base new file mode 100644 index 0000000..f5817ff --- /dev/null +++ b/PCBSD/pc-sysinstall/components/amarok/.svn/text-base/component.cfg.svn-base @@ -0,0 +1,4 @@ +# Amarok component file +name: Amarok +description: Music player for KDE +type: PBI diff --git a/PCBSD/pc-sysinstall/components/amarok/.svn/text-base/component.cfg.uk.svn-base b/PCBSD/pc-sysinstall/components/amarok/.svn/text-base/component.cfg.uk.svn-base new file mode 100644 index 0000000..2e87958 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/amarok/.svn/text-base/component.cfg.uk.svn-base @@ -0,0 +1,4 @@ +# Amarok component file +name: Amarok +description: Музичний програвач для KDE +type: PBI
\ No newline at end of file diff --git a/PCBSD/pc-sysinstall/components/amarok/.svn/text-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/amarok/.svn/text-base/component.png.svn-base Binary files differnew file mode 100644 index 0000000..2700c4d --- /dev/null +++ b/PCBSD/pc-sysinstall/components/amarok/.svn/text-base/component.png.svn-base diff --git a/PCBSD/pc-sysinstall/components/amarok/.svn/text-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/amarok/.svn/text-base/install.sh.svn-base new file mode 100644 index 0000000..8a0bf24 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/amarok/.svn/text-base/install.sh.svn-base @@ -0,0 +1,8 @@ +#!/bin/sh +# This script installs the Amarok PBI + +DISPLAY=""; export DISPLAY + +echo "Installing Amarok PBI" +chmod 755 ${COMPTMPDIR}/${CFILE} +${COMPTMPDIR}/${CFILE} -text -accept diff --git a/PCBSD/pc-sysinstall/components/amarok/component.cfg b/PCBSD/pc-sysinstall/components/amarok/component.cfg new file mode 100644 index 0000000..f5817ff --- /dev/null +++ b/PCBSD/pc-sysinstall/components/amarok/component.cfg @@ -0,0 +1,4 @@ +# Amarok component file +name: Amarok +description: Music player for KDE +type: PBI diff --git a/PCBSD/pc-sysinstall/components/amarok/component.cfg.uk b/PCBSD/pc-sysinstall/components/amarok/component.cfg.uk new file mode 100644 index 0000000..2e87958 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/amarok/component.cfg.uk @@ -0,0 +1,4 @@ +# Amarok component file +name: Amarok +description: Музичний програвач для KDE +type: PBI
\ No newline at end of file diff --git a/PCBSD/pc-sysinstall/components/amarok/component.png b/PCBSD/pc-sysinstall/components/amarok/component.png Binary files differnew file mode 100644 index 0000000..2700c4d --- /dev/null +++ b/PCBSD/pc-sysinstall/components/amarok/component.png diff --git a/PCBSD/pc-sysinstall/components/amarok/install.sh b/PCBSD/pc-sysinstall/components/amarok/install.sh new file mode 100755 index 0000000..8a0bf24 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/amarok/install.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# This script installs the Amarok PBI + +DISPLAY=""; export DISPLAY + +echo "Installing Amarok PBI" +chmod 755 ${COMPTMPDIR}/${CFILE} +${COMPTMPDIR}/${CFILE} -text -accept diff --git a/PCBSD/pc-sysinstall/components/filezilla/.svn/entries b/PCBSD/pc-sysinstall/components/filezilla/.svn/entries new file mode 100644 index 0000000..1ace486 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/filezilla/.svn/entries @@ -0,0 +1,164 @@ +10 + +dir +6759 +svn://svn.pcbsd.org/pcbsd/current/pc-sysinstall/components/filezilla +svn://svn.pcbsd.org + + + +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + +212fe199-4beb-da11-a70e-00e08102fd27 + +install.sh +file + + + + +2010-05-23T00:20:48.000000Z +22733616554ae180ea70c9b7e678250e +2009-11-13T19:27:59.556003Z +5019 +kris +has-props + + + + + + + + + + + + + + + + + + + + +172 + +component.cfg +file + + + + +2010-05-23T00:20:48.000000Z +4d4a79d80f8b7a6176351283cbe06ba5 +2009-11-13T19:27:59.556003Z +5019 +kris + + + + + + + + + + + + + + + + + + + + + +101 + +component.png +file + + + + +2010-05-23T00:20:48.000000Z +2201c7a66cacc4fe628401136a336524 +2009-07-10T19:42:19.051400Z +4215 +kris +has-props + + + + + + + + + + + + + + + + + + + + +1250 + +component.cfg.uk +file + + + + +2010-05-23T00:20:48.000000Z +d1b3a8d2b86a897cf8aa244bef85cc6f +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + + + + + + + + +144 + diff --git a/PCBSD/pc-sysinstall/components/filezilla/.svn/lock b/PCBSD/pc-sysinstall/components/filezilla/.svn/lock new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/filezilla/.svn/lock diff --git a/PCBSD/pc-sysinstall/components/filezilla/.svn/prop-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/filezilla/.svn/prop-base/component.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/PCBSD/pc-sysinstall/components/filezilla/.svn/prop-base/component.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/PCBSD/pc-sysinstall/components/filezilla/.svn/prop-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/filezilla/.svn/prop-base/install.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/filezilla/.svn/prop-base/install.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/components/filezilla/.svn/text-base/component.cfg.svn-base b/PCBSD/pc-sysinstall/components/filezilla/.svn/text-base/component.cfg.svn-base new file mode 100644 index 0000000..14c4bfd --- /dev/null +++ b/PCBSD/pc-sysinstall/components/filezilla/.svn/text-base/component.cfg.svn-base @@ -0,0 +1,4 @@ +# Filezilla component file +name: FileZilla +description: Powerful FTP, FTPS and SFTP client +type: PBI diff --git a/PCBSD/pc-sysinstall/components/filezilla/.svn/text-base/component.cfg.uk.svn-base b/PCBSD/pc-sysinstall/components/filezilla/.svn/text-base/component.cfg.uk.svn-base new file mode 100644 index 0000000..c5b1d95 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/filezilla/.svn/text-base/component.cfg.uk.svn-base @@ -0,0 +1,4 @@ +# Filezilla component file +name: FileZilla +description: FTP, FTPS та SFTP клієнт з багатими можливостями +type: PBI diff --git a/PCBSD/pc-sysinstall/components/filezilla/.svn/text-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/filezilla/.svn/text-base/component.png.svn-base Binary files differnew file mode 100644 index 0000000..26791e1 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/filezilla/.svn/text-base/component.png.svn-base diff --git a/PCBSD/pc-sysinstall/components/filezilla/.svn/text-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/filezilla/.svn/text-base/install.sh.svn-base new file mode 100644 index 0000000..d9ddbbe --- /dev/null +++ b/PCBSD/pc-sysinstall/components/filezilla/.svn/text-base/install.sh.svn-base @@ -0,0 +1,8 @@ +#!/bin/sh +# This script installs the PBI + +DISPLAY=""; export DISPLAY + +echo "Installing Filezilla PBI" +chmod 755 ${COMPTMPDIR}/${CFILE} +${COMPTMPDIR}/${CFILE} -text -accept diff --git a/PCBSD/pc-sysinstall/components/filezilla/component.cfg b/PCBSD/pc-sysinstall/components/filezilla/component.cfg new file mode 100644 index 0000000..14c4bfd --- /dev/null +++ b/PCBSD/pc-sysinstall/components/filezilla/component.cfg @@ -0,0 +1,4 @@ +# Filezilla component file +name: FileZilla +description: Powerful FTP, FTPS and SFTP client +type: PBI diff --git a/PCBSD/pc-sysinstall/components/filezilla/component.cfg.uk b/PCBSD/pc-sysinstall/components/filezilla/component.cfg.uk new file mode 100644 index 0000000..c5b1d95 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/filezilla/component.cfg.uk @@ -0,0 +1,4 @@ +# Filezilla component file +name: FileZilla +description: FTP, FTPS та SFTP клієнт з багатими можливостями +type: PBI diff --git a/PCBSD/pc-sysinstall/components/filezilla/component.png b/PCBSD/pc-sysinstall/components/filezilla/component.png Binary files differnew file mode 100644 index 0000000..26791e1 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/filezilla/component.png diff --git a/PCBSD/pc-sysinstall/components/filezilla/install.sh b/PCBSD/pc-sysinstall/components/filezilla/install.sh new file mode 100755 index 0000000..d9ddbbe --- /dev/null +++ b/PCBSD/pc-sysinstall/components/filezilla/install.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# This script installs the PBI + +DISPLAY=""; export DISPLAY + +echo "Installing Filezilla PBI" +chmod 755 ${COMPTMPDIR}/${CFILE} +${COMPTMPDIR}/${CFILE} -text -accept diff --git a/PCBSD/pc-sysinstall/components/firefox/.svn/entries b/PCBSD/pc-sysinstall/components/firefox/.svn/entries new file mode 100644 index 0000000..d7f25b2 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/firefox/.svn/entries @@ -0,0 +1,164 @@ +10 + +dir +6759 +svn://svn.pcbsd.org/pcbsd/current/pc-sysinstall/components/firefox +svn://svn.pcbsd.org + + + +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + +212fe199-4beb-da11-a70e-00e08102fd27 + +install.sh +file + + + + +2010-05-23T00:20:48.000000Z +db527efeba86d7c83393f8845bec564e +2009-11-13T19:27:59.556003Z +5019 +kris +has-props + + + + + + + + + + + + + + + + + + + + +170 + +component.cfg +file + + + + +2010-05-23T00:20:48.000000Z +4a263288d5753948af59c3103f866fb7 +2009-11-13T19:27:59.556003Z +5019 +kris + + + + + + + + + + + + + + + + + + + + + +92 + +component.png +file + + + + +2010-05-23T00:20:48.000000Z +ff03ef6903c8f067dc5459c901b0b5a8 +2009-07-10T19:42:19.051400Z +4215 +kris +has-props + + + + + + + + + + + + + + + + + + + + +21853 + +component.cfg.uk +file + + + + +2010-05-23T00:20:48.000000Z +96c533eed4fed6b597a7a91aec42c93a +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + + + + + + + + +120 + diff --git a/PCBSD/pc-sysinstall/components/firefox/.svn/lock b/PCBSD/pc-sysinstall/components/firefox/.svn/lock new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/firefox/.svn/lock diff --git a/PCBSD/pc-sysinstall/components/firefox/.svn/prop-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/firefox/.svn/prop-base/component.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/PCBSD/pc-sysinstall/components/firefox/.svn/prop-base/component.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/PCBSD/pc-sysinstall/components/firefox/.svn/prop-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/firefox/.svn/prop-base/install.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/firefox/.svn/prop-base/install.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/components/firefox/.svn/text-base/component.cfg.svn-base b/PCBSD/pc-sysinstall/components/firefox/.svn/text-base/component.cfg.svn-base new file mode 100644 index 0000000..0fda8ae --- /dev/null +++ b/PCBSD/pc-sysinstall/components/firefox/.svn/text-base/component.cfg.svn-base @@ -0,0 +1,4 @@ +# Firefox component file +name: Firefox +description: Mozilla's popular web browser +type: PBI diff --git a/PCBSD/pc-sysinstall/components/firefox/.svn/text-base/component.cfg.uk.svn-base b/PCBSD/pc-sysinstall/components/firefox/.svn/text-base/component.cfg.uk.svn-base new file mode 100644 index 0000000..2f633e8 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/firefox/.svn/text-base/component.cfg.uk.svn-base @@ -0,0 +1,4 @@ +# Firefox component file +name: Firefox +description: Популярний веб браузер від Mozilla +type: PBI diff --git a/PCBSD/pc-sysinstall/components/firefox/.svn/text-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/firefox/.svn/text-base/component.png.svn-base Binary files differnew file mode 100644 index 0000000..13b15c6 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/firefox/.svn/text-base/component.png.svn-base diff --git a/PCBSD/pc-sysinstall/components/firefox/.svn/text-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/firefox/.svn/text-base/install.sh.svn-base new file mode 100644 index 0000000..a94517d --- /dev/null +++ b/PCBSD/pc-sysinstall/components/firefox/.svn/text-base/install.sh.svn-base @@ -0,0 +1,8 @@ +#!/bin/sh +# This script installs the PBI + +DISPLAY=""; export DISPLAY + +echo "Installing Firefox PBI" +chmod 755 ${COMPTMPDIR}/${CFILE} +${COMPTMPDIR}/${CFILE} -text -accept diff --git a/PCBSD/pc-sysinstall/components/firefox/component.cfg b/PCBSD/pc-sysinstall/components/firefox/component.cfg new file mode 100644 index 0000000..0fda8ae --- /dev/null +++ b/PCBSD/pc-sysinstall/components/firefox/component.cfg @@ -0,0 +1,4 @@ +# Firefox component file +name: Firefox +description: Mozilla's popular web browser +type: PBI diff --git a/PCBSD/pc-sysinstall/components/firefox/component.cfg.uk b/PCBSD/pc-sysinstall/components/firefox/component.cfg.uk new file mode 100644 index 0000000..2f633e8 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/firefox/component.cfg.uk @@ -0,0 +1,4 @@ +# Firefox component file +name: Firefox +description: Популярний веб браузер від Mozilla +type: PBI diff --git a/PCBSD/pc-sysinstall/components/firefox/component.png b/PCBSD/pc-sysinstall/components/firefox/component.png Binary files differnew file mode 100644 index 0000000..13b15c6 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/firefox/component.png diff --git a/PCBSD/pc-sysinstall/components/firefox/install.sh b/PCBSD/pc-sysinstall/components/firefox/install.sh new file mode 100755 index 0000000..a94517d --- /dev/null +++ b/PCBSD/pc-sysinstall/components/firefox/install.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# This script installs the PBI + +DISPLAY=""; export DISPLAY + +echo "Installing Firefox PBI" +chmod 755 ${COMPTMPDIR}/${CFILE} +${COMPTMPDIR}/${CFILE} -text -accept diff --git a/PCBSD/pc-sysinstall/components/gimp/.svn/entries b/PCBSD/pc-sysinstall/components/gimp/.svn/entries new file mode 100644 index 0000000..8e68665 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/gimp/.svn/entries @@ -0,0 +1,164 @@ +10 + +dir +6759 +svn://svn.pcbsd.org/pcbsd/current/pc-sysinstall/components/gimp +svn://svn.pcbsd.org + + + +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + +212fe199-4beb-da11-a70e-00e08102fd27 + +install.sh +file + + + + +2010-05-23T00:20:48.000000Z +b053a87ac2d6ab4a299b0a7f4a16dcc0 +2009-11-13T19:27:59.556003Z +5019 +kris +has-props + + + + + + + + + + + + + + + + + + + + +167 + +component.cfg +file + + + + +2010-05-23T00:20:48.000000Z +e794e4c922a201142eefa6c001d5946c +2009-11-13T19:27:59.556003Z +5019 +kris + + + + + + + + + + + + + + + + + + + + + +88 + +component.png +file + + + + +2010-05-23T00:20:48.000000Z +7d7730c9ec7f05c57649c199b195053c +2009-07-10T19:42:19.051400Z +4215 +kris +has-props + + + + + + + + + + + + + + + + + + + + +3553 + +component.cfg.uk +file + + + + +2010-05-23T00:20:48.000000Z +eeb161604420652600acee40be760672 +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + + + + + + + + +184 + diff --git a/PCBSD/pc-sysinstall/components/gimp/.svn/lock b/PCBSD/pc-sysinstall/components/gimp/.svn/lock new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/gimp/.svn/lock diff --git a/PCBSD/pc-sysinstall/components/gimp/.svn/prop-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/gimp/.svn/prop-base/component.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/PCBSD/pc-sysinstall/components/gimp/.svn/prop-base/component.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/PCBSD/pc-sysinstall/components/gimp/.svn/prop-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/gimp/.svn/prop-base/install.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/gimp/.svn/prop-base/install.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/components/gimp/.svn/text-base/component.cfg.svn-base b/PCBSD/pc-sysinstall/components/gimp/.svn/text-base/component.cfg.svn-base new file mode 100644 index 0000000..5de4f60 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/gimp/.svn/text-base/component.cfg.svn-base @@ -0,0 +1,4 @@ +# Gimp component file +name: Gimp +description: Powerful photo and image editor +type: PBI diff --git a/PCBSD/pc-sysinstall/components/gimp/.svn/text-base/component.cfg.uk.svn-base b/PCBSD/pc-sysinstall/components/gimp/.svn/text-base/component.cfg.uk.svn-base new file mode 100644 index 0000000..f8ae89a --- /dev/null +++ b/PCBSD/pc-sysinstall/components/gimp/.svn/text-base/component.cfg.uk.svn-base @@ -0,0 +1,4 @@ +# Gimp component file +name: Gimp +description: Редактор фоторгафій та картинок з надзвичайно багатими можливостями +type: PBI diff --git a/PCBSD/pc-sysinstall/components/gimp/.svn/text-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/gimp/.svn/text-base/component.png.svn-base Binary files differnew file mode 100644 index 0000000..8b9d225 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/gimp/.svn/text-base/component.png.svn-base diff --git a/PCBSD/pc-sysinstall/components/gimp/.svn/text-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/gimp/.svn/text-base/install.sh.svn-base new file mode 100644 index 0000000..964e81a --- /dev/null +++ b/PCBSD/pc-sysinstall/components/gimp/.svn/text-base/install.sh.svn-base @@ -0,0 +1,8 @@ +#!/bin/sh +# This script installs the PBI + +DISPLAY=""; export DISPLAY + +echo "Installing Gimp PBI" +chmod 755 ${COMPTMPDIR}/${CFILE} +${COMPTMPDIR}/${CFILE} -text -accept diff --git a/PCBSD/pc-sysinstall/components/gimp/component.cfg b/PCBSD/pc-sysinstall/components/gimp/component.cfg new file mode 100644 index 0000000..5de4f60 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/gimp/component.cfg @@ -0,0 +1,4 @@ +# Gimp component file +name: Gimp +description: Powerful photo and image editor +type: PBI diff --git a/PCBSD/pc-sysinstall/components/gimp/component.cfg.uk b/PCBSD/pc-sysinstall/components/gimp/component.cfg.uk new file mode 100644 index 0000000..f8ae89a --- /dev/null +++ b/PCBSD/pc-sysinstall/components/gimp/component.cfg.uk @@ -0,0 +1,4 @@ +# Gimp component file +name: Gimp +description: Редактор фоторгафій та картинок з надзвичайно багатими можливостями +type: PBI diff --git a/PCBSD/pc-sysinstall/components/gimp/component.png b/PCBSD/pc-sysinstall/components/gimp/component.png Binary files differnew file mode 100644 index 0000000..8b9d225 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/gimp/component.png diff --git a/PCBSD/pc-sysinstall/components/gimp/install.sh b/PCBSD/pc-sysinstall/components/gimp/install.sh new file mode 100755 index 0000000..964e81a --- /dev/null +++ b/PCBSD/pc-sysinstall/components/gimp/install.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# This script installs the PBI + +DISPLAY=""; export DISPLAY + +echo "Installing Gimp PBI" +chmod 755 ${COMPTMPDIR}/${CFILE} +${COMPTMPDIR}/${CFILE} -text -accept diff --git a/PCBSD/pc-sysinstall/components/k3b/.svn/entries b/PCBSD/pc-sysinstall/components/k3b/.svn/entries new file mode 100644 index 0000000..c553287 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/k3b/.svn/entries @@ -0,0 +1,164 @@ +10 + +dir +6759 +svn://svn.pcbsd.org/pcbsd/current/pc-sysinstall/components/k3b +svn://svn.pcbsd.org + + + +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + +212fe199-4beb-da11-a70e-00e08102fd27 + +install.sh +file + + + + +2010-05-23T00:20:48.000000Z +8c036fdd89936da333871827403b4ad4 +2009-11-13T19:27:59.556003Z +5019 +kris +has-props + + + + + + + + + + + + + + + + + + + + +166 + +component.cfg +file + + + + +2010-05-23T00:20:48.000000Z +f58921a7715cba8c6a3e6505f1b8ed82 +2009-11-13T19:27:59.556003Z +5019 +kris + + + + + + + + + + + + + + + + + + + + + +85 + +component.png +file + + + + +2010-05-23T00:20:48.000000Z +869dbdb348134bdbf02087124c1059b6 +2009-07-10T19:42:19.051400Z +4215 +kris +has-props + + + + + + + + + + + + + + + + + + + + +2892 + +component.cfg.uk +file + + + + +2010-05-23T00:20:48.000000Z +a4c69828a2082d95c2fe881114108a26 +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + + + + + + + + +113 + diff --git a/PCBSD/pc-sysinstall/components/k3b/.svn/lock b/PCBSD/pc-sysinstall/components/k3b/.svn/lock new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/k3b/.svn/lock diff --git a/PCBSD/pc-sysinstall/components/k3b/.svn/prop-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/k3b/.svn/prop-base/component.png.svn-base new file mode 100644 index 0000000..dbc918b --- /dev/null +++ b/PCBSD/pc-sysinstall/components/k3b/.svn/prop-base/component.png.svn-base @@ -0,0 +1,9 @@ +K 14 +svn:executable +V 1 +* +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/PCBSD/pc-sysinstall/components/k3b/.svn/prop-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/k3b/.svn/prop-base/install.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/k3b/.svn/prop-base/install.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/components/k3b/.svn/text-base/component.cfg.svn-base b/PCBSD/pc-sysinstall/components/k3b/.svn/text-base/component.cfg.svn-base new file mode 100644 index 0000000..7bc38ab --- /dev/null +++ b/PCBSD/pc-sysinstall/components/k3b/.svn/text-base/component.cfg.svn-base @@ -0,0 +1,4 @@ +# K3b component file +name: K3B +description: Powerful CD / DVD burning tool +type: PBI diff --git a/PCBSD/pc-sysinstall/components/k3b/.svn/text-base/component.cfg.uk.svn-base b/PCBSD/pc-sysinstall/components/k3b/.svn/text-base/component.cfg.uk.svn-base new file mode 100644 index 0000000..2ebc1ec --- /dev/null +++ b/PCBSD/pc-sysinstall/components/k3b/.svn/text-base/component.cfg.uk.svn-base @@ -0,0 +1,4 @@ +# K3b component file +name: K3B +description: Програма для запису CD / DVD дисків +type: PBI diff --git a/PCBSD/pc-sysinstall/components/k3b/.svn/text-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/k3b/.svn/text-base/component.png.svn-base Binary files differnew file mode 100644 index 0000000..9bc8b38 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/k3b/.svn/text-base/component.png.svn-base diff --git a/PCBSD/pc-sysinstall/components/k3b/.svn/text-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/k3b/.svn/text-base/install.sh.svn-base new file mode 100644 index 0000000..8e37a18 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/k3b/.svn/text-base/install.sh.svn-base @@ -0,0 +1,8 @@ +#!/bin/sh +# This script installs the PBI + +DISPLAY=""; export DISPLAY + +echo "Installing K3B PBI" +chmod 755 ${COMPTMPDIR}/${CFILE} +${COMPTMPDIR}/${CFILE} -text -accept diff --git a/PCBSD/pc-sysinstall/components/k3b/component.cfg b/PCBSD/pc-sysinstall/components/k3b/component.cfg new file mode 100644 index 0000000..7bc38ab --- /dev/null +++ b/PCBSD/pc-sysinstall/components/k3b/component.cfg @@ -0,0 +1,4 @@ +# K3b component file +name: K3B +description: Powerful CD / DVD burning tool +type: PBI diff --git a/PCBSD/pc-sysinstall/components/k3b/component.cfg.uk b/PCBSD/pc-sysinstall/components/k3b/component.cfg.uk new file mode 100644 index 0000000..2ebc1ec --- /dev/null +++ b/PCBSD/pc-sysinstall/components/k3b/component.cfg.uk @@ -0,0 +1,4 @@ +# K3b component file +name: K3B +description: Програма для запису CD / DVD дисків +type: PBI diff --git a/PCBSD/pc-sysinstall/components/k3b/component.png b/PCBSD/pc-sysinstall/components/k3b/component.png Binary files differnew file mode 100755 index 0000000..9bc8b38 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/k3b/component.png diff --git a/PCBSD/pc-sysinstall/components/k3b/install.sh b/PCBSD/pc-sysinstall/components/k3b/install.sh new file mode 100755 index 0000000..8e37a18 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/k3b/install.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# This script installs the PBI + +DISPLAY=""; export DISPLAY + +echo "Installing K3B PBI" +chmod 755 ${COMPTMPDIR}/${CFILE} +${COMPTMPDIR}/${CFILE} -text -accept diff --git a/PCBSD/pc-sysinstall/components/openoffice/.svn/entries b/PCBSD/pc-sysinstall/components/openoffice/.svn/entries new file mode 100644 index 0000000..c9a931c --- /dev/null +++ b/PCBSD/pc-sysinstall/components/openoffice/.svn/entries @@ -0,0 +1,164 @@ +10 + +dir +6759 +svn://svn.pcbsd.org/pcbsd/current/pc-sysinstall/components/openoffice +svn://svn.pcbsd.org + + + +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + +212fe199-4beb-da11-a70e-00e08102fd27 + +install.sh +file + + + + +2010-05-23T00:20:48.000000Z +cefdeee964e13fdd50d88be5b95b1eb1 +2009-11-13T19:27:59.556003Z +5019 +kris +has-props + + + + + + + + + + + + + + + + + + + + +173 + +component.cfg +file + + + + +2010-05-23T00:20:48.000000Z +89c98c4fb8d555e0070367bb344e475d +2009-11-13T19:27:59.556003Z +5019 +kris + + + + + + + + + + + + + + + + + + + + + +99 + +component.png +file + + + + +2010-05-23T00:20:49.000000Z +d483f6b5803f91b9d55eb8e31042b698 +2009-07-10T19:42:19.051400Z +4215 +kris +has-props + + + + + + + + + + + + + + + + + + + + +3973 + +component.cfg.uk +file + + + + +2010-05-23T00:20:49.000000Z +6d622d22190e021b839d898567cf264e +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + + + + + + + + +137 + diff --git a/PCBSD/pc-sysinstall/components/openoffice/.svn/lock b/PCBSD/pc-sysinstall/components/openoffice/.svn/lock new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/openoffice/.svn/lock diff --git a/PCBSD/pc-sysinstall/components/openoffice/.svn/prop-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/openoffice/.svn/prop-base/component.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/PCBSD/pc-sysinstall/components/openoffice/.svn/prop-base/component.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/PCBSD/pc-sysinstall/components/openoffice/.svn/prop-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/openoffice/.svn/prop-base/install.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/openoffice/.svn/prop-base/install.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/components/openoffice/.svn/text-base/component.cfg.svn-base b/PCBSD/pc-sysinstall/components/openoffice/.svn/text-base/component.cfg.svn-base new file mode 100644 index 0000000..3f273b5 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/openoffice/.svn/text-base/component.cfg.svn-base @@ -0,0 +1,4 @@ +# OpenOffice component file +name: OpenOffice.org +description: Full featured office suite +type: PBI diff --git a/PCBSD/pc-sysinstall/components/openoffice/.svn/text-base/component.cfg.uk.svn-base b/PCBSD/pc-sysinstall/components/openoffice/.svn/text-base/component.cfg.uk.svn-base new file mode 100644 index 0000000..73b6d38 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/openoffice/.svn/text-base/component.cfg.uk.svn-base @@ -0,0 +1,4 @@ +# OpenOffice component file +name: OpenOffice.org +description: Повнофункціональний офісний пакет +type: PBI diff --git a/PCBSD/pc-sysinstall/components/openoffice/.svn/text-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/openoffice/.svn/text-base/component.png.svn-base Binary files differnew file mode 100644 index 0000000..972e4b9 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/openoffice/.svn/text-base/component.png.svn-base diff --git a/PCBSD/pc-sysinstall/components/openoffice/.svn/text-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/openoffice/.svn/text-base/install.sh.svn-base new file mode 100644 index 0000000..39149b4 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/openoffice/.svn/text-base/install.sh.svn-base @@ -0,0 +1,8 @@ +#!/bin/sh +# This script installs the PBI + +DISPLAY=""; export DISPLAY + +echo "Installing OpenOffice PBI" +chmod 755 ${COMPTMPDIR}/${CFILE} +${COMPTMPDIR}/${CFILE} -text -accept diff --git a/PCBSD/pc-sysinstall/components/openoffice/component.cfg b/PCBSD/pc-sysinstall/components/openoffice/component.cfg new file mode 100644 index 0000000..3f273b5 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/openoffice/component.cfg @@ -0,0 +1,4 @@ +# OpenOffice component file +name: OpenOffice.org +description: Full featured office suite +type: PBI diff --git a/PCBSD/pc-sysinstall/components/openoffice/component.cfg.uk b/PCBSD/pc-sysinstall/components/openoffice/component.cfg.uk new file mode 100644 index 0000000..73b6d38 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/openoffice/component.cfg.uk @@ -0,0 +1,4 @@ +# OpenOffice component file +name: OpenOffice.org +description: Повнофункціональний офісний пакет +type: PBI diff --git a/PCBSD/pc-sysinstall/components/openoffice/component.png b/PCBSD/pc-sysinstall/components/openoffice/component.png Binary files differnew file mode 100644 index 0000000..972e4b9 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/openoffice/component.png diff --git a/PCBSD/pc-sysinstall/components/openoffice/install.sh b/PCBSD/pc-sysinstall/components/openoffice/install.sh new file mode 100755 index 0000000..39149b4 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/openoffice/install.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# This script installs the PBI + +DISPLAY=""; export DISPLAY + +echo "Installing OpenOffice PBI" +chmod 755 ${COMPTMPDIR}/${CFILE} +${COMPTMPDIR}/${CFILE} -text -accept diff --git a/PCBSD/pc-sysinstall/components/opera/.svn/entries b/PCBSD/pc-sysinstall/components/opera/.svn/entries new file mode 100644 index 0000000..845713d --- /dev/null +++ b/PCBSD/pc-sysinstall/components/opera/.svn/entries @@ -0,0 +1,164 @@ +10 + +dir +6759 +svn://svn.pcbsd.org/pcbsd/current/pc-sysinstall/components/opera +svn://svn.pcbsd.org + + + +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + +212fe199-4beb-da11-a70e-00e08102fd27 + +install.sh +file + + + + +2010-05-23T00:20:48.000000Z +23107ef549533aebe07479c387127961 +2009-11-13T19:27:59.556003Z +5019 +kris +has-props + + + + + + + + + + + + + + + + + + + + +168 + +component.cfg +file + + + + +2010-05-23T00:20:48.000000Z +4e44b212d531d67ca02a2852d24c3110 +2009-11-13T19:27:59.556003Z +5019 +kris + + + + + + + + + + + + + + + + + + + + + +93 + +component.png +file + + + + +2010-05-23T00:20:48.000000Z +b7c2cc2f4f65ea874915dddbc61d6ea0 +2009-07-10T19:42:19.051400Z +4215 +kris +has-props + + + + + + + + + + + + + + + + + + + + +12857 + +component.cfg.uk +file + + + + +2010-05-23T00:20:48.000000Z +b4c2c54fe8cca91598266f822d8ac6a9 +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + + + + + + + + +132 + diff --git a/PCBSD/pc-sysinstall/components/opera/.svn/lock b/PCBSD/pc-sysinstall/components/opera/.svn/lock new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/opera/.svn/lock diff --git a/PCBSD/pc-sysinstall/components/opera/.svn/prop-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/opera/.svn/prop-base/component.png.svn-base new file mode 100644 index 0000000..dbc918b --- /dev/null +++ b/PCBSD/pc-sysinstall/components/opera/.svn/prop-base/component.png.svn-base @@ -0,0 +1,9 @@ +K 14 +svn:executable +V 1 +* +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/PCBSD/pc-sysinstall/components/opera/.svn/prop-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/opera/.svn/prop-base/install.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/opera/.svn/prop-base/install.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/components/opera/.svn/text-base/component.cfg.svn-base b/PCBSD/pc-sysinstall/components/opera/.svn/text-base/component.cfg.svn-base new file mode 100644 index 0000000..2f16676 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/opera/.svn/text-base/component.cfg.svn-base @@ -0,0 +1,4 @@ +# Opera component file +name: Opera +description: Web Browser with BitTorrent client +type: PBI diff --git a/PCBSD/pc-sysinstall/components/opera/.svn/text-base/component.cfg.uk.svn-base b/PCBSD/pc-sysinstall/components/opera/.svn/text-base/component.cfg.uk.svn-base new file mode 100644 index 0000000..acdd12c --- /dev/null +++ b/PCBSD/pc-sysinstall/components/opera/.svn/text-base/component.cfg.uk.svn-base @@ -0,0 +1,4 @@ +# Opera component file +name: Opera +description: Веб браузер з вбудованим клієнтом BitTorrent +type: PBI diff --git a/PCBSD/pc-sysinstall/components/opera/.svn/text-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/opera/.svn/text-base/component.png.svn-base Binary files differnew file mode 100644 index 0000000..5699124 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/opera/.svn/text-base/component.png.svn-base diff --git a/PCBSD/pc-sysinstall/components/opera/.svn/text-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/opera/.svn/text-base/install.sh.svn-base new file mode 100644 index 0000000..c91674b --- /dev/null +++ b/PCBSD/pc-sysinstall/components/opera/.svn/text-base/install.sh.svn-base @@ -0,0 +1,8 @@ +#!/bin/sh +# This script installs the PBI + +DISPLAY=""; export DISPLAY + +echo "Installing Opera PBI" +chmod 755 ${COMPTMPDIR}/${CFILE} +${COMPTMPDIR}/${CFILE} -text -accept diff --git a/PCBSD/pc-sysinstall/components/opera/component.cfg b/PCBSD/pc-sysinstall/components/opera/component.cfg new file mode 100644 index 0000000..2f16676 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/opera/component.cfg @@ -0,0 +1,4 @@ +# Opera component file +name: Opera +description: Web Browser with BitTorrent client +type: PBI diff --git a/PCBSD/pc-sysinstall/components/opera/component.cfg.uk b/PCBSD/pc-sysinstall/components/opera/component.cfg.uk new file mode 100644 index 0000000..acdd12c --- /dev/null +++ b/PCBSD/pc-sysinstall/components/opera/component.cfg.uk @@ -0,0 +1,4 @@ +# Opera component file +name: Opera +description: Веб браузер з вбудованим клієнтом BitTorrent +type: PBI diff --git a/PCBSD/pc-sysinstall/components/opera/component.png b/PCBSD/pc-sysinstall/components/opera/component.png Binary files differnew file mode 100755 index 0000000..5699124 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/opera/component.png diff --git a/PCBSD/pc-sysinstall/components/opera/install.sh b/PCBSD/pc-sysinstall/components/opera/install.sh new file mode 100755 index 0000000..c91674b --- /dev/null +++ b/PCBSD/pc-sysinstall/components/opera/install.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# This script installs the PBI + +DISPLAY=""; export DISPLAY + +echo "Installing Opera PBI" +chmod 755 ${COMPTMPDIR}/${CFILE} +${COMPTMPDIR}/${CFILE} -text -accept diff --git a/PCBSD/pc-sysinstall/components/pidgin/.svn/entries b/PCBSD/pc-sysinstall/components/pidgin/.svn/entries new file mode 100644 index 0000000..a77163a --- /dev/null +++ b/PCBSD/pc-sysinstall/components/pidgin/.svn/entries @@ -0,0 +1,164 @@ +10 + +dir +6759 +svn://svn.pcbsd.org/pcbsd/current/pc-sysinstall/components/pidgin +svn://svn.pcbsd.org + + + +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + +212fe199-4beb-da11-a70e-00e08102fd27 + +install.sh +file + + + + +2010-05-23T00:20:48.000000Z +d71f2bcf2d180dbff557b958c7b61de4 +2009-11-13T19:27:59.556003Z +5019 +kris +has-props + + + + + + + + + + + + + + + + + + + + +169 + +component.cfg +file + + + + +2010-05-23T00:20:48.000000Z +1e5f9eeeb5ffbf250c9df391bd868ad1 +2009-11-13T19:27:59.556003Z +5019 +kris + + + + + + + + + + + + + + + + + + + + + +85 + +component.png +file + + + + +2010-05-23T00:20:48.000000Z +d456b01e7aad53528b3ae2e9b8c183be +2009-07-10T19:42:19.051400Z +4215 +kris +has-props + + + + + + + + + + + + + + + + + + + + +4087 + +component.cfg.uk +file + + + + +2010-05-23T00:20:48.000000Z +02eaffed19388e899888ec538ed2116c +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + + + + + + + + +180 + diff --git a/PCBSD/pc-sysinstall/components/pidgin/.svn/lock b/PCBSD/pc-sysinstall/components/pidgin/.svn/lock new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/pidgin/.svn/lock diff --git a/PCBSD/pc-sysinstall/components/pidgin/.svn/prop-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/pidgin/.svn/prop-base/component.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/PCBSD/pc-sysinstall/components/pidgin/.svn/prop-base/component.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/PCBSD/pc-sysinstall/components/pidgin/.svn/prop-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/pidgin/.svn/prop-base/install.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/pidgin/.svn/prop-base/install.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/components/pidgin/.svn/text-base/component.cfg.svn-base b/PCBSD/pc-sysinstall/components/pidgin/.svn/text-base/component.cfg.svn-base new file mode 100644 index 0000000..cf59983 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/pidgin/.svn/text-base/component.cfg.svn-base @@ -0,0 +1,4 @@ +# Pidgin component file +name: Pidgin +description: Multi-protocol IM Client +type: PBI diff --git a/PCBSD/pc-sysinstall/components/pidgin/.svn/text-base/component.cfg.uk.svn-base b/PCBSD/pc-sysinstall/components/pidgin/.svn/text-base/component.cfg.uk.svn-base new file mode 100644 index 0000000..389bd6b --- /dev/null +++ b/PCBSD/pc-sysinstall/components/pidgin/.svn/text-base/component.cfg.uk.svn-base @@ -0,0 +1,4 @@ +# Pidgin component file +name: Pidgin +description: Багатопротокольна програма для обміну миттєвими повідомленнями +type: PBI diff --git a/PCBSD/pc-sysinstall/components/pidgin/.svn/text-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/pidgin/.svn/text-base/component.png.svn-base Binary files differnew file mode 100644 index 0000000..ce6d31f --- /dev/null +++ b/PCBSD/pc-sysinstall/components/pidgin/.svn/text-base/component.png.svn-base diff --git a/PCBSD/pc-sysinstall/components/pidgin/.svn/text-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/pidgin/.svn/text-base/install.sh.svn-base new file mode 100644 index 0000000..be57e53 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/pidgin/.svn/text-base/install.sh.svn-base @@ -0,0 +1,8 @@ +#!/bin/sh +# This script installs the PBI + +DISPLAY=""; export DISPLAY + +echo "Installing Pidgin PBI" +chmod 755 ${COMPTMPDIR}/${CFILE} +${COMPTMPDIR}/${CFILE} -text -accept diff --git a/PCBSD/pc-sysinstall/components/pidgin/component.cfg b/PCBSD/pc-sysinstall/components/pidgin/component.cfg new file mode 100644 index 0000000..cf59983 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/pidgin/component.cfg @@ -0,0 +1,4 @@ +# Pidgin component file +name: Pidgin +description: Multi-protocol IM Client +type: PBI diff --git a/PCBSD/pc-sysinstall/components/pidgin/component.cfg.uk b/PCBSD/pc-sysinstall/components/pidgin/component.cfg.uk new file mode 100644 index 0000000..389bd6b --- /dev/null +++ b/PCBSD/pc-sysinstall/components/pidgin/component.cfg.uk @@ -0,0 +1,4 @@ +# Pidgin component file +name: Pidgin +description: Багатопротокольна програма для обміну миттєвими повідомленнями +type: PBI diff --git a/PCBSD/pc-sysinstall/components/pidgin/component.png b/PCBSD/pc-sysinstall/components/pidgin/component.png Binary files differnew file mode 100644 index 0000000..ce6d31f --- /dev/null +++ b/PCBSD/pc-sysinstall/components/pidgin/component.png diff --git a/PCBSD/pc-sysinstall/components/pidgin/install.sh b/PCBSD/pc-sysinstall/components/pidgin/install.sh new file mode 100755 index 0000000..be57e53 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/pidgin/install.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# This script installs the PBI + +DISPLAY=""; export DISPLAY + +echo "Installing Pidgin PBI" +chmod 755 ${COMPTMPDIR}/${CFILE} +${COMPTMPDIR}/${CFILE} -text -accept diff --git a/PCBSD/pc-sysinstall/components/ports/.svn/entries b/PCBSD/pc-sysinstall/components/ports/.svn/entries new file mode 100644 index 0000000..139e310 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/ports/.svn/entries @@ -0,0 +1,198 @@ +10 + +dir +6759 +svn://svn.pcbsd.org/pcbsd/current/pc-sysinstall/components/ports +svn://svn.pcbsd.org + + + +2010-05-03T18:12:20.892984Z +6634 +kris + + + + + + + + + + + + + + +212fe199-4beb-da11-a70e-00e08102fd27 + +install.sh +file + + + + +2010-05-23T00:20:48.000000Z +6645968e7ae1e3e4c9c9b6e4cd92f58b +2010-05-03T18:12:20.892984Z +6634 +kris +has-props + + + + + + + + + + + + + + + + + + + + +543 + +component.cfg +file + + + + +2010-05-23T00:20:48.000000Z +478d2b9f9d793ae4b0671ccf9c0249ff +2009-11-13T19:27:59.556003Z +5019 +kris + + + + + + + + + + + + + + + + + + + + + +97 + +component.png +file + + + + +2010-05-23T00:20:48.000000Z +1e03f59b8167e57ec225c8901d944ff6 +2009-07-10T19:42:19.051400Z +4215 +kris +has-props + + + + + + + + + + + + + + + + + + + + +6757 + +distfiles +file + + + + +2010-05-23T00:20:48.000000Z +004c9e9cc1c60e2909cfb0a9ee9d6990 +2009-11-13T19:27:59.556003Z +5019 +kris + + + + + + + + + + + + + + + + + + + + + +43 + +component.cfg.uk +file + + + + +2010-05-23T00:20:48.000000Z +045bd7967df4050010e9b231a87bdc90 +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + + + + + + + + +110 + diff --git a/PCBSD/pc-sysinstall/components/ports/.svn/lock b/PCBSD/pc-sysinstall/components/ports/.svn/lock new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/ports/.svn/lock diff --git a/PCBSD/pc-sysinstall/components/ports/.svn/prop-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/ports/.svn/prop-base/component.png.svn-base new file mode 100644 index 0000000..dbc918b --- /dev/null +++ b/PCBSD/pc-sysinstall/components/ports/.svn/prop-base/component.png.svn-base @@ -0,0 +1,9 @@ +K 14 +svn:executable +V 1 +* +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/PCBSD/pc-sysinstall/components/ports/.svn/prop-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/ports/.svn/prop-base/install.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/ports/.svn/prop-base/install.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/components/ports/.svn/text-base/component.cfg.svn-base b/PCBSD/pc-sysinstall/components/ports/.svn/text-base/component.cfg.svn-base new file mode 100644 index 0000000..aa53819 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/ports/.svn/text-base/component.cfg.svn-base @@ -0,0 +1,4 @@ +# System Source Component +name: Ports Tree +description: FreeBSD ports collection +type: component diff --git a/PCBSD/pc-sysinstall/components/ports/.svn/text-base/component.cfg.uk.svn-base b/PCBSD/pc-sysinstall/components/ports/.svn/text-base/component.cfg.uk.svn-base new file mode 100644 index 0000000..f524acd --- /dev/null +++ b/PCBSD/pc-sysinstall/components/ports/.svn/text-base/component.cfg.uk.svn-base @@ -0,0 +1,4 @@ +# System Source Component +name: Ports Tree +description: Колекція портів FreeBSD +type: component diff --git a/PCBSD/pc-sysinstall/components/ports/.svn/text-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/ports/.svn/text-base/component.png.svn-base Binary files differnew file mode 100644 index 0000000..2053a1e --- /dev/null +++ b/PCBSD/pc-sysinstall/components/ports/.svn/text-base/component.png.svn-base diff --git a/PCBSD/pc-sysinstall/components/ports/.svn/text-base/distfiles.svn-base b/PCBSD/pc-sysinstall/components/ports/.svn/text-base/distfiles.svn-base new file mode 100644 index 0000000..cd3b19e --- /dev/null +++ b/PCBSD/pc-sysinstall/components/ports/.svn/text-base/distfiles.svn-base @@ -0,0 +1 @@ +ports.tbz:7dcf759f0d920720328ca296f078f02e diff --git a/PCBSD/pc-sysinstall/components/ports/.svn/text-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/ports/.svn/text-base/install.sh.svn-base new file mode 100644 index 0000000..78ea35c --- /dev/null +++ b/PCBSD/pc-sysinstall/components/ports/.svn/text-base/install.sh.svn-base @@ -0,0 +1,18 @@ +#!/bin/sh +# Available Variables +# COMPTMPDIR = Set to the tmpdir that contains CFILE +# CFILE = Set to the file provided by this component +# This script installs the freebsd source + +rm -rf /usr/ports +mkdir /usr/ports +cd /usr/ports +echo "Extracting ports tree..." +tar xvjf ${COMPTMPDIR}/${CFILE} >/dev/null 2>/dev/null + +if [ -d "/usr/jails/portjail/usr" ] ; then + echo "Extracting ports tree into portsjail..." + mkdir -p /usr/jails/portjail/usr/ports + cd /usr/jails/portjail/usr/ports + tar xvjf ${COMPTMPDIR}/${CFILE} >/dev/null 2>/dev/null +fi diff --git a/PCBSD/pc-sysinstall/components/ports/component.cfg b/PCBSD/pc-sysinstall/components/ports/component.cfg new file mode 100644 index 0000000..aa53819 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/ports/component.cfg @@ -0,0 +1,4 @@ +# System Source Component +name: Ports Tree +description: FreeBSD ports collection +type: component diff --git a/PCBSD/pc-sysinstall/components/ports/component.cfg.uk b/PCBSD/pc-sysinstall/components/ports/component.cfg.uk new file mode 100644 index 0000000..f524acd --- /dev/null +++ b/PCBSD/pc-sysinstall/components/ports/component.cfg.uk @@ -0,0 +1,4 @@ +# System Source Component +name: Ports Tree +description: Колекція портів FreeBSD +type: component diff --git a/PCBSD/pc-sysinstall/components/ports/component.png b/PCBSD/pc-sysinstall/components/ports/component.png Binary files differnew file mode 100755 index 0000000..2053a1e --- /dev/null +++ b/PCBSD/pc-sysinstall/components/ports/component.png diff --git a/PCBSD/pc-sysinstall/components/ports/distfiles b/PCBSD/pc-sysinstall/components/ports/distfiles new file mode 100644 index 0000000..cd3b19e --- /dev/null +++ b/PCBSD/pc-sysinstall/components/ports/distfiles @@ -0,0 +1 @@ +ports.tbz:7dcf759f0d920720328ca296f078f02e diff --git a/PCBSD/pc-sysinstall/components/ports/install.sh b/PCBSD/pc-sysinstall/components/ports/install.sh new file mode 100755 index 0000000..78ea35c --- /dev/null +++ b/PCBSD/pc-sysinstall/components/ports/install.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# Available Variables +# COMPTMPDIR = Set to the tmpdir that contains CFILE +# CFILE = Set to the file provided by this component +# This script installs the freebsd source + +rm -rf /usr/ports +mkdir /usr/ports +cd /usr/ports +echo "Extracting ports tree..." +tar xvjf ${COMPTMPDIR}/${CFILE} >/dev/null 2>/dev/null + +if [ -d "/usr/jails/portjail/usr" ] ; then + echo "Extracting ports tree into portsjail..." + mkdir -p /usr/jails/portjail/usr/ports + cd /usr/jails/portjail/usr/ports + tar xvjf ${COMPTMPDIR}/${CFILE} >/dev/null 2>/dev/null +fi diff --git a/PCBSD/pc-sysinstall/components/src/.svn/entries b/PCBSD/pc-sysinstall/components/src/.svn/entries new file mode 100644 index 0000000..3e87260 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/src/.svn/entries @@ -0,0 +1,198 @@ +10 + +dir +6759 +svn://svn.pcbsd.org/pcbsd/current/pc-sysinstall/components/src +svn://svn.pcbsd.org + + + +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + +212fe199-4beb-da11-a70e-00e08102fd27 + +install.sh +file + + + + +2010-05-23T00:20:48.000000Z +21e07c11486a922e5d0b20dd4ba8b104 +2009-07-10T19:42:19.051400Z +4215 +kris +has-props + + + + + + + + + + + + + + + + + + + + +374 + +component.cfg +file + + + + +2010-05-23T00:20:48.000000Z +8a370ac29fe6178da3d1c7fd2bb26a6e +2009-11-13T19:27:59.556003Z +5019 +kris + + + + + + + + + + + + + + + + + + + + + +95 + +component.png +file + + + + +2010-05-23T00:20:48.000000Z +109f92fa26765d845bac3e4d6fb91430 +2009-07-10T19:42:19.051400Z +4215 +kris +has-props + + + + + + + + + + + + + + + + + + + + +2778 + +distfiles +file + + + + +2010-05-23T00:20:48.000000Z +2c22ad98a81edc2cfb4a1298e89bd8ca +2009-11-13T19:27:59.556003Z +5019 +kris + + + + + + + + + + + + + + + + + + + + + +41 + +component.cfg.uk +file + + + + +2010-05-23T00:20:48.000000Z +4ca1904c759ec25e6dabd647a7c27559 +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + + + + + + + + +105 + diff --git a/PCBSD/pc-sysinstall/components/src/.svn/lock b/PCBSD/pc-sysinstall/components/src/.svn/lock new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/src/.svn/lock diff --git a/PCBSD/pc-sysinstall/components/src/.svn/prop-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/src/.svn/prop-base/component.png.svn-base new file mode 100644 index 0000000..dbc918b --- /dev/null +++ b/PCBSD/pc-sysinstall/components/src/.svn/prop-base/component.png.svn-base @@ -0,0 +1,9 @@ +K 14 +svn:executable +V 1 +* +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/PCBSD/pc-sysinstall/components/src/.svn/prop-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/src/.svn/prop-base/install.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/src/.svn/prop-base/install.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/components/src/.svn/text-base/component.cfg.svn-base b/PCBSD/pc-sysinstall/components/src/.svn/text-base/component.cfg.svn-base new file mode 100644 index 0000000..e1688d5 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/src/.svn/text-base/component.cfg.svn-base @@ -0,0 +1,4 @@ +# System Source Component +name: Source Code +description: FreeBSD system source +type: component diff --git a/PCBSD/pc-sysinstall/components/src/.svn/text-base/component.cfg.uk.svn-base b/PCBSD/pc-sysinstall/components/src/.svn/text-base/component.cfg.uk.svn-base new file mode 100644 index 0000000..830ba1f --- /dev/null +++ b/PCBSD/pc-sysinstall/components/src/.svn/text-base/component.cfg.uk.svn-base @@ -0,0 +1,4 @@ +# System Source Component +name: Source Code +description: Вихідні коди FreeBSD +type: component diff --git a/PCBSD/pc-sysinstall/components/src/.svn/text-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/src/.svn/text-base/component.png.svn-base Binary files differnew file mode 100644 index 0000000..8244b71 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/src/.svn/text-base/component.png.svn-base diff --git a/PCBSD/pc-sysinstall/components/src/.svn/text-base/distfiles.svn-base b/PCBSD/pc-sysinstall/components/src/.svn/text-base/distfiles.svn-base new file mode 100644 index 0000000..9c0545c --- /dev/null +++ b/PCBSD/pc-sysinstall/components/src/.svn/text-base/distfiles.svn-base @@ -0,0 +1 @@ +src.tbz:5aa6ed2b2d3b99dbb5beea941cca6659 diff --git a/PCBSD/pc-sysinstall/components/src/.svn/text-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/src/.svn/text-base/install.sh.svn-base new file mode 100644 index 0000000..6559380 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/src/.svn/text-base/install.sh.svn-base @@ -0,0 +1,12 @@ +#!/bin/sh +# Available Variables +# COMPTMPDIR = Set to the tmpdir that contains CFILE +# CFILE = Set to the file(s) provided by this component +# Comma delimited, if more than one file +# This script installs the freebsd source + +rm -rf /usr/src +mkdir /usr/src +cd /usr/src +echo "Extracting FREEBSD source tree..." +tar xvjf ${COMPTMPDIR}/${CFILE} >/dev/null 2>/dev/null diff --git a/PCBSD/pc-sysinstall/components/src/component.cfg b/PCBSD/pc-sysinstall/components/src/component.cfg new file mode 100644 index 0000000..e1688d5 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/src/component.cfg @@ -0,0 +1,4 @@ +# System Source Component +name: Source Code +description: FreeBSD system source +type: component diff --git a/PCBSD/pc-sysinstall/components/src/component.cfg.uk b/PCBSD/pc-sysinstall/components/src/component.cfg.uk new file mode 100644 index 0000000..830ba1f --- /dev/null +++ b/PCBSD/pc-sysinstall/components/src/component.cfg.uk @@ -0,0 +1,4 @@ +# System Source Component +name: Source Code +description: Вихідні коди FreeBSD +type: component diff --git a/PCBSD/pc-sysinstall/components/src/component.png b/PCBSD/pc-sysinstall/components/src/component.png Binary files differnew file mode 100755 index 0000000..8244b71 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/src/component.png diff --git a/PCBSD/pc-sysinstall/components/src/distfiles b/PCBSD/pc-sysinstall/components/src/distfiles new file mode 100644 index 0000000..9c0545c --- /dev/null +++ b/PCBSD/pc-sysinstall/components/src/distfiles @@ -0,0 +1 @@ +src.tbz:5aa6ed2b2d3b99dbb5beea941cca6659 diff --git a/PCBSD/pc-sysinstall/components/src/install.sh b/PCBSD/pc-sysinstall/components/src/install.sh new file mode 100755 index 0000000..6559380 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/src/install.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# Available Variables +# COMPTMPDIR = Set to the tmpdir that contains CFILE +# CFILE = Set to the file(s) provided by this component +# Comma delimited, if more than one file +# This script installs the freebsd source + +rm -rf /usr/src +mkdir /usr/src +cd /usr/src +echo "Extracting FREEBSD source tree..." +tar xvjf ${COMPTMPDIR}/${CFILE} >/dev/null 2>/dev/null diff --git a/PCBSD/pc-sysinstall/components/thewarden/.svn/entries b/PCBSD/pc-sysinstall/components/thewarden/.svn/entries new file mode 100644 index 0000000..d42b90b --- /dev/null +++ b/PCBSD/pc-sysinstall/components/thewarden/.svn/entries @@ -0,0 +1,164 @@ +10 + +dir +6759 +svn://svn.pcbsd.org/pcbsd/current/pc-sysinstall/components/thewarden +svn://svn.pcbsd.org + + + +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + +212fe199-4beb-da11-a70e-00e08102fd27 + +install.sh +file + + + + +2010-05-23T00:20:48.000000Z +24290455ece69e5b2cea8dea91d8b33f +2009-12-16T21:21:15.770078Z +5635 +kris +has-props + + + + + + + + + + + + + + + + + + + + +173 + +component.cfg +file + + + + +2010-05-23T00:20:48.000000Z +cf26258a04c19b3fe57ed454110f8751 +2009-12-16T21:21:15.770078Z +5635 +kris + + + + + + + + + + + + + + + + + + + + + +99 + +component.png +file + + + + +2010-05-23T00:20:48.000000Z +860a437c416c71d31a938f640315cf70 +2009-12-16T21:21:15.770078Z +5635 +kris +has-props + + + + + + + + + + + + + + + + + + + + +24204 + +component.cfg.uk +file + + + + +2010-05-23T00:20:48.000000Z +898b007367925bcecc6cf6d73d54b509 +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + + + + + + + + +112 + diff --git a/PCBSD/pc-sysinstall/components/thewarden/.svn/lock b/PCBSD/pc-sysinstall/components/thewarden/.svn/lock new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/thewarden/.svn/lock diff --git a/PCBSD/pc-sysinstall/components/thewarden/.svn/prop-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/thewarden/.svn/prop-base/component.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/PCBSD/pc-sysinstall/components/thewarden/.svn/prop-base/component.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/PCBSD/pc-sysinstall/components/thewarden/.svn/prop-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/thewarden/.svn/prop-base/install.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/thewarden/.svn/prop-base/install.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/components/thewarden/.svn/text-base/component.cfg.svn-base b/PCBSD/pc-sysinstall/components/thewarden/.svn/text-base/component.cfg.svn-base new file mode 100644 index 0000000..f2d43f4 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/thewarden/.svn/text-base/component.cfg.svn-base @@ -0,0 +1,4 @@ +# Warden component file +name: The Warden +description: Jail management and administration +type: PBI diff --git a/PCBSD/pc-sysinstall/components/thewarden/.svn/text-base/component.cfg.uk.svn-base b/PCBSD/pc-sysinstall/components/thewarden/.svn/text-base/component.cfg.uk.svn-base new file mode 100644 index 0000000..6ede26a --- /dev/null +++ b/PCBSD/pc-sysinstall/components/thewarden/.svn/text-base/component.cfg.uk.svn-base @@ -0,0 +1,4 @@ +# Warden component file +name: The Warden +description: Створення та керування Jail +type: PBI diff --git a/PCBSD/pc-sysinstall/components/thewarden/.svn/text-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/thewarden/.svn/text-base/component.png.svn-base Binary files differnew file mode 100644 index 0000000..c9db27d --- /dev/null +++ b/PCBSD/pc-sysinstall/components/thewarden/.svn/text-base/component.png.svn-base diff --git a/PCBSD/pc-sysinstall/components/thewarden/.svn/text-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/thewarden/.svn/text-base/install.sh.svn-base new file mode 100644 index 0000000..98bb1c9 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/thewarden/.svn/text-base/install.sh.svn-base @@ -0,0 +1,8 @@ +#!/bin/sh +# This script installs the PBI + +DISPLAY=""; export DISPLAY + +echo "Installing The Warden PBI" +chmod 755 ${COMPTMPDIR}/${CFILE} +${COMPTMPDIR}/${CFILE} -text -accept diff --git a/PCBSD/pc-sysinstall/components/thewarden/component.cfg b/PCBSD/pc-sysinstall/components/thewarden/component.cfg new file mode 100644 index 0000000..f2d43f4 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/thewarden/component.cfg @@ -0,0 +1,4 @@ +# Warden component file +name: The Warden +description: Jail management and administration +type: PBI diff --git a/PCBSD/pc-sysinstall/components/thewarden/component.cfg.uk b/PCBSD/pc-sysinstall/components/thewarden/component.cfg.uk new file mode 100644 index 0000000..6ede26a --- /dev/null +++ b/PCBSD/pc-sysinstall/components/thewarden/component.cfg.uk @@ -0,0 +1,4 @@ +# Warden component file +name: The Warden +description: Створення та керування Jail +type: PBI diff --git a/PCBSD/pc-sysinstall/components/thewarden/component.png b/PCBSD/pc-sysinstall/components/thewarden/component.png Binary files differnew file mode 100644 index 0000000..c9db27d --- /dev/null +++ b/PCBSD/pc-sysinstall/components/thewarden/component.png diff --git a/PCBSD/pc-sysinstall/components/thewarden/install.sh b/PCBSD/pc-sysinstall/components/thewarden/install.sh new file mode 100755 index 0000000..98bb1c9 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/thewarden/install.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# This script installs the PBI + +DISPLAY=""; export DISPLAY + +echo "Installing The Warden PBI" +chmod 755 ${COMPTMPDIR}/${CFILE} +${COMPTMPDIR}/${CFILE} -text -accept diff --git a/PCBSD/pc-sysinstall/components/thunderbird/.svn/entries b/PCBSD/pc-sysinstall/components/thunderbird/.svn/entries new file mode 100644 index 0000000..1320d78 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/thunderbird/.svn/entries @@ -0,0 +1,164 @@ +10 + +dir +6759 +svn://svn.pcbsd.org/pcbsd/current/pc-sysinstall/components/thunderbird +svn://svn.pcbsd.org + + + +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + +212fe199-4beb-da11-a70e-00e08102fd27 + +install.sh +file + + + + +2010-05-23T00:20:48.000000Z +8829b87cd525aba6b7fbf76e68ba22c9 +2009-11-13T19:27:59.556003Z +5019 +kris +has-props + + + + + + + + + + + + + + + + + + + + +174 + +component.cfg +file + + + + +2010-05-23T00:20:48.000000Z +5a4ce9f1b333f08d6ea6ae5619ed9424 +2009-11-13T19:27:59.556003Z +5019 +kris + + + + + + + + + + + + + + + + + + + + + +102 + +component.png +file + + + + +2010-05-23T00:20:48.000000Z +543a32aac59a74df6c10f79c04ef448b +2009-07-10T19:42:19.051400Z +4215 +kris +has-props + + + + + + + + + + + + + + + + + + + + +4761 + +component.cfg.uk +file + + + + +2010-05-23T00:20:48.000000Z +d26ab9d9961ad289c51bfd3c694c8a98 +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + + + + + + + + +153 + diff --git a/PCBSD/pc-sysinstall/components/thunderbird/.svn/lock b/PCBSD/pc-sysinstall/components/thunderbird/.svn/lock new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/thunderbird/.svn/lock diff --git a/PCBSD/pc-sysinstall/components/thunderbird/.svn/prop-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/thunderbird/.svn/prop-base/component.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/PCBSD/pc-sysinstall/components/thunderbird/.svn/prop-base/component.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/PCBSD/pc-sysinstall/components/thunderbird/.svn/prop-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/thunderbird/.svn/prop-base/install.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/thunderbird/.svn/prop-base/install.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/components/thunderbird/.svn/text-base/component.cfg.svn-base b/PCBSD/pc-sysinstall/components/thunderbird/.svn/text-base/component.cfg.svn-base new file mode 100644 index 0000000..dce2c7c --- /dev/null +++ b/PCBSD/pc-sysinstall/components/thunderbird/.svn/text-base/component.cfg.svn-base @@ -0,0 +1,4 @@ +# Thunderbird component file +name: Thunderbird +description: Mozilla's popular E-mail client +type: PBI diff --git a/PCBSD/pc-sysinstall/components/thunderbird/.svn/text-base/component.cfg.uk.svn-base b/PCBSD/pc-sysinstall/components/thunderbird/.svn/text-base/component.cfg.uk.svn-base new file mode 100644 index 0000000..e8a0449 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/thunderbird/.svn/text-base/component.cfg.uk.svn-base @@ -0,0 +1,4 @@ +# Thunderbird component file +name: Thunderbird +description: Популярний клієнт електронної пошти від Mozilla +type: PBI diff --git a/PCBSD/pc-sysinstall/components/thunderbird/.svn/text-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/thunderbird/.svn/text-base/component.png.svn-base Binary files differnew file mode 100644 index 0000000..f7a6c9b --- /dev/null +++ b/PCBSD/pc-sysinstall/components/thunderbird/.svn/text-base/component.png.svn-base diff --git a/PCBSD/pc-sysinstall/components/thunderbird/.svn/text-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/thunderbird/.svn/text-base/install.sh.svn-base new file mode 100644 index 0000000..2d17d59 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/thunderbird/.svn/text-base/install.sh.svn-base @@ -0,0 +1,8 @@ +#!/bin/sh +# This script installs the PBI + +DISPLAY=""; export DISPLAY + +echo "Installing Thunderbird PBI" +chmod 755 ${COMPTMPDIR}/${CFILE} +${COMPTMPDIR}/${CFILE} -text -accept diff --git a/PCBSD/pc-sysinstall/components/thunderbird/component.cfg b/PCBSD/pc-sysinstall/components/thunderbird/component.cfg new file mode 100644 index 0000000..dce2c7c --- /dev/null +++ b/PCBSD/pc-sysinstall/components/thunderbird/component.cfg @@ -0,0 +1,4 @@ +# Thunderbird component file +name: Thunderbird +description: Mozilla's popular E-mail client +type: PBI diff --git a/PCBSD/pc-sysinstall/components/thunderbird/component.cfg.uk b/PCBSD/pc-sysinstall/components/thunderbird/component.cfg.uk new file mode 100644 index 0000000..e8a0449 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/thunderbird/component.cfg.uk @@ -0,0 +1,4 @@ +# Thunderbird component file +name: Thunderbird +description: Популярний клієнт електронної пошти від Mozilla +type: PBI diff --git a/PCBSD/pc-sysinstall/components/thunderbird/component.png b/PCBSD/pc-sysinstall/components/thunderbird/component.png Binary files differnew file mode 100644 index 0000000..f7a6c9b --- /dev/null +++ b/PCBSD/pc-sysinstall/components/thunderbird/component.png diff --git a/PCBSD/pc-sysinstall/components/thunderbird/install.sh b/PCBSD/pc-sysinstall/components/thunderbird/install.sh new file mode 100755 index 0000000..2d17d59 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/thunderbird/install.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# This script installs the PBI + +DISPLAY=""; export DISPLAY + +echo "Installing Thunderbird PBI" +chmod 755 ${COMPTMPDIR}/${CFILE} +${COMPTMPDIR}/${CFILE} -text -accept diff --git a/PCBSD/pc-sysinstall/components/vlc/.svn/entries b/PCBSD/pc-sysinstall/components/vlc/.svn/entries new file mode 100644 index 0000000..be66fcc --- /dev/null +++ b/PCBSD/pc-sysinstall/components/vlc/.svn/entries @@ -0,0 +1,164 @@ +10 + +dir +6759 +svn://svn.pcbsd.org/pcbsd/current/pc-sysinstall/components/vlc +svn://svn.pcbsd.org + + + +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + +212fe199-4beb-da11-a70e-00e08102fd27 + +install.sh +file + + + + +2010-05-23T00:20:48.000000Z +cdc93bf18b5f07a1923e84d6748bf7f0 +2009-11-13T19:27:59.556003Z +5019 +kris +has-props + + + + + + + + + + + + + + + + + + + + +166 + +component.cfg +file + + + + +2010-05-23T00:20:48.000000Z +315c03e6d967d785ceb0ce3159582dd0 +2009-11-13T19:27:59.556003Z +5019 +kris + + + + + + + + + + + + + + + + + + + + + +100 + +component.png +file + + + + +2010-05-23T00:20:48.000000Z +07c4d90a5c0a459f10517cb2d4e61a09 +2009-07-10T19:42:19.051400Z +4215 +kris +has-props + + + + + + + + + + + + + + + + + + + + +5505 + +component.cfg.uk +file + + + + +2010-05-23T00:20:48.000000Z +c7822ba8ca7a86517d8eb769aa4e89d2 +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + + + + + + + + +170 + diff --git a/PCBSD/pc-sysinstall/components/vlc/.svn/lock b/PCBSD/pc-sysinstall/components/vlc/.svn/lock new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/vlc/.svn/lock diff --git a/PCBSD/pc-sysinstall/components/vlc/.svn/prop-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/vlc/.svn/prop-base/component.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/PCBSD/pc-sysinstall/components/vlc/.svn/prop-base/component.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/PCBSD/pc-sysinstall/components/vlc/.svn/prop-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/vlc/.svn/prop-base/install.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/vlc/.svn/prop-base/install.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/components/vlc/.svn/text-base/component.cfg.svn-base b/PCBSD/pc-sysinstall/components/vlc/.svn/text-base/component.cfg.svn-base new file mode 100644 index 0000000..5bdef93 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/vlc/.svn/text-base/component.cfg.svn-base @@ -0,0 +1,4 @@ +# VLC component file +name: VLC +description: Multimedia player with streaming capabilities +type: PBI diff --git a/PCBSD/pc-sysinstall/components/vlc/.svn/text-base/component.cfg.uk.svn-base b/PCBSD/pc-sysinstall/components/vlc/.svn/text-base/component.cfg.uk.svn-base new file mode 100644 index 0000000..610f555 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/vlc/.svn/text-base/component.cfg.uk.svn-base @@ -0,0 +1,4 @@ +# VLC component file +name: VLC +description: Мультимедійний програвач з можливістю потокового програвання +type: PBI diff --git a/PCBSD/pc-sysinstall/components/vlc/.svn/text-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/vlc/.svn/text-base/component.png.svn-base Binary files differnew file mode 100644 index 0000000..eaa81f4 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/vlc/.svn/text-base/component.png.svn-base diff --git a/PCBSD/pc-sysinstall/components/vlc/.svn/text-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/vlc/.svn/text-base/install.sh.svn-base new file mode 100644 index 0000000..77bc21f --- /dev/null +++ b/PCBSD/pc-sysinstall/components/vlc/.svn/text-base/install.sh.svn-base @@ -0,0 +1,8 @@ +#!/bin/sh +# This script installs the PBI + +DISPLAY=""; export DISPLAY + +echo "Installing VLC PBI" +chmod 755 ${COMPTMPDIR}/${CFILE} +${COMPTMPDIR}/${CFILE} -text -accept diff --git a/PCBSD/pc-sysinstall/components/vlc/component.cfg b/PCBSD/pc-sysinstall/components/vlc/component.cfg new file mode 100644 index 0000000..5bdef93 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/vlc/component.cfg @@ -0,0 +1,4 @@ +# VLC component file +name: VLC +description: Multimedia player with streaming capabilities +type: PBI diff --git a/PCBSD/pc-sysinstall/components/vlc/component.cfg.uk b/PCBSD/pc-sysinstall/components/vlc/component.cfg.uk new file mode 100644 index 0000000..610f555 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/vlc/component.cfg.uk @@ -0,0 +1,4 @@ +# VLC component file +name: VLC +description: Мультимедійний програвач з можливістю потокового програвання +type: PBI diff --git a/PCBSD/pc-sysinstall/components/vlc/component.png b/PCBSD/pc-sysinstall/components/vlc/component.png Binary files differnew file mode 100644 index 0000000..eaa81f4 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/vlc/component.png diff --git a/PCBSD/pc-sysinstall/components/vlc/install.sh b/PCBSD/pc-sysinstall/components/vlc/install.sh new file mode 100755 index 0000000..77bc21f --- /dev/null +++ b/PCBSD/pc-sysinstall/components/vlc/install.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# This script installs the PBI + +DISPLAY=""; export DISPLAY + +echo "Installing VLC PBI" +chmod 755 ${COMPTMPDIR}/${CFILE} +${COMPTMPDIR}/${CFILE} -text -accept diff --git a/PCBSD/pc-sysinstall/components/wine/.svn/entries b/PCBSD/pc-sysinstall/components/wine/.svn/entries new file mode 100644 index 0000000..025c8f9 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/wine/.svn/entries @@ -0,0 +1,164 @@ +10 + +dir +6759 +svn://svn.pcbsd.org/pcbsd/current/pc-sysinstall/components/wine +svn://svn.pcbsd.org + + + +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + +212fe199-4beb-da11-a70e-00e08102fd27 + +install.sh +file + + + + +2010-05-23T00:20:48.000000Z +8aa09d61a9287324e87572e486e19d77 +2009-12-16T21:21:15.770078Z +5635 +kris +has-props + + + + + + + + + + + + + + + + + + + + +167 + +component.cfg +file + + + + +2010-05-23T00:20:48.000000Z +492d1784fda11eefddd5f829ce8bc8f7 +2009-12-16T21:21:15.770078Z +5635 +kris + + + + + + + + + + + + + + + + + + + + + +125 + +component.png +file + + + + +2010-05-23T00:20:48.000000Z +b3620059f4ffe110c61a726b26e754eb +2009-12-16T21:21:15.770078Z +5635 +kris +has-props + + + + + + + + + + + + + + + + + + + + +3807 + +component.cfg.uk +file + + + + +2010-05-23T00:20:48.000000Z +6155eb10c5ca549380f8491d7da0a079 +2010-01-06T13:52:31.405839Z +5792 +ayerenkow + + + + + + + + + + + + + + + + + + + + + +173 + diff --git a/PCBSD/pc-sysinstall/components/wine/.svn/lock b/PCBSD/pc-sysinstall/components/wine/.svn/lock new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/wine/.svn/lock diff --git a/PCBSD/pc-sysinstall/components/wine/.svn/prop-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/wine/.svn/prop-base/component.png.svn-base new file mode 100644 index 0000000..dbc918b --- /dev/null +++ b/PCBSD/pc-sysinstall/components/wine/.svn/prop-base/component.png.svn-base @@ -0,0 +1,9 @@ +K 14 +svn:executable +V 1 +* +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/PCBSD/pc-sysinstall/components/wine/.svn/prop-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/wine/.svn/prop-base/install.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/wine/.svn/prop-base/install.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/components/wine/.svn/text-base/component.cfg.svn-base b/PCBSD/pc-sysinstall/components/wine/.svn/text-base/component.cfg.svn-base new file mode 100644 index 0000000..09c8e3f --- /dev/null +++ b/PCBSD/pc-sysinstall/components/wine/.svn/text-base/component.cfg.svn-base @@ -0,0 +1,4 @@ +# Warden component file +name: Wine +description: Allows running of native applications from other operating systems +type: PBI diff --git a/PCBSD/pc-sysinstall/components/wine/.svn/text-base/component.cfg.uk.svn-base b/PCBSD/pc-sysinstall/components/wine/.svn/text-base/component.cfg.uk.svn-base new file mode 100644 index 0000000..4689ce4 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/wine/.svn/text-base/component.cfg.uk.svn-base @@ -0,0 +1,4 @@ +# Warden component file +name: Wine +description: Дозволяє запускати "рідні" програми іншої операційної системи +type: PBI diff --git a/PCBSD/pc-sysinstall/components/wine/.svn/text-base/component.png.svn-base b/PCBSD/pc-sysinstall/components/wine/.svn/text-base/component.png.svn-base Binary files differnew file mode 100644 index 0000000..b7635e3 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/wine/.svn/text-base/component.png.svn-base diff --git a/PCBSD/pc-sysinstall/components/wine/.svn/text-base/install.sh.svn-base b/PCBSD/pc-sysinstall/components/wine/.svn/text-base/install.sh.svn-base new file mode 100644 index 0000000..084bf8a --- /dev/null +++ b/PCBSD/pc-sysinstall/components/wine/.svn/text-base/install.sh.svn-base @@ -0,0 +1,8 @@ +#!/bin/sh +# This script installs the PBI + +DISPLAY=""; export DISPLAY + +echo "Installing Wine PBI" +chmod 755 ${COMPTMPDIR}/${CFILE} +${COMPTMPDIR}/${CFILE} -text -accept diff --git a/PCBSD/pc-sysinstall/components/wine/component.cfg b/PCBSD/pc-sysinstall/components/wine/component.cfg new file mode 100644 index 0000000..09c8e3f --- /dev/null +++ b/PCBSD/pc-sysinstall/components/wine/component.cfg @@ -0,0 +1,4 @@ +# Warden component file +name: Wine +description: Allows running of native applications from other operating systems +type: PBI diff --git a/PCBSD/pc-sysinstall/components/wine/component.cfg.uk b/PCBSD/pc-sysinstall/components/wine/component.cfg.uk new file mode 100644 index 0000000..4689ce4 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/wine/component.cfg.uk @@ -0,0 +1,4 @@ +# Warden component file +name: Wine +description: Дозволяє запускати "рідні" програми іншої операційної системи +type: PBI diff --git a/PCBSD/pc-sysinstall/components/wine/component.png b/PCBSD/pc-sysinstall/components/wine/component.png Binary files differnew file mode 100755 index 0000000..b7635e3 --- /dev/null +++ b/PCBSD/pc-sysinstall/components/wine/component.png diff --git a/PCBSD/pc-sysinstall/components/wine/install.sh b/PCBSD/pc-sysinstall/components/wine/install.sh new file mode 100755 index 0000000..084bf8a --- /dev/null +++ b/PCBSD/pc-sysinstall/components/wine/install.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# This script installs the PBI + +DISPLAY=""; export DISPLAY + +echo "Installing Wine PBI" +chmod 755 ${COMPTMPDIR}/${CFILE} +${COMPTMPDIR}/${CFILE} -text -accept diff --git a/PCBSD/pc-sysinstall/conf/.svn/entries b/PCBSD/pc-sysinstall/conf/.svn/entries new file mode 100644 index 0000000..2b881ed --- /dev/null +++ b/PCBSD/pc-sysinstall/conf/.svn/entries @@ -0,0 +1,133 @@ +10 + +dir +6759 +svn://svn.pcbsd.org/pcbsd/current/pc-sysinstall/conf +svn://svn.pcbsd.org + + + +2010-05-12T11:58:13.574653Z +6710 +kris + + + + + + + + + + + + + + +212fe199-4beb-da11-a70e-00e08102fd27 + +exclude-from-upgrade +file + + + + +2010-05-23T00:20:49.000000Z +f6463b8da65f262c88492962fbb64515 +2010-02-02T16:50:02.613407Z +6156 +kris + + + + + + + + + + + + + + + + + + + + + +204 + +licenses +dir + +pc-sysinstall.conf +file + + + + +2010-05-23T00:20:49.000000Z +664e81b7764f5c4f366f1e507604fcb3 +2010-05-09T01:44:47.258849Z +6682 +johnh +has-props + + + + + + + + + + + + + + + + + + + + +1685 + +avail-langs +file + + + + +2010-05-23T00:20:49.000000Z +7e0a88b2dbdc2c58a5d2070f6b0baa83 +2010-05-12T11:58:13.574653Z +6710 +kris + + + + + + + + + + + + + + + + + + + + + +249 + diff --git a/PCBSD/pc-sysinstall/conf/.svn/lock b/PCBSD/pc-sysinstall/conf/.svn/lock new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/PCBSD/pc-sysinstall/conf/.svn/lock diff --git a/PCBSD/pc-sysinstall/conf/.svn/prop-base/pc-sysinstall.conf.svn-base b/PCBSD/pc-sysinstall/conf/.svn/prop-base/pc-sysinstall.conf.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/PCBSD/pc-sysinstall/conf/.svn/prop-base/pc-sysinstall.conf.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/PCBSD/pc-sysinstall/conf/.svn/text-base/avail-langs.svn-base b/PCBSD/pc-sysinstall/conf/.svn/text-base/avail-langs.svn-base new file mode 100644 index 0000000..bee4ab4 --- /dev/null +++ b/PCBSD/pc-sysinstall/conf/.svn/text-base/avail-langs.svn-base @@ -0,0 +1,19 @@ +en English +bg Bulgarian +ca Catalan +zh_TW Chinese_(Taiwan) +cs Czech +nl Dutch +fr French +de German +en_GB English_(UK) +en_ZA English_(South Africa) +it Italian +ja Japanese +pl Polish +pa Punjabi +ru Russian +sk Slovak +sl Slovenian +es Spanish +uk Ukrainian diff --git a/PCBSD/pc-sysinstall/conf/.svn/text-base/exclude-from-upgrade.svn-base b/PCBSD/pc-sysinstall/conf/.svn/text-base/exclude-from-upgrade.svn-base new file mode 100644 index 0000000..b0529d4 --- /dev/null +++ b/PCBSD/pc-sysinstall/conf/.svn/text-base/exclude-from-upgrade.svn-base @@ -0,0 +1,15 @@ +etc/fstab +dev +etc/passwd +etc/pwd.db +etc/group +etc/master.passwd +etc/spwd.db +etc/hosts +etc/resolv.conf +etc/localtime +etc/hosts +etc/X11 +etc/nsmb.conf +usr/Programs/.config/ProgList +Programs/.config/ProgList diff --git a/PCBSD/pc-sysinstall/conf/.svn/text-base/pc-sysinstall.conf.svn-base b/PCBSD/pc-sysinstall/conf/.svn/text-base/pc-sysinstall.conf.svn-base new file mode 100644 index 0000000..2d4735e --- /dev/null +++ b/PCBSD/pc-sysinstall/conf/.svn/text-base/pc-sysinstall.conf.svn-base @@ -0,0 +1,75 @@ +#!/bin/sh +# Configuration options for pc-sysinstall + +TMPDIR="/tmp/.pc-sysinstall" +export TMPDIR + +if [ ! -d "${TMPDIR}" ] +then + mkdir -p ${TMPDIR} + chmod 777 ${TMPDIR} +fi + +# Set our temp directory for storing partition information +PARTDIR="${TMPDIR}/part-info" +export PARTDIR + +# Set the SLICECFGDIR +SLICECFGDIR="${TMPDIR}/.slice-cfg" +export SLICECFGDIR + +# Set the MIRRORCFGDIR +MIRRORCFGDIR="${TMPDIR}/.mirror-cfg" +export MIRRORCFGDIR + +# Set the GELIKEYDIR +GELIKEYDIR="${TMPDIR}/.geli-keys" +export GELIKEYDIR + +# Set our log file +LOGOUT="${TMPDIR}/pc-sysinstall.log" +export LOGOUT + +# Set the number of rsync tries +RSYNCTRIES="3" +export RSYNCTRIES + +# Set our mount-points +CDMNT="/cdmnt-install" +FSMNT="/mnt" +UZIP_DIR="/usr" +BOOT_PART_MOUNT="/boot-mount" +export FSMNT CDMNT UZIP_DIR BOOT_PART_MOUNT + +# Set the location of component files on DVD / usb / ftp +# Relative to CDMNT or the FTP root +COMPFILEDIR="extras/" +export COMPFILEDIR + +# Set the component temp directory, which is relative to FSMNT +COMPTMPDIR="/usr/.componenttmp" +export COMPTMPDIR + +# Variables to set the location of installation data +UZIP_FILE="PCBSD.ufs.uzip" +TAR_FILE="PCBSD.tbz" +export UZIP_FILE TAR_FILE + +# Locations of FreeBSD only install files +FBSD_UZIP_FILE="fbsd-release.ufs.uzip" +FBSD_TAR_FILE="fbsd-release.tbz" +FBSD_BRANCH_DIR="8.0-CURRENT" +export FBSD_UZIP_FILE FBSD_TAR_FILE FBSD_BRANCH_DIR + +# Our internet mirror listing file location +NETSERVER="http://updates.pcbsd.org" +ARCH="`uname -m`" + +# Check if we are running on a PC-BSD Disk +if [ -e "/PCBSDVERSION" ] ; then + VERSION="`cat /PCBSDVERSION`" +else + VERSION="UNKNOWN" +fi + +MIRRORLIST="${NETSERVER}/mirrors-netinstall.php?ver=${VERSION}&arch=${ARCH}" diff --git a/PCBSD/pc-sysinstall/conf/avail-langs b/PCBSD/pc-sysinstall/conf/avail-langs new file mode 100644 index 0000000..bee4ab4 --- /dev/null +++ b/PCBSD/pc-sysinstall/conf/avail-langs @@ -0,0 +1,19 @@ +en English +bg Bulgarian +ca Catalan +zh_TW Chinese_(Taiwan) +cs Czech +nl Dutch +fr French +de German +en_GB English_(UK) +en_ZA English_(South Africa) +it Italian +ja Japanese +pl Polish +pa Punjabi +ru Russian +sk Slovak +sl Slovenian +es Spanish +uk Ukrainian diff --git a/PCBSD/pc-sysinstall/conf/exclude-from-upgrade b/PCBSD/pc-sysinstall/conf/exclude-from-upgrade new file mode 100644 index 0000000..b0529d4 --- /dev/null +++ b/PCBSD/pc-sysinstall/conf/exclude-from-upgrade @@ -0,0 +1,15 @@ +etc/fstab +dev +etc/passwd +etc/pwd.db +etc/group +etc/master.passwd +etc/spwd.db +etc/hosts +etc/resolv.conf +etc/localtime +etc/hosts +etc/X11 +etc/nsmb.conf +usr/Programs/.config/ProgList +Programs/.config/ProgList diff --git a/PCBSD/pc-sysinstall/conf/licenses/.svn/entries b/PCBSD/pc-sysinstall/conf/licenses/.svn/entries new file mode 100644 index 0000000..d7a5b0a --- /dev/null +++ b/PCBSD/pc-sysinstall/conf/licenses/.svn/entries @@ -0,0 +1,232 @@ +10 + +dir +6759 +svn://svn.pcbsd.org/pcbsd/current/pc-sysinstall/conf/licenses +svn://svn.pcbsd.org + + + +2009-10-07T19:49:26.064302Z +4603 +kris + + + + + + + + + + + + + + +212fe199-4beb-da11-a70e-00e08102fd27 + +bsd-uk.txt +file + + + + +2010-05-23T00:20:49.000000Z +258ae1d15188bfe25894f4c21060ad80 +2009-10-07T19:49:26.064302Z +4603 +kris + + + + + + + + + + + + + + + + + + + + + +3980 + +bsd-en.txt +file + + + + +2010-05-23T00:20:49.000000Z +d9a9c7f8e3cdeac440c653e24a0dd34e +2009-10-07T19:49:26.064302Z +4603 +kris + + + + + + + + + + + + + + + + + + + + + +1650 + +nvidia-en.txt +file + + + + +2010-05-23T00:20:49.000000Z +5567c7bfc5f03976b3b441a78d4a104c +2009-10-07T19:49:26.064302Z +4603 +kris + + + + + + + + + + + + + + + + + + + + + +5791 + +intel-en.txt +file + + + + +2010-05-23T00:20:49.000000Z +913d02c999af5ccda12b3bb9a5f96947 +2009-10-07T19:49:26.064302Z +4603 +kris + + + + + + + + + + + + + + + + + + + + + +12115 + +bsd-be.txt +file + + + + +2010-05-23T00:20:49.000000Z +9497e30bbade8f9cb9cfd9bebe2810c9 +2009-10-07T19:49:26.064302Z +4603 +kris + + + + + + + + + + + + + + + + + + + + + +3839 + +bsd-ru.txt +file + + + + +2010-05-23T00:20:49.000000Z +083d656fbae7532c568dcb280b0efebc +2009-10-07T19:49:26.064302Z +4603 +kris + + + + + + + + + + + + + + + + + + + + + +4145 + diff --git a/PCBSD/pc-sysinstall/conf/licenses/.svn/lock b/PCBSD/pc-sysinstall/conf/licenses/.svn/lock new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/PCBSD/pc-sysinstall/conf/licenses/.svn/lock diff --git a/PCBSD/pc-sysinstall/conf/licenses/.svn/text-base/bsd-be.txt.svn-base b/PCBSD/pc-sysinstall/conf/licenses/.svn/text-base/bsd-be.txt.svn-base new file mode 100644 index 0000000..dfd8de4 --- /dev/null +++ b/PCBSD/pc-sysinstall/conf/licenses/.svn/text-base/bsd-be.txt.svn-base @@ -0,0 +1,43 @@ +PC-BSD і яго зыходныя кампанэнты выпускаюцца пад ліцензіяй BSD. +Кампаненты базавай сістэмы выпускаюцца паводле іх ліцензіям. + + +-------------------------------------------------------------------------------- +Секцыя 1: Ліцэнзія BSD License +Секцыя 2: Ліцэнзія Intel Firmware +Секцыя 3: Ліцэнзійная дамова гуртовщика NVIDIA +-------------------------------------------------------------------------------- + + +Дазваляецца паўторная распаўсюджавнне і выкарыстанне як у выглядзе +зыходнага кода, так і у двайковай форме, з зменамі або без, пры +захаванні наступных умоў: + +* Пры паўторным распаўсюджавнні зыходнага коду павінна заставацца не +кранутым паведамленне аб аўтарскім праве дадзеннае вышей, гэты спіс +умоў і наступны адмова ад гарантый. +* Пры паўторным распаўсюджванні двайковага коду павінна заставацца не +кранутым вышэй дадзенная інфармацыя аб аўтарскім праве, гэты спіс умоў +і наступны адмова ад гарантый у дакументацыі і/або у іншых матэрыялах, +пастаўляных пры распаўсюджавнні. +* Ні назва PC-BSD Team, ні імёны яе супрацоўнікаў не могуць быць +выкарыстаны у якасці паддрымкі альбо дзеля распаўсюджвання прадуктаў, +заснаваных на гэтым праграмным забеспячэнні без папярэдняга пісьмовага +дазвола. + +ГЭТАЯ ПРАГРАМА ПРАДСТАЎЛЕНА БЯСПЛАТНА ЎЛАДАЛЬНІКАМІ АЎТАРСКІХ ПРАЎ +І/АБО ІНШЫМІ БАКАМІ "ЯК ЯНА ЁСЦЬ" БЕЗ ЯКАГА-БЫ НІБЫЛО ВІДУ ГАРАНТЫЙ, +ПРАДСТАЎЛЕНЫХ ВІДАВОЧНА АЛЬБО ЯК РАЗУМЕЮЦЦА, У ТЫМ ЛІКУ УКЛЮЧНА, АЛЕ +НЕ АБМЯЖОЎВАЮЧЫСЯ ІМІ, АДНОСНА ГАРАНТЫЙ КАМЕРЦЫЙНАЙ КАШТОЎНАСЦІ І +ПРЫДАТНАСЦІ ДЛЯ ПЭЎНАЙ МЭТЫ. +НІ Ў ЯКІМ РАЗЕ, КАЛІ ГЭТА НЕ ПАТРАБУЕ АДПАВЕДНЫ ЗАКОН, АЛЬБО НЕ +УСТАЛЯВАНА У ВУСНАЙ ФОРМЕ, НІ АДЗІН УЛАДАЛЬНІК АЎТАРСКІХ ПРАЎ І НІ +АДНА ІНШАЯ АСОБА, ЯКАЯ МОЖА ЗМЯНЯЦЬ І/АЛЬБО ПАЎТОРНА РАСПАЎСЮДЖВАЦЬ +ПРАГРАМУ, ЯК БЫЛО ПАДАДЗЕНА ВЫШЭЙ, НЕ НЯСЕ АДКАЗНАСЦІ, У ТЫМ ЛІКУ ЗА +ЛЮБЫЯ АГУЛЬНЫЯ, ВЫПАДКОВЫЯ, СПЕЦЫЯЛЬНЫЯ АЛЬБО БУДУЧЫЯ СТРАТЫ, У ВУНІКУ +ВЫКАРЫСТАННЯ ЦІ НЕ МАГЧЫМАСЦІ ВЫКАРЫСТАННЯ ПРАГРАМЫ (У ТЫМ ЛІКУ, АЛЕ +НЕ АБМЯЖОЎВАЮЧЫСЯ ЗГУБЛЕННЕМ ДАДЗЕННЫХ, АЛЬБО ДАДЗЕНЫМІ, ЯКІЯ СТАЛІ +НЯПРАВІЛЬНЫМІ АЛЬБО СТРАТАМІ ПРЫНЕСЕНЫМІ ПА ВАШАЙ АЛЬБО ТРЭЦІХ ЛІЦ +ВІНЕ, АЛЬБО АДМОВАЙ ПРАГРАМЫ ПРАЦАВАЦЬ СУМЕСНА С ІНШЫМІ ПРАГРАМАМІ), +НАВАТ КАЛІ ТАКІ УЛАДАЛЬНІК ЦІ ІНШАЯ АСОБА БЫЛІ ПАВЕДАМЛЕНЫ АБ +МАГЧЫМАСЦІ ТАКІХ СТРАТ. diff --git a/PCBSD/pc-sysinstall/conf/licenses/.svn/text-base/bsd-en.txt.svn-base b/PCBSD/pc-sysinstall/conf/licenses/.svn/text-base/bsd-en.txt.svn-base new file mode 100644 index 0000000..a30b67e --- /dev/null +++ b/PCBSD/pc-sysinstall/conf/licenses/.svn/text-base/bsd-en.txt.svn-base @@ -0,0 +1,24 @@ +SECTION 1: BSD LICENSE +-------------------------------------------------------------------------------- +Copyright (c) 1998, Regents of the University of California +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 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. + Neither the name of the University of California, Berkeley nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPR +ESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO E +VENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCI +DENTAL, 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 AN 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. diff --git a/PCBSD/pc-sysinstall/conf/licenses/.svn/text-base/bsd-ru.txt.svn-base b/PCBSD/pc-sysinstall/conf/licenses/.svn/text-base/bsd-ru.txt.svn-base new file mode 100644 index 0000000..ad058f5 --- /dev/null +++ b/PCBSD/pc-sysinstall/conf/licenses/.svn/text-base/bsd-ru.txt.svn-base @@ -0,0 +1,43 @@ +PC-BSD и его исходные тексты выпускаются под лицензией BSD. Компоненты базовой +системы выпускаются согласно их лицензиям. + +-------------------------------------------------------------------------------- +Секция 1: Лицензия BSD License +Секция 2: Лицензия Intel Firmware +Секция 3: Лицензионное соглашение гуртовщика NVIDIA +-------------------------------------------------------------------------------- + + + +СЕКЦИЯ 1: Лицензия BSD +-------------------------------------------------------------------------------- +Copyright (c) 1998, Regents of the University of California + +Разрешается повторное распространение и использование как в виде исходного кода, +так и в двоичной форме, с изменениями или без, при соблюдении следующих условий: + + * При повторном распространении исходного кода должно оставаться указанное + выше уведомление об авторском праве, этот список условий и последующий + отказ от гарантий. + * При повторном распространении двоичного кода должно сохраняться указанная + выше информация об авторском праве, этот список условий и последующий + отказ от гарантий в документации и/или в других материалах, поставляемых + при распространении. + * Ни название PC-BSD Team, ни имена ее сотрудников не могут быть + использованы в качестве поддержки или продвижения продуктов, основанных на + этом ПО без предварительного письменного разрешения. + +ЭТА ПРОГРАММА ПРЕДОСТАВЛЕНА БЕСПЛАТНО ВЛАДЕЛЬЦАМИ АВТОРСКИХ ПРАВ И/ИЛИ ДРУГИМИ СТОРОНАМИ +"КАК ОНА ЕСТЬ" БЕЗ КАКОГО-ЛИБО ВИДА ГАРАНТИЙ, ВЫРАЖЕННЫХ ЯВНО ИЛИ ПОДРАЗУМЕВАЕМЫХ, +ВКЛЮЧАЯ, НО НЕ ОГРАНИЧИВАЯСЬ ИМИ, ПОДРАЗУМЕВАЕМЫЕ ГАРАНТИИ КОММЕРЧЕСКОЙ ЦЕННОСТИ И +ПРИГОДНОСТИ ДЛЯ КОНКРЕТНОЙ ЦЕЛИ. НИ В КОЕМ СЛУЧАЕ, ЕСЛИ НЕ ТРЕБУЕТСЯ СООТВЕТСТВУЮЩИМ +ЗАКОНОМ, ИЛИ НЕ УСТАНОВЛЕНО В УСТНОЙ ФОРМЕ, НИ ОДИН ВЛАДЕЛЕЦ АВТОРСКИХ ПРАВ И НИ ОДНО +ДРУГОЕ ЛИЦО, КОТОРОЕ МОЖЕТ ИЗМЕНЯТЬ И/ИЛИ ПОВТОРНО РАСПРОСТРАНЯТЬ ПРОГРАММУ, КАК БЫЛО +СКАЗАНО ВЫШЕ, НЕ НЕСЁТ ОТВЕТСТВЕННОСТИ, ВКЛЮЧАЯ ЛЮБЫЕ ОБЩИЕ, СЛУЧАЙНЫЕ, +СПЕЦИАЛЬНЫЕ ИЛИ ПОСЛЕДОВАВШИЕ УБЫТКИ, В СЛЕДСТВИИ ИСПОЛЬЗОВАНИЯ ИЛИ НЕВОЗМОЖНОСТИ +ИСПОЛЬЗОВАНИЯ ПРОГРАММЫ (ВКЛЮЧАЯ, НО НЕ ОГРАНИЧИВАЯСЬ ПОТЕРЕЙ ДАННЫХ, ИЛИ ДАННЫМИ, +СТАВШИМИ НЕПРАВИЛЬНЫМИ, ИЛИ ПОТЕРЯМИ ПРИНЕСЕННЫМИ ИЗ-ЗА ВАС ИЛИ ТРЕТЬИХ ЛИЦ, ИЛИ ОТКАЗОМ +ПРОГРАММЫ РАБОТАТЬ СОВМЕСТНО С ДРУГИМИ ПРОГРАММАМИ), ДАЖЕ ЕСЛИ ТАКОЙ ВЛАДЕЛЕЦ ИЛИ +ДРУГОЕ ЛИЦО БЫЛИ ИЗВЕЩЕНЫ О ВОЗМОЖНОСТИ ТАКИХ УБЫТКОВ. + +Дальше пока переводить не буду, т.к. все равно до этого места никто читать не будет diff --git a/PCBSD/pc-sysinstall/conf/licenses/.svn/text-base/bsd-uk.txt.svn-base b/PCBSD/pc-sysinstall/conf/licenses/.svn/text-base/bsd-uk.txt.svn-base new file mode 100644 index 0000000..86fa577 --- /dev/null +++ b/PCBSD/pc-sysinstall/conf/licenses/.svn/text-base/bsd-uk.txt.svn-base @@ -0,0 +1,42 @@ +PC-BSD та його початкові тексти випускаються під ліцензією BSD. Компоненти базової системи випускаються згідно з їх ліцензією. + +-------------------------------------------------------------------------------- +Секція 1: Ліцензія BSD License +Секція 2: Ліцензія Intel Firmware +Секція 3: Ліцензійна згода гуртовщика NVIDIA +-------------------------------------------------------------------------------- + + +СЕКЦІЯ 1: Ліцензія BSD +-------------------------------------------------------------------------------- +Copyright (c) 1998, Regents of the University of California + +Дозволяється повторне розповсюдження та використання як у вигляді початкового коду, +так і у подвійній формі, з змінами або без, дотриманні наступних умов: + + * При повторному розповсюдженні початкового коду повинно лишатися вказане + попередження про авторські права, цей список умовний наступна відмова від + гарантій. + * При повторному розповсюдженні подвійного коду повинна залишитися вище вказана + інформація про авторські права, цей список умовний і наступна відмова від гарантій в + документації та/або в інших матеріалах, наданих при розповсюдженні. + * Ні назва PC-BSD Team,ні імена ії співпрацівників не можуть бути + використані якості підтримки або провадження продуктів, заснованих на + цьому ПЗ без ......... письмового дозволу. + +ЦЯ ПРОГРАМА НАДАНА БЕЗКОШТОВНО ВЛАСНИКАМИ АВТОРСЬКИХ ПРАВ ЧИ/АБО ШНШИМИ СТОРОНАМИ +"ЯК ВОНА Є" БЕЗ ЯКОГО-НЕБУТЬ ВИДУ ГАРАНТІЙ, ВИРАЖЕНИХ ЯВНО АБО МАЮЧИХ НА УВАЗІ, +АЛЕ НЕ ОБМЕЖУЮЧИСЬ НИМИ,МАЮЩІ НА УВАЗІ ГАРАНТІІ КОМЕРЧЕСЬКОЇ ЦІННОСТІ ТА ПРИДАТНОСТІ +ДЛЯ КІНЦЕВОГО НАМІРУ. НІ В ЯКОМУ РАЗІ, ЯК ЩО НЕ ВИМАГАЮТЬСЯ ВІДПОВІДНИМ ЗАКОНОМ, АБО +НЕ ВКАЗАНО В УСНІЙ ФОРМІ,НЕ ОДИН ВЛАСНИК АВТОРСЬКИХ ПРАВ ТА НЕ ОДНО ІНШЕ ЛИЦЕ, ЯКЕ МОЖЕ +ЗМІНЮВАТИ ЧИ/АБО ПОВТОРНО РОЗПОВСЮДЖУВАТИ ПРОГРАМУ,ЯК БУЛО СКАЗАНО ВИЩЕ, НЕ НЕСЕ +ВІДПОВІДАЛЬНОСТІ,ВКЛЮЧНО БУДЬ ЯКІ СПІЛЬНІ, ВИПАДКОВІ, СПЕЦІАЛЬНІ АБО ЗБИТКИ, ЩО ПІШЛИ, У НАСЛІДКУ + +ВИКОРИСТАННЯ АБО НЕМОЖЛИВОСТІ +ВИКОРИСТАННЯ ПРОГРАМИ (ВКЛЮЧАЮЧИ, АЛЕ НЕ ОБМЕЖУЮЧИСЬ ВТРАТОЮ ДАНИХ, АБО ДАНИМИ, +ЩОСТАЛИ НЕПРАВИЛЬНИМИ, АБО ВТРАТАМИ ПРИНЕСЕНИМИ ЧЕРЕЗ ВАС АБО ТРЕТІХ ОСІБ, АБО ВІДМОВОЮ +ПРОГРАМИ ПРАЦЮВАТИ РАЗОМ З ІНШИМИ ПРОГРАМАМИ), НАВІТЬ ЯКЩО ТАКИЙ ВЛАСНИК АБО +ІНША ОСОБА БУЛИ СПОВІЩЕНА ПРО МОЖЛИВІСТЬ ТАКИХ ЗБИТКІВ. + +Далі поки переводити не буду, тому що однаково до цього місця ніхто читати не буде + diff --git a/PCBSD/pc-sysinstall/conf/licenses/.svn/text-base/intel-en.txt.svn-base b/PCBSD/pc-sysinstall/conf/licenses/.svn/text-base/intel-en.txt.svn-base new file mode 100644 index 0000000..0858ff7 --- /dev/null +++ b/PCBSD/pc-sysinstall/conf/licenses/.svn/text-base/intel-en.txt.svn-base @@ -0,0 +1,207 @@ +Section 2: Intel Firmware license +-------------------------------------------------------------------------------- + TERMS AND CONDITIONS + IMPORTANT - PLEASE READ BEFORE INSTALLING OR USING THIS INTEL(C) SOFTWARE + +Do not use or load this firmware (the "Software") until you have carefully read +the following terms and conditions. By loading or using the Software, you agree +to the terms of this Agreement. If you do not wish to so agree, do not install +or use the Software. + +LICENSEES: + +Please note: + +* If you are an End-User, only Exhibit A, the SOFTWARE LICENSE AGREEMENT, + applies. +* If you are an Original Equipment Manufacturer (OEM), Independent Hardware + Vendor (IHV), or Independent Software Vendor (ISV), this complete Agreement + applies + +-------------------------------------------------------------------------------- + +For OEMs, IHVs, and ISVs: + +LICENSE. This Software is licensed for use only in conjunction with Intel +component products. Use of the Software in conjunction with non-Intel component +products is not licensed hereunder. Subject to the terms of this Agreement, +Intel grants to you a nonexclusive, nontransferable, worldwide, fully paid-up +license under Intel's copyrights to: (i) copy the Software internally for your +own development and maintenance purposes; (ii) copy and distribute the Software +to your end-users, but only under a license agreement with terms at least as +restrictive as those contained in Intel's Final, Single User License Agreement, +attached as Exhibit A; and (iii) modify, copy and distribute the end-user +documentation which may accompany the Software, but only in association with +the Software. + +If you are not the final manufacturer or vendor of a computer system or software +program incorporating the Software, then you may transfer a copy of the +Software, including any related documentation (modified or unmodified) to your +recipient for use in accordance with the terms of this Agreement, provided such +recipient agrees to be fully bound by the terms hereof. You shall not otherwise +assign, sublicense, lease, or in any other way transfer or disclose Software to +any third party. You may not, nor may you assist any other person or entity to +modify, translate, convert to another programming language, decompile, reverse +engineer, or disassemble any portion of the Software or otherwise attempt to +derive source code from any object code modules of the Software or any internal +data files generated by the Software. Your rights to redistribute the Software +shall be contingent upon your installation of this Agreement in its entirety in +the same directory as the Software. + +CONTRACTORS. For the purpose of this Agreement, and notwithstanding anything +to the contrary hereunder, solely with respect to the requirements for +compliance with the terms hereunder, any contractors or consultants that You +use to perform the work or otherwise assist You in the development or products +using this Software shall be deemed to be End Users and accordingly, upon +receipt of the Software, shall be bound by the terms of Exhibit A, Software +License Agreement. No additional agreement between You and such consultants or +contractors is required under this Agreement to detail such compliance. + +TRADEMARKS. Except as expressly provided herein, you shall not use Intel's +name in any publications, advertisements, or other announcements without +Intel's prior written consent. You do not have any rights to use any Intel +trademarks or logos. + +OWNERSHIP OF SOFTWARE AND COPYRIGHTS. Software and accompanying materials, if +any, are owned by Intel or its suppliers and licensors and may be protected by +copyright, trademark, patent and trade secret law and international treaties. +Any rights, express or implied, in the intellectual property embodied in the +foregoing, other than those specified in this Agreement, are reserved by Intel +and its suppliers and licensors or otherwise as set forth in any applicable +open source license agreement. You will keep the Software free of liens, +attachments, and other encumbrances. You agree not to remove any proprietary +notices and/or any labels from the Software and accompanying materials without +prior written approval by Intel + +LIMITATION OF LIABILITY. IN NO EVENT SHALL INTEL OR ITS SUPPLIERS AND LICENSORS +BE LIABLE FOR ANY DAMAGES WHATSOEVER FROM ANY CAUSE OF ACTION OF ANY KIND +(INCLUDING, WITHOUT LIMITATION, LOST PROFITS, BUSINESS INTERRUPTION, OR LOST +INFORMATION) ARISING OUT OF THE USE, MODIFICATION, OR INABILITY TO USE THE +INTEL SOFTWARE, OR OTHERWISE, NOR FOR PUNITIVE, INCIDENTAL, CONSEQUENTIAL, OR +SPECIAL DAMAGES OF ANY KIND, EVEN IF INTEL OR ITS SUPPLIERS AND LICENSORS HAS +BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME JURISDICTIONS PROHIBIT +EXCLUSION OR LIMITATION OF LIABILITY FOR IMPLIED WARRANTIES, CONSEQUENTIAL OR +INCIDENTAL DAMAGES, SO CERTAIN LIMITATIONS MAY NOT APPLY. YOU MAY ALSO HAVE +OTHER LEGAL RIGHTS THAT VARY BETWEEN JURISDICTIONS. + +EXCLUSION OF WARRANTIES. THE SOFTWARE IS PROVIDED "AS IS" AND POSSIBLY WITH +FAULTS. UNLESS EXPRESSLY AGREED OTHERWISE, INTEL AND ITS SUPPLIERS AND +LICENSORS DISCLAIM ANY AND ALL WARRANTIES AND GUARANTEES, EXPRESS, IMPLIED OR +OTHERWISE, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +NONINFRINGEMENT, OR FITNESS FOR A PARTICULAR PURPOSE. Intel does not warrant +or assume responsibility for the accuracy or completeness of any information, +text, graphics, links or other items contained within the Software. You assume +all liability, financial or otherwise, associated with Your use or disposition +of the Software. + +APPLICABLE LAW. Claims arising under this Agreement shall be governed by the +laws of State of California], excluding its principles of conflict of laws and +the United Nations Convention on Contracts for the Sale of Goods. + +WAIVER AND AMENDMENT. No modification, amendment or waiver of any provision of +this Agreement shall be effective unless in writing and signed by an officer of +Intel. No failure or delay in exercising any right, power, or remedy under +this Agreement shall operate as a waiver of any such right, power or remedy. +Without limiting the foregoing, terms and conditions on any purchase orders or +similar materials submitted by you to Intel, and any terms contained in Intels +standard acknowledgment form that are in conflict with these terms, shall be of +no force or effect. + +SEVERABILITY. If any provision of this Agreement is held by a court of +competent jurisdiction to be contrary to law, such provision shall be changed +and interpreted so as to best accomplish the objectives of the original +provision to the fullest extent allowed by law and the remaining provisions of +this Agreement shall remain in full force and effect. + +EXPORT RESTRICTIONS. Each party acknowledges that the Software is subject to +applicable import and export regulations of the United States and of the +countries in which each party transacts business, specifically including U.S. +Export Administration Act and Export Administration Regulations. Each party +shall comply with such laws and regulations, as well as all other laws and +regulations applicable to the Software. Without limiting the generality of the +foregoing, each party agrees that it will not export, re-export, transfer or +divert any of the Software or the direct programs thereof to any restricted +place or party in accordance with U.S. export regulations. Note that Software +containing encryption may be subject to additional restrictions. + +GOVERNMENT RESTRICTED RIGHTS. The Software is provided with "RESTRICTED RIGHTS." +Use, duplication, or disclosure by the Government is subject to restrictions as +set forth in FAR52.227-14 and DFAR252.227-7013 et seq. or their successors. Use +of the Software by the Government constitutes acknowledgment of Intel's +proprietary rights therein. Contractor or Manufacturer is Intel Corporation, +2200 Mission College Blvd., Santa Clara, CA 95052. + +TERMINATION OF THE AGREEMENT. Intel may terminate this Agreement if you violate +its terms. Upon termination, you will immediately destroy the Software or +return all copies of the Software to Intel. + +-------------------------------------------------------------------------------- + +EXHIBIT "A" + +SOFTWARE LICENSE AGREEMENT (Final, Single User) + +IMPORTANT - READ BEFORE COPYING, INSTALLING OR USING. + +Do not use or load this firmware image (the "Software") until you have carefully +read the following terms and conditions. By loading or using the Software, you +agree to the terms of this Agreement. If you do not wish to so agree, do not +install or use the Software. + +LICENSE. You may copy and use the Software, subject to these conditions: +1. This Software is licensed for use only in conjunction with Intel component + products. Use of the Software in conjunction with non-Intel component + products is not licensed hereunder. +2. You may not copy, modify, rent, sell, distribute or transfer any part of the + Software except as provided in this Agreement, and you agree to prevent + unauthorized copying of the Software. +3. You may not reverse engineer, decompile, or disassemble the Software. +4. You may not sublicense the Software. +5. The Software may contain the software or other property of third party + suppliers. + +OWNERSHIP OF SOFTWARE AND COPYRIGHTS. Title to all copies of the Software +remains with Intel or its suppliers. The Software is copyrighted and protected +by the laws of the United States and other countries, and international treaty +provisions. You may not remove any copyright notices from the Software. Intel +may make changes to the Software, or items referenced therein, at any time +without notice, but is not obligated to support or update the Software. Except +as otherwise expressly provided, Intel grants no express or implied right under +Intel patents, copyrights, trademarks, or other intellectual property rights. +You may transfer the Software only if a copy of this license accompanies the +Software and the recipient agrees to be fully bound by these terms. + +EXCLUSION OF OTHER WARRANTIES EXCEPT AS PROVIDED ABOVE, THE SOFTWARE IS PROVIDED +"AS IS" WITHOUT ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND INCLUDING +WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, OR FITNESS FOR A PARTICULAR +PURPOSE. Intel does not warrant or assume responsibility for the accuracy or +completeness of any information, text, graphics, links or other items contained +within the Software. + +LIMITATION OF LIABILITY. IN NO EVENT SHALL INTEL OR ITS SUPPLIERS BE LIABLE FOR +ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, LOST PROFITS, BUSINESS +INTERRUPTION, OR LOST INFORMATION) ARISING OUT OF THE USE OF OR INABILITY TO +USE THE SOFTWARE, EVEN IF INTEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. SOME JURISDICTIONS PROHIBIT EXCLUSION OR LIMITATION OF LIABILITY FOR +IMPLIED WARRANTIES OR CONSEQUENTIAL OR INCIDENTAL DAMAGES, SO THE ABOVE +LIMITATION MAY NOT APPLY TO YOU. YOU MAY ALSO HAVE OTHER LEGAL RIGHTS THAT VARY +BETWEEN JURISDICTIONS. + +TERMINATION OF THIS AGREEMENT. Intel may terminate this Agreement at any time if +you violate its terms. Upon termination, you will immediately destroy the +Software. + +APPLICABLE LAWS. Claims arising under this Agreement shall be governed by the +laws of California, excluding its principles of conflict of laws and the United +Nations Convention on Contracts for the Sale of Goods. You may not export the +Software in violation of applicable export laws and regulations. Intel is not +obligated under any other agreements unless they are in writing and signed by +an authorized representative +of Intel. + +GOVERNMENT RESTRICTED RIGHTS. The Software is provided with "RESTRICTED RIGHTS." +Use, duplication, or disclosure by the Government is subject to restrictions as +set forth in FAR52.227-14 and DFAR252.227-7013 et seq. or their successors. Use +of the Software by the Government constitutes acknowledgment of Intel's +proprietary rights therein. Contractor or Manufacturer is Intel Corporation, +2200 Mission College Blvd., Santa Clara, CA 95052. diff --git a/PCBSD/pc-sysinstall/conf/licenses/.svn/text-base/nvidia-en.txt.svn-base b/PCBSD/pc-sysinstall/conf/licenses/.svn/text-base/nvidia-en.txt.svn-base new file mode 100644 index 0000000..22c7906 --- /dev/null +++ b/PCBSD/pc-sysinstall/conf/licenses/.svn/text-base/nvidia-en.txt.svn-base @@ -0,0 +1,53 @@ +Section 3: NVIDIA driver license agreement +-------------------------------------------------------------------------------- +License For Customer Use of NVIDIA Software + +IMPORTANT NOTICE -- READ CAREFULLY: This License For Customer Use of NVIDIA Software ("LICENSE") is the agreement which governs use of the software of NVIDIA Corporation and its subsidiaries ("NVIDIA") downloadable herefrom, including computer software and associated printed materials ("SOFTWARE"). By downloading, installing, copying, or otherwise using the SOFTWARE, you agree to be bound by the terms of this LICENSE. If you do not agree to the terms of this LICENSE, do not download the SOFTWARE. + +RECITALS + +Use of NVIDIA's products requires three elements: the SOFTWARE, the hardware on a graphics controller board, and a personal computer. The SOFTWARE is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE is not sold, and instead is only licensed for use, strictly in accordance with this document. The hardware is protected by various patents, and is sold, but this LICENSE does not cover that sale, since it may not necessarily be sold as a package with the SOFTWARE. This LICENSE sets forth the terms and conditions of the SOFTWARE LICENSE only. + +1. DEFINITIONS + +1.1 Customer. Customer means the entity or individual that downloads the SOFTWARE. + +2. GRANT OF LICENSE + +2.1 Rights and Limitations of Grant. NVIDIA hereby grants Customer the following non-exclusive, non-transferable right to use the SOFTWARE, with the following limitations: + +2.1.1 Rights. Customer may install and use one copy of the SOFTWARE on a single computer, and except for making one back-up copy of the Software, may not otherwise copy the SOFTWARE. This LICENSE of SOFTWARE may not be shared or used concurrently on different computers. + +2.1.2 Linux/FreeBSD Exception. Notwithstanding the foregoing terms of Section 2.1.1, SOFTWARE designed exclusively for use on the Linux or FreeBSD operating systems, or other operating systems derived from the source code to these operating systems, may be copied and redistributed, provided that the binary files thereof are not modified in any way (except for unzipping of compressed files). + +2.1.3 Limitations. + +No Reverse Engineering. Customer may not reverse engineer, decompile, or disassemble the SOFTWARE, nor attempt in any other manner to obtain the source code. + +No Separation of Components. The SOFTWARE is licensed as a single product. Its component parts may not be separated for use on more than one computer, nor otherwise used separately from the other parts. + +No Rental. Customer may not rent or lease the SOFTWARE to someone else. + +3. TERMINATION + +This LICENSE will automatically terminate if Customer fails to comply with any of the terms and conditions hereof. In such event, Customer must destroy all copies of the SOFTWARE and all of its component parts. + +Defensive Suspension. If Customer commences or participates in any legal proceeding against NVIDIA, then NVIDIA may, in its sole discretion, suspend or terminate all license grants and any other rights provided under this LICENSE during the pendency of such legal proceedings. + +4. COPYRIGHT + +All title and copyrights in and to the SOFTWARE (including but not limited to all images, photographs, animations, video, audio, music, text, and other information incorporated into the SOFTWARE), the accompanying printed materials, and any copies of the SOFTWARE, are owned by NVIDIA, or its suppliers. The SOFTWARE is protected by copyright laws and international treaty provisions. Accordingly, Customer is required to treat the SOFTWARE like any other copyrighted material, except as otherwise allowed pursuant to this LICENSE and that it may make one copy of the SOFTWARE solely for backup or archive purposes. + +5. APPLICABLE LAW + +This LICENSE shall be deemed to have been made in, and shall be construed pursuant to, the laws of the State of California. The United Nations Convention on Contracts for the International Sale of Goods is specifically disclaimed. + +6. DISCLAIMER OF WARRANTIES AND LIMITATION ON LIABILITY + +6.1 No Warranties. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS IS" AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +6.2 No Liability for Consequential Damages. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE THE SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. MISCELLANEOUS + +If any provision of this LICENSE is inconsistent with, or cannot be fully enforced under, the law, such provision will be construed as limited to the extent necessary to be consistent with and fully enforceable under the law. This LICENSE is the final, complete and exclusive agreement between the parties relating to the subject matter hereof, and supersedes all prior or contemporaneous understandings and agreements relating to such subject matter, whether oral or written. This LICENSE may only be modified in writing signed by an authorized officer of NVIDIA. Customer agrees that it will not ship, transfer or export the SOFTWARE into any country, or use the SOFTWARE in any manner, prohibited by the United States Bureau of Export Administration or any export laws, restrictions or regulations. diff --git a/PCBSD/pc-sysinstall/conf/licenses/bsd-be.txt b/PCBSD/pc-sysinstall/conf/licenses/bsd-be.txt new file mode 100644 index 0000000..dfd8de4 --- /dev/null +++ b/PCBSD/pc-sysinstall/conf/licenses/bsd-be.txt @@ -0,0 +1,43 @@ +PC-BSD і яго зыходныя кампанэнты выпускаюцца пад ліцензіяй BSD. +Кампаненты базавай сістэмы выпускаюцца паводле іх ліцензіям. + + +-------------------------------------------------------------------------------- +Секцыя 1: Ліцэнзія BSD License +Секцыя 2: Ліцэнзія Intel Firmware +Секцыя 3: Ліцэнзійная дамова гуртовщика NVIDIA +-------------------------------------------------------------------------------- + + +Дазваляецца паўторная распаўсюджавнне і выкарыстанне як у выглядзе +зыходнага кода, так і у двайковай форме, з зменамі або без, пры +захаванні наступных умоў: + +* Пры паўторным распаўсюджавнні зыходнага коду павінна заставацца не +кранутым паведамленне аб аўтарскім праве дадзеннае вышей, гэты спіс +умоў і наступны адмова ад гарантый. +* Пры паўторным распаўсюджванні двайковага коду павінна заставацца не +кранутым вышэй дадзенная інфармацыя аб аўтарскім праве, гэты спіс умоў +і наступны адмова ад гарантый у дакументацыі і/або у іншых матэрыялах, +пастаўляных пры распаўсюджавнні. +* Ні назва PC-BSD Team, ні імёны яе супрацоўнікаў не могуць быць +выкарыстаны у якасці паддрымкі альбо дзеля распаўсюджвання прадуктаў, +заснаваных на гэтым праграмным забеспячэнні без папярэдняга пісьмовага +дазвола. + +ГЭТАЯ ПРАГРАМА ПРАДСТАЎЛЕНА БЯСПЛАТНА ЎЛАДАЛЬНІКАМІ АЎТАРСКІХ ПРАЎ +І/АБО ІНШЫМІ БАКАМІ "ЯК ЯНА ЁСЦЬ" БЕЗ ЯКАГА-БЫ НІБЫЛО ВІДУ ГАРАНТЫЙ, +ПРАДСТАЎЛЕНЫХ ВІДАВОЧНА АЛЬБО ЯК РАЗУМЕЮЦЦА, У ТЫМ ЛІКУ УКЛЮЧНА, АЛЕ +НЕ АБМЯЖОЎВАЮЧЫСЯ ІМІ, АДНОСНА ГАРАНТЫЙ КАМЕРЦЫЙНАЙ КАШТОЎНАСЦІ І +ПРЫДАТНАСЦІ ДЛЯ ПЭЎНАЙ МЭТЫ. +НІ Ў ЯКІМ РАЗЕ, КАЛІ ГЭТА НЕ ПАТРАБУЕ АДПАВЕДНЫ ЗАКОН, АЛЬБО НЕ +УСТАЛЯВАНА У ВУСНАЙ ФОРМЕ, НІ АДЗІН УЛАДАЛЬНІК АЎТАРСКІХ ПРАЎ І НІ +АДНА ІНШАЯ АСОБА, ЯКАЯ МОЖА ЗМЯНЯЦЬ І/АЛЬБО ПАЎТОРНА РАСПАЎСЮДЖВАЦЬ +ПРАГРАМУ, ЯК БЫЛО ПАДАДЗЕНА ВЫШЭЙ, НЕ НЯСЕ АДКАЗНАСЦІ, У ТЫМ ЛІКУ ЗА +ЛЮБЫЯ АГУЛЬНЫЯ, ВЫПАДКОВЫЯ, СПЕЦЫЯЛЬНЫЯ АЛЬБО БУДУЧЫЯ СТРАТЫ, У ВУНІКУ +ВЫКАРЫСТАННЯ ЦІ НЕ МАГЧЫМАСЦІ ВЫКАРЫСТАННЯ ПРАГРАМЫ (У ТЫМ ЛІКУ, АЛЕ +НЕ АБМЯЖОЎВАЮЧЫСЯ ЗГУБЛЕННЕМ ДАДЗЕННЫХ, АЛЬБО ДАДЗЕНЫМІ, ЯКІЯ СТАЛІ +НЯПРАВІЛЬНЫМІ АЛЬБО СТРАТАМІ ПРЫНЕСЕНЫМІ ПА ВАШАЙ АЛЬБО ТРЭЦІХ ЛІЦ +ВІНЕ, АЛЬБО АДМОВАЙ ПРАГРАМЫ ПРАЦАВАЦЬ СУМЕСНА С ІНШЫМІ ПРАГРАМАМІ), +НАВАТ КАЛІ ТАКІ УЛАДАЛЬНІК ЦІ ІНШАЯ АСОБА БЫЛІ ПАВЕДАМЛЕНЫ АБ +МАГЧЫМАСЦІ ТАКІХ СТРАТ. diff --git a/PCBSD/pc-sysinstall/conf/licenses/bsd-en.txt b/PCBSD/pc-sysinstall/conf/licenses/bsd-en.txt new file mode 100644 index 0000000..a30b67e --- /dev/null +++ b/PCBSD/pc-sysinstall/conf/licenses/bsd-en.txt @@ -0,0 +1,24 @@ +SECTION 1: BSD LICENSE +-------------------------------------------------------------------------------- +Copyright (c) 1998, Regents of the University of California +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 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. + Neither the name of the University of California, Berkeley nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPR +ESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO E +VENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCI +DENTAL, 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 AN 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. diff --git a/PCBSD/pc-sysinstall/conf/licenses/bsd-ru.txt b/PCBSD/pc-sysinstall/conf/licenses/bsd-ru.txt new file mode 100644 index 0000000..ad058f5 --- /dev/null +++ b/PCBSD/pc-sysinstall/conf/licenses/bsd-ru.txt @@ -0,0 +1,43 @@ +PC-BSD и его исходные тексты выпускаются под лицензией BSD. Компоненты базовой +системы выпускаются согласно их лицензиям. + +-------------------------------------------------------------------------------- +Секция 1: Лицензия BSD License +Секция 2: Лицензия Intel Firmware +Секция 3: Лицензионное соглашение гуртовщика NVIDIA +-------------------------------------------------------------------------------- + + + +СЕКЦИЯ 1: Лицензия BSD +-------------------------------------------------------------------------------- +Copyright (c) 1998, Regents of the University of California + +Разрешается повторное распространение и использование как в виде исходного кода, +так и в двоичной форме, с изменениями или без, при соблюдении следующих условий: + + * При повторном распространении исходного кода должно оставаться указанное + выше уведомление об авторском праве, этот список условий и последующий + отказ от гарантий. + * При повторном распространении двоичного кода должно сохраняться указанная + выше информация об авторском праве, этот список условий и последующий + отказ от гарантий в документации и/или в других материалах, поставляемых + при распространении. + * Ни название PC-BSD Team, ни имена ее сотрудников не могут быть + использованы в качестве поддержки или продвижения продуктов, основанных на + этом ПО без предварительного письменного разрешения. + +ЭТА ПРОГРАММА ПРЕДОСТАВЛЕНА БЕСПЛАТНО ВЛАДЕЛЬЦАМИ АВТОРСКИХ ПРАВ И/ИЛИ ДРУГИМИ СТОРОНАМИ +"КАК ОНА ЕСТЬ" БЕЗ КАКОГО-ЛИБО ВИДА ГАРАНТИЙ, ВЫРАЖЕННЫХ ЯВНО ИЛИ ПОДРАЗУМЕВАЕМЫХ, +ВКЛЮЧАЯ, НО НЕ ОГРАНИЧИВАЯСЬ ИМИ, ПОДРАЗУМЕВАЕМЫЕ ГАРАНТИИ КОММЕРЧЕСКОЙ ЦЕННОСТИ И +ПРИГОДНОСТИ ДЛЯ КОНКРЕТНОЙ ЦЕЛИ. НИ В КОЕМ СЛУЧАЕ, ЕСЛИ НЕ ТРЕБУЕТСЯ СООТВЕТСТВУЮЩИМ +ЗАКОНОМ, ИЛИ НЕ УСТАНОВЛЕНО В УСТНОЙ ФОРМЕ, НИ ОДИН ВЛАДЕЛЕЦ АВТОРСКИХ ПРАВ И НИ ОДНО +ДРУГОЕ ЛИЦО, КОТОРОЕ МОЖЕТ ИЗМЕНЯТЬ И/ИЛИ ПОВТОРНО РАСПРОСТРАНЯТЬ ПРОГРАММУ, КАК БЫЛО +СКАЗАНО ВЫШЕ, НЕ НЕСЁТ ОТВЕТСТВЕННОСТИ, ВКЛЮЧАЯ ЛЮБЫЕ ОБЩИЕ, СЛУЧАЙНЫЕ, +СПЕЦИАЛЬНЫЕ ИЛИ ПОСЛЕДОВАВШИЕ УБЫТКИ, В СЛЕДСТВИИ ИСПОЛЬЗОВАНИЯ ИЛИ НЕВОЗМОЖНОСТИ +ИСПОЛЬЗОВАНИЯ ПРОГРАММЫ (ВКЛЮЧАЯ, НО НЕ ОГРАНИЧИВАЯСЬ ПОТЕРЕЙ ДАННЫХ, ИЛИ ДАННЫМИ, +СТАВШИМИ НЕПРАВИЛЬНЫМИ, ИЛИ ПОТЕРЯМИ ПРИНЕСЕННЫМИ ИЗ-ЗА ВАС ИЛИ ТРЕТЬИХ ЛИЦ, ИЛИ ОТКАЗОМ +ПРОГРАММЫ РАБОТАТЬ СОВМЕСТНО С ДРУГИМИ ПРОГРАММАМИ), ДАЖЕ ЕСЛИ ТАКОЙ ВЛАДЕЛЕЦ ИЛИ +ДРУГОЕ ЛИЦО БЫЛИ ИЗВЕЩЕНЫ О ВОЗМОЖНОСТИ ТАКИХ УБЫТКОВ. + +Дальше пока переводить не буду, т.к. все равно до этого места никто читать не будет diff --git a/PCBSD/pc-sysinstall/conf/licenses/bsd-uk.txt b/PCBSD/pc-sysinstall/conf/licenses/bsd-uk.txt new file mode 100644 index 0000000..86fa577 --- /dev/null +++ b/PCBSD/pc-sysinstall/conf/licenses/bsd-uk.txt @@ -0,0 +1,42 @@ +PC-BSD та його початкові тексти випускаються під ліцензією BSD. Компоненти базової системи випускаються згідно з їх ліцензією. + +-------------------------------------------------------------------------------- +Секція 1: Ліцензія BSD License +Секція 2: Ліцензія Intel Firmware +Секція 3: Ліцензійна згода гуртовщика NVIDIA +-------------------------------------------------------------------------------- + + +СЕКЦІЯ 1: Ліцензія BSD +-------------------------------------------------------------------------------- +Copyright (c) 1998, Regents of the University of California + +Дозволяється повторне розповсюдження та використання як у вигляді початкового коду, +так і у подвійній формі, з змінами або без, дотриманні наступних умов: + + * При повторному розповсюдженні початкового коду повинно лишатися вказане + попередження про авторські права, цей список умовний наступна відмова від + гарантій. + * При повторному розповсюдженні подвійного коду повинна залишитися вище вказана + інформація про авторські права, цей список умовний і наступна відмова від гарантій в + документації та/або в інших матеріалах, наданих при розповсюдженні. + * Ні назва PC-BSD Team,ні імена ії співпрацівників не можуть бути + використані якості підтримки або провадження продуктів, заснованих на + цьому ПЗ без ......... письмового дозволу. + +ЦЯ ПРОГРАМА НАДАНА БЕЗКОШТОВНО ВЛАСНИКАМИ АВТОРСЬКИХ ПРАВ ЧИ/АБО ШНШИМИ СТОРОНАМИ +"ЯК ВОНА Є" БЕЗ ЯКОГО-НЕБУТЬ ВИДУ ГАРАНТІЙ, ВИРАЖЕНИХ ЯВНО АБО МАЮЧИХ НА УВАЗІ, +АЛЕ НЕ ОБМЕЖУЮЧИСЬ НИМИ,МАЮЩІ НА УВАЗІ ГАРАНТІІ КОМЕРЧЕСЬКОЇ ЦІННОСТІ ТА ПРИДАТНОСТІ +ДЛЯ КІНЦЕВОГО НАМІРУ. НІ В ЯКОМУ РАЗІ, ЯК ЩО НЕ ВИМАГАЮТЬСЯ ВІДПОВІДНИМ ЗАКОНОМ, АБО +НЕ ВКАЗАНО В УСНІЙ ФОРМІ,НЕ ОДИН ВЛАСНИК АВТОРСЬКИХ ПРАВ ТА НЕ ОДНО ІНШЕ ЛИЦЕ, ЯКЕ МОЖЕ +ЗМІНЮВАТИ ЧИ/АБО ПОВТОРНО РОЗПОВСЮДЖУВАТИ ПРОГРАМУ,ЯК БУЛО СКАЗАНО ВИЩЕ, НЕ НЕСЕ +ВІДПОВІДАЛЬНОСТІ,ВКЛЮЧНО БУДЬ ЯКІ СПІЛЬНІ, ВИПАДКОВІ, СПЕЦІАЛЬНІ АБО ЗБИТКИ, ЩО ПІШЛИ, У НАСЛІДКУ + +ВИКОРИСТАННЯ АБО НЕМОЖЛИВОСТІ +ВИКОРИСТАННЯ ПРОГРАМИ (ВКЛЮЧАЮЧИ, АЛЕ НЕ ОБМЕЖУЮЧИСЬ ВТРАТОЮ ДАНИХ, АБО ДАНИМИ, +ЩОСТАЛИ НЕПРАВИЛЬНИМИ, АБО ВТРАТАМИ ПРИНЕСЕНИМИ ЧЕРЕЗ ВАС АБО ТРЕТІХ ОСІБ, АБО ВІДМОВОЮ +ПРОГРАМИ ПРАЦЮВАТИ РАЗОМ З ІНШИМИ ПРОГРАМАМИ), НАВІТЬ ЯКЩО ТАКИЙ ВЛАСНИК АБО +ІНША ОСОБА БУЛИ СПОВІЩЕНА ПРО МОЖЛИВІСТЬ ТАКИХ ЗБИТКІВ. + +Далі поки переводити не буду, тому що однаково до цього місця ніхто читати не буде + diff --git a/PCBSD/pc-sysinstall/conf/licenses/intel-en.txt b/PCBSD/pc-sysinstall/conf/licenses/intel-en.txt new file mode 100644 index 0000000..0858ff7 --- /dev/null +++ b/PCBSD/pc-sysinstall/conf/licenses/intel-en.txt @@ -0,0 +1,207 @@ +Section 2: Intel Firmware license +-------------------------------------------------------------------------------- + TERMS AND CONDITIONS + IMPORTANT - PLEASE READ BEFORE INSTALLING OR USING THIS INTEL(C) SOFTWARE + +Do not use or load this firmware (the "Software") until you have carefully read +the following terms and conditions. By loading or using the Software, you agree +to the terms of this Agreement. If you do not wish to so agree, do not install +or use the Software. + +LICENSEES: + +Please note: + +* If you are an End-User, only Exhibit A, the SOFTWARE LICENSE AGREEMENT, + applies. +* If you are an Original Equipment Manufacturer (OEM), Independent Hardware + Vendor (IHV), or Independent Software Vendor (ISV), this complete Agreement + applies + +-------------------------------------------------------------------------------- + +For OEMs, IHVs, and ISVs: + +LICENSE. This Software is licensed for use only in conjunction with Intel +component products. Use of the Software in conjunction with non-Intel component +products is not licensed hereunder. Subject to the terms of this Agreement, +Intel grants to you a nonexclusive, nontransferable, worldwide, fully paid-up +license under Intel's copyrights to: (i) copy the Software internally for your +own development and maintenance purposes; (ii) copy and distribute the Software +to your end-users, but only under a license agreement with terms at least as +restrictive as those contained in Intel's Final, Single User License Agreement, +attached as Exhibit A; and (iii) modify, copy and distribute the end-user +documentation which may accompany the Software, but only in association with +the Software. + +If you are not the final manufacturer or vendor of a computer system or software +program incorporating the Software, then you may transfer a copy of the +Software, including any related documentation (modified or unmodified) to your +recipient for use in accordance with the terms of this Agreement, provided such +recipient agrees to be fully bound by the terms hereof. You shall not otherwise +assign, sublicense, lease, or in any other way transfer or disclose Software to +any third party. You may not, nor may you assist any other person or entity to +modify, translate, convert to another programming language, decompile, reverse +engineer, or disassemble any portion of the Software or otherwise attempt to +derive source code from any object code modules of the Software or any internal +data files generated by the Software. Your rights to redistribute the Software +shall be contingent upon your installation of this Agreement in its entirety in +the same directory as the Software. + +CONTRACTORS. For the purpose of this Agreement, and notwithstanding anything +to the contrary hereunder, solely with respect to the requirements for +compliance with the terms hereunder, any contractors or consultants that You +use to perform the work or otherwise assist You in the development or products +using this Software shall be deemed to be End Users and accordingly, upon +receipt of the Software, shall be bound by the terms of Exhibit A, Software +License Agreement. No additional agreement between You and such consultants or +contractors is required under this Agreement to detail such compliance. + +TRADEMARKS. Except as expressly provided herein, you shall not use Intel's +name in any publications, advertisements, or other announcements without +Intel's prior written consent. You do not have any rights to use any Intel +trademarks or logos. + +OWNERSHIP OF SOFTWARE AND COPYRIGHTS. Software and accompanying materials, if +any, are owned by Intel or its suppliers and licensors and may be protected by +copyright, trademark, patent and trade secret law and international treaties. +Any rights, express or implied, in the intellectual property embodied in the +foregoing, other than those specified in this Agreement, are reserved by Intel +and its suppliers and licensors or otherwise as set forth in any applicable +open source license agreement. You will keep the Software free of liens, +attachments, and other encumbrances. You agree not to remove any proprietary +notices and/or any labels from the Software and accompanying materials without +prior written approval by Intel + +LIMITATION OF LIABILITY. IN NO EVENT SHALL INTEL OR ITS SUPPLIERS AND LICENSORS +BE LIABLE FOR ANY DAMAGES WHATSOEVER FROM ANY CAUSE OF ACTION OF ANY KIND +(INCLUDING, WITHOUT LIMITATION, LOST PROFITS, BUSINESS INTERRUPTION, OR LOST +INFORMATION) ARISING OUT OF THE USE, MODIFICATION, OR INABILITY TO USE THE +INTEL SOFTWARE, OR OTHERWISE, NOR FOR PUNITIVE, INCIDENTAL, CONSEQUENTIAL, OR +SPECIAL DAMAGES OF ANY KIND, EVEN IF INTEL OR ITS SUPPLIERS AND LICENSORS HAS +BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME JURISDICTIONS PROHIBIT +EXCLUSION OR LIMITATION OF LIABILITY FOR IMPLIED WARRANTIES, CONSEQUENTIAL OR +INCIDENTAL DAMAGES, SO CERTAIN LIMITATIONS MAY NOT APPLY. YOU MAY ALSO HAVE +OTHER LEGAL RIGHTS THAT VARY BETWEEN JURISDICTIONS. + +EXCLUSION OF WARRANTIES. THE SOFTWARE IS PROVIDED "AS IS" AND POSSIBLY WITH +FAULTS. UNLESS EXPRESSLY AGREED OTHERWISE, INTEL AND ITS SUPPLIERS AND +LICENSORS DISCLAIM ANY AND ALL WARRANTIES AND GUARANTEES, EXPRESS, IMPLIED OR +OTHERWISE, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +NONINFRINGEMENT, OR FITNESS FOR A PARTICULAR PURPOSE. Intel does not warrant +or assume responsibility for the accuracy or completeness of any information, +text, graphics, links or other items contained within the Software. You assume +all liability, financial or otherwise, associated with Your use or disposition +of the Software. + +APPLICABLE LAW. Claims arising under this Agreement shall be governed by the +laws of State of California], excluding its principles of conflict of laws and +the United Nations Convention on Contracts for the Sale of Goods. + +WAIVER AND AMENDMENT. No modification, amendment or waiver of any provision of +this Agreement shall be effective unless in writing and signed by an officer of +Intel. No failure or delay in exercising any right, power, or remedy under +this Agreement shall operate as a waiver of any such right, power or remedy. +Without limiting the foregoing, terms and conditions on any purchase orders or +similar materials submitted by you to Intel, and any terms contained in Intels +standard acknowledgment form that are in conflict with these terms, shall be of +no force or effect. + +SEVERABILITY. If any provision of this Agreement is held by a court of +competent jurisdiction to be contrary to law, such provision shall be changed +and interpreted so as to best accomplish the objectives of the original +provision to the fullest extent allowed by law and the remaining provisions of +this Agreement shall remain in full force and effect. + +EXPORT RESTRICTIONS. Each party acknowledges that the Software is subject to +applicable import and export regulations of the United States and of the +countries in which each party transacts business, specifically including U.S. +Export Administration Act and Export Administration Regulations. Each party +shall comply with such laws and regulations, as well as all other laws and +regulations applicable to the Software. Without limiting the generality of the +foregoing, each party agrees that it will not export, re-export, transfer or +divert any of the Software or the direct programs thereof to any restricted +place or party in accordance with U.S. export regulations. Note that Software +containing encryption may be subject to additional restrictions. + +GOVERNMENT RESTRICTED RIGHTS. The Software is provided with "RESTRICTED RIGHTS." +Use, duplication, or disclosure by the Government is subject to restrictions as +set forth in FAR52.227-14 and DFAR252.227-7013 et seq. or their successors. Use +of the Software by the Government constitutes acknowledgment of Intel's +proprietary rights therein. Contractor or Manufacturer is Intel Corporation, +2200 Mission College Blvd., Santa Clara, CA 95052. + +TERMINATION OF THE AGREEMENT. Intel may terminate this Agreement if you violate +its terms. Upon termination, you will immediately destroy the Software or +return all copies of the Software to Intel. + +-------------------------------------------------------------------------------- + +EXHIBIT "A" + +SOFTWARE LICENSE AGREEMENT (Final, Single User) + +IMPORTANT - READ BEFORE COPYING, INSTALLING OR USING. + +Do not use or load this firmware image (the "Software") until you have carefully +read the following terms and conditions. By loading or using the Software, you +agree to the terms of this Agreement. If you do not wish to so agree, do not +install or use the Software. + +LICENSE. You may copy and use the Software, subject to these conditions: +1. This Software is licensed for use only in conjunction with Intel component + products. Use of the Software in conjunction with non-Intel component + products is not licensed hereunder. +2. You may not copy, modify, rent, sell, distribute or transfer any part of the + Software except as provided in this Agreement, and you agree to prevent + unauthorized copying of the Software. +3. You may not reverse engineer, decompile, or disassemble the Software. +4. You may not sublicense the Software. +5. The Software may contain the software or other property of third party + suppliers. + +OWNERSHIP OF SOFTWARE AND COPYRIGHTS. Title to all copies of the Software +remains with Intel or its suppliers. The Software is copyrighted and protected +by the laws of the United States and other countries, and international treaty +provisions. You may not remove any copyright notices from the Software. Intel +may make changes to the Software, or items referenced therein, at any time +without notice, but is not obligated to support or update the Software. Except +as otherwise expressly provided, Intel grants no express or implied right under +Intel patents, copyrights, trademarks, or other intellectual property rights. +You may transfer the Software only if a copy of this license accompanies the +Software and the recipient agrees to be fully bound by these terms. + +EXCLUSION OF OTHER WARRANTIES EXCEPT AS PROVIDED ABOVE, THE SOFTWARE IS PROVIDED +"AS IS" WITHOUT ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND INCLUDING +WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, OR FITNESS FOR A PARTICULAR +PURPOSE. Intel does not warrant or assume responsibility for the accuracy or +completeness of any information, text, graphics, links or other items contained +within the Software. + +LIMITATION OF LIABILITY. IN NO EVENT SHALL INTEL OR ITS SUPPLIERS BE LIABLE FOR +ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, LOST PROFITS, BUSINESS +INTERRUPTION, OR LOST INFORMATION) ARISING OUT OF THE USE OF OR INABILITY TO +USE THE SOFTWARE, EVEN IF INTEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. SOME JURISDICTIONS PROHIBIT EXCLUSION OR LIMITATION OF LIABILITY FOR +IMPLIED WARRANTIES OR CONSEQUENTIAL OR INCIDENTAL DAMAGES, SO THE ABOVE +LIMITATION MAY NOT APPLY TO YOU. YOU MAY ALSO HAVE OTHER LEGAL RIGHTS THAT VARY +BETWEEN JURISDICTIONS. + +TERMINATION OF THIS AGREEMENT. Intel may terminate this Agreement at any time if +you violate its terms. Upon termination, you will immediately destroy the +Software. + +APPLICABLE LAWS. Claims arising under this Agreement shall be governed by the +laws of California, excluding its principles of conflict of laws and the United +Nations Convention on Contracts for the Sale of Goods. You may not export the +Software in violation of applicable export laws and regulations. Intel is not +obligated under any other agreements unless they are in writing and signed by +an authorized representative +of Intel. + +GOVERNMENT RESTRICTED RIGHTS. The Software is provided with "RESTRICTED RIGHTS." +Use, duplication, or disclosure by the Government is subject to restrictions as +set forth in FAR52.227-14 and DFAR252.227-7013 et seq. or their successors. Use +of the Software by the Government constitutes acknowledgment of Intel's +proprietary rights therein. Contractor or Manufacturer is Intel Corporation, +2200 Mission College Blvd., Santa Clara, CA 95052. diff --git a/PCBSD/pc-sysinstall/conf/licenses/nvidia-en.txt b/PCBSD/pc-sysinstall/conf/licenses/nvidia-en.txt new file mode 100644 index 0000000..22c7906 --- /dev/null +++ b/PCBSD/pc-sysinstall/conf/licenses/nvidia-en.txt @@ -0,0 +1,53 @@ +Section 3: NVIDIA driver license agreement +-------------------------------------------------------------------------------- +License For Customer Use of NVIDIA Software + +IMPORTANT NOTICE -- READ CAREFULLY: This License For Customer Use of NVIDIA Software ("LICENSE") is the agreement which governs use of the software of NVIDIA Corporation and its subsidiaries ("NVIDIA") downloadable herefrom, including computer software and associated printed materials ("SOFTWARE"). By downloading, installing, copying, or otherwise using the SOFTWARE, you agree to be bound by the terms of this LICENSE. If you do not agree to the terms of this LICENSE, do not download the SOFTWARE. + +RECITALS + +Use of NVIDIA's products requires three elements: the SOFTWARE, the hardware on a graphics controller board, and a personal computer. The SOFTWARE is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE is not sold, and instead is only licensed for use, strictly in accordance with this document. The hardware is protected by various patents, and is sold, but this LICENSE does not cover that sale, since it may not necessarily be sold as a package with the SOFTWARE. This LICENSE sets forth the terms and conditions of the SOFTWARE LICENSE only. + +1. DEFINITIONS + +1.1 Customer. Customer means the entity or individual that downloads the SOFTWARE. + +2. GRANT OF LICENSE + +2.1 Rights and Limitations of Grant. NVIDIA hereby grants Customer the following non-exclusive, non-transferable right to use the SOFTWARE, with the following limitations: + +2.1.1 Rights. Customer may install and use one copy of the SOFTWARE on a single computer, and except for making one back-up copy of the Software, may not otherwise copy the SOFTWARE. This LICENSE of SOFTWARE may not be shared or used concurrently on different computers. + +2.1.2 Linux/FreeBSD Exception. Notwithstanding the foregoing terms of Section 2.1.1, SOFTWARE designed exclusively for use on the Linux or FreeBSD operating systems, or other operating systems derived from the source code to these operating systems, may be copied and redistributed, provided that the binary files thereof are not modified in any way (except for unzipping of compressed files). + +2.1.3 Limitations. + +No Reverse Engineering. Customer may not reverse engineer, decompile, or disassemble the SOFTWARE, nor attempt in any other manner to obtain the source code. + +No Separation of Components. The SOFTWARE is licensed as a single product. Its component parts may not be separated for use on more than one computer, nor otherwise used separately from the other parts. + +No Rental. Customer may not rent or lease the SOFTWARE to someone else. + +3. TERMINATION + +This LICENSE will automatically terminate if Customer fails to comply with any of the terms and conditions hereof. In such event, Customer must destroy all copies of the SOFTWARE and all of its component parts. + +Defensive Suspension. If Customer commences or participates in any legal proceeding against NVIDIA, then NVIDIA may, in its sole discretion, suspend or terminate all license grants and any other rights provided under this LICENSE during the pendency of such legal proceedings. + +4. COPYRIGHT + +All title and copyrights in and to the SOFTWARE (including but not limited to all images, photographs, animations, video, audio, music, text, and other information incorporated into the SOFTWARE), the accompanying printed materials, and any copies of the SOFTWARE, are owned by NVIDIA, or its suppliers. The SOFTWARE is protected by copyright laws and international treaty provisions. Accordingly, Customer is required to treat the SOFTWARE like any other copyrighted material, except as otherwise allowed pursuant to this LICENSE and that it may make one copy of the SOFTWARE solely for backup or archive purposes. + +5. APPLICABLE LAW + +This LICENSE shall be deemed to have been made in, and shall be construed pursuant to, the laws of the State of California. The United Nations Convention on Contracts for the International Sale of Goods is specifically disclaimed. + +6. DISCLAIMER OF WARRANTIES AND LIMITATION ON LIABILITY + +6.1 No Warranties. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS IS" AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +6.2 No Liability for Consequential Damages. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE THE SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. MISCELLANEOUS + +If any provision of this LICENSE is inconsistent with, or cannot be fully enforced under, the law, such provision will be construed as limited to the extent necessary to be consistent with and fully enforceable under the law. This LICENSE is the final, complete and exclusive agreement between the parties relating to the subject matter hereof, and supersedes all prior or contemporaneous understandings and agreements relating to such subject matter, whether oral or written. This LICENSE may only be modified in writing signed by an authorized officer of NVIDIA. Customer agrees that it will not ship, transfer or export the SOFTWARE into any country, or use the SOFTWARE in any manner, prohibited by the United States Bureau of Export Administration or any export laws, restrictions or regulations. diff --git a/PCBSD/pc-sysinstall/conf/pc-sysinstall.conf b/PCBSD/pc-sysinstall/conf/pc-sysinstall.conf new file mode 100755 index 0000000..2d4735e --- /dev/null +++ b/PCBSD/pc-sysinstall/conf/pc-sysinstall.conf @@ -0,0 +1,75 @@ +#!/bin/sh +# Configuration options for pc-sysinstall + +TMPDIR="/tmp/.pc-sysinstall" +export TMPDIR + +if [ ! -d "${TMPDIR}" ] +then + mkdir -p ${TMPDIR} + chmod 777 ${TMPDIR} +fi + +# Set our temp directory for storing partition information +PARTDIR="${TMPDIR}/part-info" +export PARTDIR + +# Set the SLICECFGDIR +SLICECFGDIR="${TMPDIR}/.slice-cfg" +export SLICECFGDIR + +# Set the MIRRORCFGDIR +MIRRORCFGDIR="${TMPDIR}/.mirror-cfg" +export MIRRORCFGDIR + +# Set the GELIKEYDIR +GELIKEYDIR="${TMPDIR}/.geli-keys" +export GELIKEYDIR + +# Set our log file +LOGOUT="${TMPDIR}/pc-sysinstall.log" +export LOGOUT + +# Set the number of rsync tries +RSYNCTRIES="3" +export RSYNCTRIES + +# Set our mount-points +CDMNT="/cdmnt-install" +FSMNT="/mnt" +UZIP_DIR="/usr" +BOOT_PART_MOUNT="/boot-mount" +export FSMNT CDMNT UZIP_DIR BOOT_PART_MOUNT + +# Set the location of component files on DVD / usb / ftp +# Relative to CDMNT or the FTP root +COMPFILEDIR="extras/" +export COMPFILEDIR + +# Set the component temp directory, which is relative to FSMNT +COMPTMPDIR="/usr/.componenttmp" +export COMPTMPDIR + +# Variables to set the location of installation data +UZIP_FILE="PCBSD.ufs.uzip" +TAR_FILE="PCBSD.tbz" +export UZIP_FILE TAR_FILE + +# Locations of FreeBSD only install files +FBSD_UZIP_FILE="fbsd-release.ufs.uzip" +FBSD_TAR_FILE="fbsd-release.tbz" +FBSD_BRANCH_DIR="8.0-CURRENT" +export FBSD_UZIP_FILE FBSD_TAR_FILE FBSD_BRANCH_DIR + +# Our internet mirror listing file location +NETSERVER="http://updates.pcbsd.org" +ARCH="`uname -m`" + +# Check if we are running on a PC-BSD Disk +if [ -e "/PCBSDVERSION" ] ; then + VERSION="`cat /PCBSDVERSION`" +else + VERSION="UNKNOWN" +fi + +MIRRORLIST="${NETSERVER}/mirrors-netinstall.php?ver=${VERSION}&arch=${ARCH}" diff --git a/PCBSD/pc-sysinstall/doc/.svn/entries b/PCBSD/pc-sysinstall/doc/.svn/entries new file mode 100644 index 0000000..f7c443f --- /dev/null +++ b/PCBSD/pc-sysinstall/doc/.svn/entries @@ -0,0 +1,164 @@ +10 + +dir +6759 +svn://svn.pcbsd.org/pcbsd/current/pc-sysinstall/doc +svn://svn.pcbsd.org + + + +2010-05-05T17:42:56.915402Z +6650 +kris + + + + + + + + + + + + + + +212fe199-4beb-da11-a70e-00e08102fd27 + +help-start-autoinstall +file + + + + +2010-05-23T00:20:49.000000Z +e24671adadd762fa8caeec38e68bc708 +2010-05-05T17:42:56.915402Z +6650 +kris + + + + + + + + + + + + + + + + + + + + + +1537 + +help-disk-size +file + + + + +2010-05-23T00:20:49.000000Z +4eed95089dfc499995728500c737e4a9 +2009-07-09T18:57:31.007874Z +4206 +kris + + + + + + + + + + + + + + + + + + + + + +7 + +help-disk-list +file + + + + +2010-05-23T00:20:49.000000Z +4eed95089dfc499995728500c737e4a9 +2009-07-09T18:57:31.007874Z +4206 +kris + + + + + + + + + + + + + + + + + + + + + +7 + +help-index +file + + + + +2010-05-23T00:20:49.000000Z +61d4aeddc1b8fecf2ad1d479ddc33cf3 +2010-05-05T16:14:11.819112Z +6649 +kris + + + + + + + + + + + + + + + + + + + + + +2366 + diff --git a/PCBSD/pc-sysinstall/doc/.svn/lock b/PCBSD/pc-sysinstall/doc/.svn/lock new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/PCBSD/pc-sysinstall/doc/.svn/lock diff --git a/PCBSD/pc-sysinstall/doc/.svn/text-base/help-disk-list.svn-base b/PCBSD/pc-sysinstall/doc/.svn/text-base/help-disk-list.svn-base new file mode 100644 index 0000000..0d4bff9 --- /dev/null +++ b/PCBSD/pc-sysinstall/doc/.svn/text-base/help-disk-list.svn-base @@ -0,0 +1 @@ +Holder diff --git a/PCBSD/pc-sysinstall/doc/.svn/text-base/help-disk-size.svn-base b/PCBSD/pc-sysinstall/doc/.svn/text-base/help-disk-size.svn-base new file mode 100644 index 0000000..0d4bff9 --- /dev/null +++ b/PCBSD/pc-sysinstall/doc/.svn/text-base/help-disk-size.svn-base @@ -0,0 +1 @@ +Holder diff --git a/PCBSD/pc-sysinstall/doc/.svn/text-base/help-index.svn-base b/PCBSD/pc-sysinstall/doc/.svn/text-base/help-index.svn-base new file mode 100644 index 0000000..248dcfa --- /dev/null +++ b/PCBSD/pc-sysinstall/doc/.svn/text-base/help-index.svn-base @@ -0,0 +1,83 @@ +pc-sysinstall Help Index +----------------------------------------------- +Help Commands + + help + Display this index file + + help <command> + Display the help data for the specified command + +System Query Commands + + disk-list + Provides a listing of the disk drives detected on this system + + disk-part <disk> + Queries the specified disk and returns information about its partitions + + disk-info <disk> + Returns information about the disks size, cyls, heads, and sectors + + detect-laptop + Tests to see if this system is a laptop or desktop + + detect-vmware + Tests to see if this system is actually a vmware session + + detect-nics + Returns a listing of the detected network cards on this system + + list-components + Returns a listing of the available components which can be installed + + list-rsync-backups <user> <host> <port> + Returns a listing of available rsync-backups on the target server in the life-preserver/ dir + + list-tzones + Returns a listing of available timezones + + query-langs + Return a list of languages that the installer supports + + sys-mem + Return the size of installed system RAM in MegaBytes + + test-netup + Test if an internet connection is available + + update-part-list + Return a list of PC-BSD & FreeBSD installs on this system for updates + + xkeyboard-layouts + Return a list of keyboard layouts that xorg supports + + xkeyboard-models + Return a list of keyboard models that xorg supports + + xkeyboard-variants + Return a list of keyboard variants that xorg supports + +Partition Management Commands + + create-part <disk> <size> + Create a new MBR primary slice on the target <disk> using <size> MB + + delete-part <partition> + Deletes 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. + + +Installation Commands + + -c <cfg> + Begin a install / upgrade with the specified cfg file + + start-autoinstall <conf> + Start an automated installation with the specified conf file + Normally only used by automated install scripts + + setup-ssh-keys <user> <host> <port> + Setup SSH without a password for the target host and user and port + Use to prompt the user to log into a server before doing a rsync + ssh restore diff --git a/PCBSD/pc-sysinstall/doc/.svn/text-base/help-start-autoinstall.svn-base b/PCBSD/pc-sysinstall/doc/.svn/text-base/help-start-autoinstall.svn-base new file mode 100644 index 0000000..1cb1e6a --- /dev/null +++ b/PCBSD/pc-sysinstall/doc/.svn/text-base/help-start-autoinstall.svn-base @@ -0,0 +1,39 @@ +start-autoinstall - HELP +----------------------------------------------- + +About: + start-autoinstall is used when performing automated installationsr. It is able + to configure networking with provided settings, and fetch an installation script from + http / ftp server. This allows media to be created which fetches dynamic configuration + options from a server-side supplier. + +Usage: + pc-sysinstall start-autoinstall <config> + +Config Syntax: + + The configuration file for start-autoinstall can contain the following options: + + pc_config: <value> + - Location of the pc-sysinstall installation configuration file, can be local + or start with http:// or ftp:// to fetch from a remote system. + + shutdown_cmd: <value> + - Command to execute post-installation, such as "shutdown -p now" or other. + + confirm_install: (YES/NO) + - Prompt on the console to begin installation. Defaults to YES. + Warning: Setting this to NO will start an installation as soon as start-autoinstall + is run. (I.E. after booting some install media) It may be dangerous if a disk is left + in a drive and the system is turned on! + + nic_config: (DHCP-ALL / <cfg>) + - When set to DHCP-ALL, the software will attempt to get a network address from DHCP on + any / all detected NICS. If set to some other command, it will be used as an argument + to "ifconfig" to enable networking. + + nic_dns: <value> + - Use the following DNS server for networking + + nic_gateway: <gateway> + - Use the following default route / gateway for networking diff --git a/PCBSD/pc-sysinstall/doc/help-disk-list b/PCBSD/pc-sysinstall/doc/help-disk-list new file mode 100644 index 0000000..0d4bff9 --- /dev/null +++ b/PCBSD/pc-sysinstall/doc/help-disk-list @@ -0,0 +1 @@ +Holder diff --git a/PCBSD/pc-sysinstall/doc/help-disk-size b/PCBSD/pc-sysinstall/doc/help-disk-size new file mode 100644 index 0000000..0d4bff9 --- /dev/null +++ b/PCBSD/pc-sysinstall/doc/help-disk-size @@ -0,0 +1 @@ +Holder diff --git a/PCBSD/pc-sysinstall/doc/help-index b/PCBSD/pc-sysinstall/doc/help-index new file mode 100644 index 0000000..248dcfa --- /dev/null +++ b/PCBSD/pc-sysinstall/doc/help-index @@ -0,0 +1,83 @@ +pc-sysinstall Help Index +----------------------------------------------- +Help Commands + + help + Display this index file + + help <command> + Display the help data for the specified command + +System Query Commands + + disk-list + Provides a listing of the disk drives detected on this system + + disk-part <disk> + Queries the specified disk and returns information about its partitions + + disk-info <disk> + Returns information about the disks size, cyls, heads, and sectors + + detect-laptop + Tests to see if this system is a laptop or desktop + + detect-vmware + Tests to see if this system is actually a vmware session + + detect-nics + Returns a listing of the detected network cards on this system + + list-components + Returns a listing of the available components which can be installed + + list-rsync-backups <user> <host> <port> + Returns a listing of available rsync-backups on the target server in the life-preserver/ dir + + list-tzones + Returns a listing of available timezones + + query-langs + Return a list of languages that the installer supports + + sys-mem + Return the size of installed system RAM in MegaBytes + + test-netup + Test if an internet connection is available + + update-part-list + Return a list of PC-BSD & FreeBSD installs on this system for updates + + xkeyboard-layouts + Return a list of keyboard layouts that xorg supports + + xkeyboard-models + Return a list of keyboard models that xorg supports + + xkeyboard-variants + Return a list of keyboard variants that xorg supports + +Partition Management Commands + + create-part <disk> <size> + Create a new MBR primary slice on the target <disk> using <size> MB + + delete-part <partition> + Deletes 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. + + +Installation Commands + + -c <cfg> + Begin a install / upgrade with the specified cfg file + + start-autoinstall <conf> + Start an automated installation with the specified conf file + Normally only used by automated install scripts + + setup-ssh-keys <user> <host> <port> + Setup SSH without a password for the target host and user and port + Use to prompt the user to log into a server before doing a rsync + ssh restore diff --git a/PCBSD/pc-sysinstall/doc/help-start-autoinstall b/PCBSD/pc-sysinstall/doc/help-start-autoinstall new file mode 100644 index 0000000..1cb1e6a --- /dev/null +++ b/PCBSD/pc-sysinstall/doc/help-start-autoinstall @@ -0,0 +1,39 @@ +start-autoinstall - HELP +----------------------------------------------- + +About: + start-autoinstall is used when performing automated installationsr. It is able + to configure networking with provided settings, and fetch an installation script from + http / ftp server. This allows media to be created which fetches dynamic configuration + options from a server-side supplier. + +Usage: + pc-sysinstall start-autoinstall <config> + +Config Syntax: + + The configuration file for start-autoinstall can contain the following options: + + pc_config: <value> + - Location of the pc-sysinstall installation configuration file, can be local + or start with http:// or ftp:// to fetch from a remote system. + + shutdown_cmd: <value> + - Command to execute post-installation, such as "shutdown -p now" or other. + + confirm_install: (YES/NO) + - Prompt on the console to begin installation. Defaults to YES. + Warning: Setting this to NO will start an installation as soon as start-autoinstall + is run. (I.E. after booting some install media) It may be dangerous if a disk is left + in a drive and the system is turned on! + + nic_config: (DHCP-ALL / <cfg>) + - When set to DHCP-ALL, the software will attempt to get a network address from DHCP on + any / all detected NICS. If set to some other command, it will be used as an argument + to "ifconfig" to enable networking. + + nic_dns: <value> + - Use the following DNS server for networking + + nic_gateway: <gateway> + - Use the following default route / gateway for networking diff --git a/PCBSD/pc-sysinstall/examples/.svn/entries b/PCBSD/pc-sysinstall/examples/.svn/entries new file mode 100644 index 0000000..d57c852 --- /dev/null +++ b/PCBSD/pc-sysinstall/examples/.svn/entries @@ -0,0 +1,368 @@ +10 + +dir +6759 +svn://svn.pcbsd.org/pcbsd/current/pc-sysinstall/examples +svn://svn.pcbsd.org + + + +2010-05-22T14:03:08.764463Z +6758 +kris + + + + + + + + + + + + + + +212fe199-4beb-da11-a70e-00e08102fd27 + +pcinstall.cfg.fbsd-netinstall +file + + + + +2010-05-23T00:20:49.000000Z +1c0d7a75deebccc75ebb501562c07b89 +2010-02-25T16:13:28.588161Z +6301 +kris + + + + + + + + + + + + + + + + + + + + + +1402 + +pc-autoinstall.conf +file + + + + +2010-05-23T00:20:49.000000Z +616fb1dd76ca185875fa9843b5847edd +2010-05-11T17:59:10.123893Z +6693 +kris + + + + + + + + + + + + + + + + + + + + + +1819 + +pcinstall.cfg.netinstall +file + + + + +2010-05-23T00:20:49.000000Z +dd2e3472911ca859f163604e6b36ebd1 +2010-02-25T16:13:28.588161Z +6301 +kris + + + + + + + + + + + + + + + + + + + + + +1312 + +pcinstall.cfg.rsync +file + + + + +2010-05-23T00:20:49.000000Z +5ce2cae9d0873c6dfedc4d39e06a8b10 +2010-02-25T16:13:28.588161Z +6301 +kris + + + + + + + + + + + + + + + + + + + + + +891 + +pcinstall.cfg.geli +file + + + + +2010-05-23T00:20:49.000000Z +e8984427f117327a98c20fb77d077849 +2010-03-26T19:14:52.876403Z +6450 +kris + + + + + + + + + + + + + + + + + + + + + +866 + +pcinstall.cfg.gmirror +file + + + + +2010-05-23T00:20:49.000000Z +8b17b6a5eeccf18ebb6cbc74d6cdfe2c +2010-02-25T16:13:28.588161Z +6301 +kris + + + + + + + + + + + + + + + + + + + + + +950 + +pcinstall.cfg.zfs +file + + + + +2010-05-23T00:20:49.000000Z +b91661c3fcf8f7f9ed6d46e7a083ac94 +2010-03-01T20:18:32.383093Z +6313 +kris + + + + + + + + + + + + + + + + + + + + + +1101 + +pcinstall.cfg.restore +file + + + + +2010-05-23T00:20:49.000000Z +479960aaa6e7e2a33e9f5c19f3538a92 +2010-02-25T16:13:28.588161Z +6301 +kris + + + + + + + + + + + + + + + + + + + + + +1193 + +README +file + + + + +2010-05-23T00:20:49.000000Z +5dc854085d82c448f842461a478c23b0 +2010-05-22T14:03:08.764463Z +6758 +kris + + + + + + + + + + + + + + + + + + + + + +11146 + +pcinstall.cfg.upgrade +file + + + + +2010-05-23T00:20:49.000000Z +0f4e0c8a5f7f3193bb42d472e27203e5 +2010-02-25T16:13:28.588161Z +6301 +kris + + + + + + + + + + + + + + + + + + + + + +514 + diff --git a/PCBSD/pc-sysinstall/examples/.svn/lock b/PCBSD/pc-sysinstall/examples/.svn/lock new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/PCBSD/pc-sysinstall/examples/.svn/lock diff --git a/PCBSD/pc-sysinstall/examples/.svn/text-base/README.svn-base b/PCBSD/pc-sysinstall/examples/.svn/text-base/README.svn-base new file mode 100644 index 0000000..6647238 --- /dev/null +++ b/PCBSD/pc-sysinstall/examples/.svn/text-base/README.svn-base @@ -0,0 +1,346 @@ +pc-sysinstall README + +This file documents many of the variables used in pc-sysinstall +config scripts +################################################################# + +# hostname= + +Using hostname= will set the specified hostname on the +installed system + +When hostname= is not present, pc-sysinstall will auto-generate +a hostname such as freebsd-XXXX or pcbsd-XXXX + +# installMode=(fresh or upgrade) + +Set the type of install we are doing, fresh or upgrade. + +Fresh installs will format and mount the target disks before +extracting the install images to the system. Using this mode +it is also possible to do a system restore, by specifying a +full system backup as the install source. + +Upgrades will mount the target disk, and extract the system +archive to the disk, overwriting files on the disk. +The conf/exclude-from-upgrade file can be used to specify +additional files to exclude from overwriting during the +install process. + +# installInteractive=(yes or no) + +Set if the installer is running in interactive mode, and +is able to prompt for input from the user, defaults to no + + +######################################################################## +# NETWORK SETTINGS +######################################################################## + +# netDev=(AUTO-DHCP or <nic>) + +netDev specifies what type of networking to enable for the installer +Can be set to AUTO-DHCP or to a network interface, such as et0 + +When set to AUTO-DHCP, pc-sysinstall will probe for all network devices +and attempt to set DHCP mode on each, until a working network connection +is established + +If netDev= is set to a network interface such as et0, the following options +will need to be set in order to enable the interface + +# netIP=(IP address such as 192.168.0.100) + + Set netIP to an address that you wish to have the interface specified in + netDev set to + Only used when netDev is not set to AUTO-DHCP + +# netMask=(Netmask such as 255.255.255.0) + +Set netMask to the address you with to have the interface specified in +netDev set to +Only used when netDev is not set to AUTO-DHCP + + +# netNameServer=(DNS Server such as 192.168.0.1) + +Set netNameServer to the DNS address you want to use during the install +Only used when netDev is not set to AUTO-DHCP + + +# netDefaultRouter=(192.168.0.1) + +Set netDefaultRouter to the gateway you wish to have the installer use +Only used when netDev is not set to AUTO-DHCP + + + +# netSaveDev=(AUTO-DHCP or network interface) + +netSaveDev specifies what networking to enable on the installed system + +When set to AUTO-DHCP, pc-sysinstall will probe all network interfaces, and +set them all to DHCP in the systems /etc/rc.conf file. Wireless devices will also +have the corresponding wlan[0-9] device created. + +When set to a network interface, pc-sysinstall will set the target device with +the settings specified by the variables below. + +# netSaveIP=192.168.0.49 +# netSaveMask=255.255.255.0 +# netSaveNameServer=208.67.222.222 +# netSaveDefaultRouter=192.168.0.1 + + + + +######################################################################## +# DISK SLICE SETTINGS +######################################################################## + +The following section specifies the target disk(s) to be used in the +install or upgrade. + +# disk0=(disk device, such as ad0) + +The diskX= variable should be set to the target device for this drive, such +as ad0, da0 +The first should begin with disk0=, and additional drives to disk1=, disk2 +if additional disks are to be setup. + + +# partition=(all, free, s1, s1, s3, s4) + +After setting disk[0-9], the partition= variable is used to specify which target +partition we will be working with for this device. + +Setting this to "all" will setup the disk with a single FreeBSD slice as "s1" + +Setting this to "free" will allow pc-sysinstall to search for the first available +primary slice with free space, and create the slice. + +Setting this to "s1, s2, s3 or s4" will use the specified slice + + +# mirror=(disk device such as ad1) + +Setting the mirror= variable will setup the target device as a gmirror +of the diskX= device. The mirror device must be the same size or larger +than the drive being mirrored. + + +# mirrorbal=(load, prefer, round-robin, split) + +Allows the setting of the mirror balance method to be used, if not +specified this defaults to "round-robin" + +# bootManager=(none, bsd) + +Setting this option will instruct pc-sysinstall to install the BSD boot Manager, +or leave it empty + +# commitDiskPart + +This command must be placed at the end of the diskX= section, before starting +the listing of any additional diskX= directives. + + +######################################################################## +# DISK PARTITION / MOUNT SETTINGS +######################################################################## + +The following settings specify the partitioning / mount points to setup +on the target partition + +# disk0-part=UFS+S 500 / +# disk0-part=SWAP 2000 none +# disk0-part=UFS.eli 500 /usr +# encpass=mypass +# disk0-part=UFS+J 500 /tmp +# disk0-part=ZFS 0 /data,/storage (mirror: ad1) +# commitDiskLabel + +The above values instructs pc-sysinstall which partitions / mounts +to create on the target drive / slice, specified by "disk0". +(disk0 will resolve to the drive / slice specified in the previous section) + +The notation is as follows: +<File System Type> <Size> <Mountpoint> + +Available FileSystems: + UFS - Standard UFS2 FileSystem +UFS+S - UFS2 + Softupdates enabled +UFS+J - UFS2 + Journaling through gjournal + ZFS - Z File System, pools / mounts created automatically + SWAP - BSD Swap space partition, mountpoint should be set to "none" + +Adding the ".eli" extension to any of the above file systems +will enable disk encryption via geli +(UFS.eli, UFS+S.eli, UFS+J.eli, ZFS.eli, SWAP.eli) + +If you with to use a passphrase with this encrypted partition, on the next line +the flag "encpass=" should be entered: +encpass=mypass + +All sizes are expressed in MegaBytes +Specifying a size 0 instructs pc-sysinstall to use the rest of the +available slice size, and should only be used for the last partition / mount + +When using "ZFS" specifically, it is possible to specify additional disks / partitions +to include in the zpool. By using the syntax: (mirror: ad1,ad2) or (raidz: ad1,ad2), it is possible +to include the disk "ad1" into the zpool for this partition, using the raidz / mirror methods. +If you with to just include the disk into the pool in "basic" mode, then use (ad1,ad2) with no flags + +######################################################################## +# INSTALL OPTIONS / SOURCES +######################################################################## + +The following settings specify the type, locations and sources +for this installation + +# installMedium=(dvd, usb, ftp, rsync) + +Set installMedium= to the source type we will be using for this install. + +Available Types: + dvd - Search for and mount the DVD which contains the install archive + usb - Search for and mount the USB drive which contains the install archive + ftp - The install archive will be fetched from a FTP / HTTP server before install +rsync - Pull the system data from a ssh + rsync server, specified with variables below + +# installType=(PCBSD, FreeBSD) + +Set the type of system we are installing, PCBSD or FreeBSD + +# installFile=fbsd-release.tbz + +The installer archive, if not using the defaults specified in conf/pc-sysinstall.conf + +# packageType=(tar, uzip, split) + +The archive type we are extracting from when using dvd, usb or ftp + +# ftpPath=ftp://ftp.pcbsd.org/pub/8.0/netinstall + +Location of the installer archive when using a installMedium=ftp + +# rsyncPath=life-preserver/back-2009-11-12T14_53_14 + +The location of the rsync data on the remote server when using installMedium=rsync + +# rsyncUser=rsyncuser + +The username to use for the ssh server running rsync + +# rsyncHost=192.168.0.50 + +The rsync / ssh server we wish to connect to + +# rsyncPort=22 + +The port to use when connecting to a ssh + rsync server + +# installComponents=amarok,firefox,ports + +The specified components to install, view available with "./pc-sysinstall list-components" + + +######################################################################## +# UPGRADE OPTIONS +######################################################################## + +Options specific to performing an upgrade + +# upgradeKeepDesktopProfile=(yes/no) + +This option allows you to specify if you wish to keep your existing users desktop +profile data. The default is NO, and your existing profile will be moved to +.kde4.preUpgrade automatically. + +######################################################################## +# USER OPTIONS +######################################################################## + +Options for setting up usernames and passwords on the installed system + +# rootPass=root + +Set the root password of the installed system to the specified string + +The below variables are used to setup a user on the installed system +Be sure to call commitUser after after adding these values, and before +starting another user block + +# userName=kris +# userComment=Kris Moore +# userPass=mypass +# userShell=/bin/csh +# userHome=/home/kris +# userGroups=wheel,operator +# commitUser + +######################################################################## +# RUN COMMANDS +######################################################################## + +The following variables can be set to run commands post-installation, +allowing the user to further tweak / modify the system + +# runCommand= + +Run the specified command within chroot of the installed system + +# runScript= + +runScript will copy the specified script into FSMNT, and run it in chroot of the system +Usefull when you have a 3rd party script on the DVD / USB, and you want to copy it into +the installed system and run + +# runExtCommand= + +runExtCommand is used when you wish to run a command outside the chroot +The variable $FSMNT is set to the mount-point of your installed system + + +######################################################################## +# PC-BSD SPECIFC OPTIONS +######################################################################## + +Options for time-zones and NTP on the installed system + +# timeZone= + +timeZone can be set to the zone file in /usr/share/zoneinfo/ that is to be used +example: America/New_York + +# enableNTP= (yes / no) + +set enableNTP to yes or no to enable or disable the NTP service on the system + + +######################################################################## +# PC-BSD SPECIFC OPTIONS +######################################################################## + +Options specific to installing PC-BSD, such as localization, and KDE settings + +# localizeLang=en + +localizeLang will set the system console and Desktop to the target language + +# localizeKeyLayout=en + +localizeKeyLayout updates the system's xorg config to set the keyboard layout + +# localizeKeyModel=pc104 + +localizeKeyModel updates the system's xorg config to set the keyboard model + +# localizeKeyVariant=intl + +localizeKeyVariant is used to update the xorg config to set the keyboard variant + +# autoLoginUser=kris + +Setting autoLoginUser will enable the specified user to log into the desktop +automatically without entering a password diff --git a/PCBSD/pc-sysinstall/examples/.svn/text-base/pc-autoinstall.conf.svn-base b/PCBSD/pc-sysinstall/examples/.svn/text-base/pc-autoinstall.conf.svn-base new file mode 100644 index 0000000..b6d1de1 --- /dev/null +++ b/PCBSD/pc-sysinstall/examples/.svn/text-base/pc-autoinstall.conf.svn-base @@ -0,0 +1,51 @@ +# 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 + +# 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 +confirm_install: yes + +# 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 -p 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: em0 192.168.0.101 255.255.255.0 + +# DNS server to use +# nic_dns: 192.168.0.1 + +# Default router / gateway +# nic_gateway: 192.168.0.1 diff --git a/PCBSD/pc-sysinstall/examples/.svn/text-base/pcinstall.cfg.fbsd-netinstall.svn-base b/PCBSD/pc-sysinstall/examples/.svn/text-base/pcinstall.cfg.fbsd-netinstall.svn-base new file mode 100644 index 0000000..687a741 --- /dev/null +++ b/PCBSD/pc-sysinstall/examples/.svn/text-base/pcinstall.cfg.fbsd-netinstall.svn-base @@ -0,0 +1,70 @@ +# Sample configuration file for an installation using pc-sysinstall + +installMode=fresh +installInteractive=yes +hostname=pcbsd8 + +# Set the disk parameters +disk0=ad0 +partition=all +bootManager=none +commitDiskPart + +# Setup the disk label +# All sizes are expressed in MB +# Avail FS Types, UFS, UFS+S, UFS+J, ZFS, SWAP +disk0-part=UFS 1000 / +disk0-part=SWAP 2000 none +disk0-part=UFS 0 /usr +# Size 0 means use the rest of the slice size +# Do it now! +commitDiskLabel + +netDev=AUTO-DHCP +#netDev=nfe0 +#netIP=192.168.0.49 +#netMask=255.255.255.0 +#netNameServer=208.67.222.222 +#netDefaultRouter=192.168.0.1 + +netSaveDev=AUTO-DHCP +#netSaveDev=nfe0 +#netSaveIP=192.168.0.49 +#netSaveMask=255.255.255.0 +#netSaveNameServer=208.67.222.222 +#netSaveDefaultRouter=192.168.0.1 + +# Set if we are installing via optical, USB, or FTP +#installType=PCBSD +installType=FreeBSD +#installMedium=dvd +installMedium=ftp + +ftpPath=ftp://192.168.0.2/netinstall + +#packageType=uzip +packageType=tar + +# List our components to install +installComponents=ports,src + +# Setup user "kris" to log into the desktop automatically +autoLoginUser=kris + +# Set the root pass +rootPass=root + +# Setup our users +userName=kris +userComment=Kris Moore +userPass=kris +userShell=/bin/csh +userHome=/home/kris +userGroups=wheel,operator +commitUser + +# Options for localizing an install +localizeLang="ru" +localizeKeyLayout="ru" +localizeKeyModel="pc104" +localizeKeyVariant="intl" diff --git a/PCBSD/pc-sysinstall/examples/.svn/text-base/pcinstall.cfg.geli.svn-base b/PCBSD/pc-sysinstall/examples/.svn/text-base/pcinstall.cfg.geli.svn-base new file mode 100644 index 0000000..04ee91b --- /dev/null +++ b/PCBSD/pc-sysinstall/examples/.svn/text-base/pcinstall.cfg.geli.svn-base @@ -0,0 +1,48 @@ +# Auto-Generated pc-sysinstall configuration +installInteractive=no +installMode=fresh +installType=FreeBSD +packageType=tar +installMedium=dvd +netSaveDev=AUTO-DHCP + +# Timezone +timeZone=America/New_York +enableNTP=yes + +# Keyboard Layout Options +localizeKeyModel=pc104 +localizeKeyLayout=us + +# Disk Setup for ad0 +disk0=ad0 +partition=ALL +bootManager=none +commitDiskPart + +# Partition Setup for ad0(ALL) +# All sizes are expressed in MB +# Avail FS Types, UFS, UFS+S, UFS+J, ZFS, SWAP +# UFS.eli, UFS+S.eli, UFS+J.eli, ZFS.eli, SWAP.eli +disk0-part=UFS 500 /boot +disk0-part=UFS.eli 500 / +disk0-part=UFS.eli 500 /usr +encpass=mypass +commitDiskLabel + +# Optional Components +installComponents= + +# Root Password +rootPass=mypass + +# Users +userName=kris +userComment=Kris Moore +userPass=mypass +userShell=/bin/csh +userHome=/home/kris +userGroups=wheel,operator +autoLoginUser=kris +commitUser + diff --git a/PCBSD/pc-sysinstall/examples/.svn/text-base/pcinstall.cfg.gmirror.svn-base b/PCBSD/pc-sysinstall/examples/.svn/text-base/pcinstall.cfg.gmirror.svn-base new file mode 100644 index 0000000..c796d94 --- /dev/null +++ b/PCBSD/pc-sysinstall/examples/.svn/text-base/pcinstall.cfg.gmirror.svn-base @@ -0,0 +1,44 @@ +# Sample configuration file for an installation using pc-sysinstall + +installMode=fresh +installInteractive=yes +hostname=pcbsd8 + +# Set the disk parameters +disk0=ad0 +mirror=ad1 +mirrorbal=split +partition=all +bootManager=bsd +commitDiskPart + +# Setup the disk label +# All sizes are expressed in MB +# Avail FS Types, UFS, UFS+S, UFS+J, ZFS, SWAP +disk0-part=UFS+S 500 / +disk0-part=SWAP 2000 none +disk0-part=UFS+S 0 /usr +# Size 0 means use the rest of the slice size +# Do it now! +commitDiskLabel + +# Set if we are installing via optical, USB, or FTP +installType=FreeBSD +installMedium=dvd + +#packageType=uzip +packageType=tar +#installComponents=ports,src + +# Run any commands post-install +runCommand=echo 'root' | pw usermod root -h 0 +#runScript=/root/test.sh +#runExtCommand=echo 'hey there'; touch $FSMNT/touched + +#autoLoginUser=kris + +# Options for localizing an install +localizeLang="ru" +localizeKeyLayout="ru" +localizeKeyModel="pc104" +localizeKeyVariant="intl" diff --git a/PCBSD/pc-sysinstall/examples/.svn/text-base/pcinstall.cfg.netinstall.svn-base b/PCBSD/pc-sysinstall/examples/.svn/text-base/pcinstall.cfg.netinstall.svn-base new file mode 100644 index 0000000..7c7841b --- /dev/null +++ b/PCBSD/pc-sysinstall/examples/.svn/text-base/pcinstall.cfg.netinstall.svn-base @@ -0,0 +1,67 @@ +# Sample configuration file for an installation using pc-sysinstall + +installMode=fresh +installInteractive=yes +hostname=pcbsd8 + +# Set the disk parameters +disk0=ad0 +partition=all +bootManager=none +commitDiskPart + +# Setup the disk label +# All sizes are expressed in MB +# Avail FS Types, UFS, UFS+S, UFS+J, ZFS, SWAP +disk0-part=UFS 1000 / +disk0-part=SWAP 2000 none +disk0-part=UFS 0 /usr +# Size 0 means use the rest of the slice size +# Do it now! +commitDiskLabel + +netDev=AUTO-DHCP +#netDev=nfe0 +#netIP=192.168.0.49 +#netMask=255.255.255.0 +#netNameServer=208.67.222.222 +#netDefaultRouter=192.168.0.1 + +netSaveDev=AUTO-DHCP +#netSaveDev=nfe0 +#netSaveIP=192.168.0.49 +#netSaveMask=255.255.255.0 +#netSaveNameServer=208.67.222.222 +#netSaveDefaultRouter=192.168.0.1 + +# Set if we are installing via optical, USB, or FTP +#installType=PCBSD +installType=FreeBSD +#installMedium=dvd +installMedium=ftp + +ftpPath=ftp://192.168.0.2/netinstall + +#packageType=uzip +packageType=tar +#installComponents=ports,src + +#autoLoginUser=kris + +# Set the root pass +rootPass=root + +# Setup our users +userName=kris +userComment=Kris Moore +userPass=kris +userShell=/bin/csh +userHome=/home/kris +userGroups=wheel,operator +commitUser + +# Options for localizing an install +localizeLang="ru" +localizeKeyLayout="ru" +localizeKeyModel="pc104" +localizeKeyVariant="intl" diff --git a/PCBSD/pc-sysinstall/examples/.svn/text-base/pcinstall.cfg.restore.svn-base b/PCBSD/pc-sysinstall/examples/.svn/text-base/pcinstall.cfg.restore.svn-base new file mode 100644 index 0000000..aad239a --- /dev/null +++ b/PCBSD/pc-sysinstall/examples/.svn/text-base/pcinstall.cfg.restore.svn-base @@ -0,0 +1,56 @@ +# Sample configuration file for an installation using pc-sysinstall + +installMode=fresh +installInteractive=no +hostname=freebsd8 + +# Set the disk parameters +disk0=ad1 +partition=all +bootManager=none +commitDiskPart + +# Setup the disk label +# All sizes are expressed in MB +# Avail FS Types, UFS, UFS+S, UFS+J, ZFS, SWAP +# UFS.eli, UFS+S.eli, UFS+J.eli, ZFS.eli, SWAP.eli +disk0-part=UFS+S 500 / +disk0-part=SWAP.eli 2000 none +disk0-part=UFS+S 0 /usr +# Size 0 means use the rest of the slice size +# Do it now! +commitDiskLabel + +# Set if we are installing via optical, USB, or FTP +installType=FreeBSD +installMedium=dvd +installFile=freebsd-release.tbz + +#packageType=uzip +packageType=tar +#installComponents=ports,src + +# Run any commands post-install +#runCommand=echo 'root' | pw usermod root -h 0 +#runScript=/root/test.sh +#runExtCommand=echo 'hey there'; touch $FSMNT/touched + +# Set the root pass +rootPass=root + +# Setup our users +userName=kris +userComment=Kris Moore +userPass=kris +userShell=/bin/csh +userHome=/home/kris +userGroups=wheel,operator +commitUser + +#autoLoginUser=kris + +# Options for localizing an install +localizeLang="ru" +localizeKeyLayout="ru" +localizeKeyModel="pc104" +localizeKeyVariant="intl" diff --git a/PCBSD/pc-sysinstall/examples/.svn/text-base/pcinstall.cfg.rsync.svn-base b/PCBSD/pc-sysinstall/examples/.svn/text-base/pcinstall.cfg.rsync.svn-base new file mode 100644 index 0000000..a22dc24 --- /dev/null +++ b/PCBSD/pc-sysinstall/examples/.svn/text-base/pcinstall.cfg.rsync.svn-base @@ -0,0 +1,44 @@ +# Sample configuration file for an installation using pc-sysinstall + +installMode=fresh +installInteractive=yes +hostname=pcbsd8 + +# Set the disk parameters +disk0=ad0 +partition=all +bootManager=none +commitDiskPart + +# Setup the disk label +# All sizes are expressed in MB +# Avail FS Types, UFS, UFS+S, UFS+J, ZFS, SWAP +disk0-part=UFS 2000 / +disk0-part=SWAP 2000 none +disk0-part=UFS 0 /usr +# Size 0 means use the rest of the slice size +# Do it now! +commitDiskLabel + +netDev=AUTO-DHCP +#netDev=nfe0 +#netIP=192.168.0.49 +#netMask=255.255.255.0 +#netNameServer=208.67.222.222 +#netDefaultRouter=192.168.0.1 + +# Set if we are installing via optical, USB, or FTP +#installType=PCBSD +installType=FreeBSD +#installMedium=dvd +installMedium=rsync + +rsyncPath=life-preserver/back-2009-11-12T14_53_14 +rsyncUser=lifep +rsyncHost=192.168.0.50 +rsyncPort=22 + +#packageType=uzip +packageType=tar +#installComponents=ports,src + diff --git a/PCBSD/pc-sysinstall/examples/.svn/text-base/pcinstall.cfg.upgrade.svn-base b/PCBSD/pc-sysinstall/examples/.svn/text-base/pcinstall.cfg.upgrade.svn-base new file mode 100644 index 0000000..7992d4c --- /dev/null +++ b/PCBSD/pc-sysinstall/examples/.svn/text-base/pcinstall.cfg.upgrade.svn-base @@ -0,0 +1,27 @@ +# Sample configuration file for an installation using pc-sysinstall + +installMode=upgrade +installInteractive=no +hostname=freebsd8 + +# Set the disk parameters +disk0=ad1 +partition=s1 +bootManager=none +commitDiskPart + +# Set if we are installing via optical, USB, or FTP +installType=PCBSD +installMedium=dvd + +#packageType=uzip +packageType=tar +#installComponents=ports,src + +#autoLoginUser=kris + +# Options for localizing an install +localizeLang="ru" +localizeKeyLayout="ru" +localizeKeyModel="pc104" +localizeKeyVariant="intl" diff --git a/PCBSD/pc-sysinstall/examples/.svn/text-base/pcinstall.cfg.zfs.svn-base b/PCBSD/pc-sysinstall/examples/.svn/text-base/pcinstall.cfg.zfs.svn-base new file mode 100644 index 0000000..14610c0 --- /dev/null +++ b/PCBSD/pc-sysinstall/examples/.svn/text-base/pcinstall.cfg.zfs.svn-base @@ -0,0 +1,58 @@ +# Auto-Generated pc-sysinstall configuration +installInteractive=no +installMode=fresh +installType=FreeBSD +packageType=tar +installMedium=dvd +netSaveDev=AUTO-DHCP + +# Timezone +timeZone=America/New_York +enableNTP=yes + +# Keyboard Layout Options +localizeKeyModel=pc104 +localizeKeyLayout=us + +# Disk Setup for ad0 +disk0=ad0 +partition=ALL +bootManager=none +commitDiskPart + +# Partition Setup for ad0(ALL) +# All sizes are expressed in MB +# Avail FS Types, UFS, UFS+S, UFS+J, ZFS, SWAP +# UFS.eli, UFS+S.eli, UFS+J.eli, ZFS.eli, SWAP.eli +disk0-part=ZFS 0 /,/usr,/var,/data (mirror: ad1) +commitDiskLabel + +# Disk Setup for ad3 +disk1=ad3 +partition=ALL +bootManager=none +commitDiskPart + +# Partition Setup for ad3(ALL) +# All sizes are expressed in MB +# Avail FS Types, UFS, UFS+S, UFS+J, ZFS, SWAP +# UFS.eli, UFS+S.eli, UFS+J.eli, ZFS.eli, SWAP.eli +disk1-part=SWAP 0 none +commitDiskLabel + +# Optional Components +installComponents= + +# Root Password +rootPass=mypass + +# Users +userName=kris +userComment=Kris Moore +userPass=mypass +userShell=/bin/csh +userHome=/home/kris +userGroups=wheel,operator +autoLoginUser=kris +commitUser + diff --git a/PCBSD/pc-sysinstall/examples/README b/PCBSD/pc-sysinstall/examples/README new file mode 100644 index 0000000..6647238 --- /dev/null +++ b/PCBSD/pc-sysinstall/examples/README @@ -0,0 +1,346 @@ +pc-sysinstall README + +This file documents many of the variables used in pc-sysinstall +config scripts +################################################################# + +# hostname= + +Using hostname= will set the specified hostname on the +installed system + +When hostname= is not present, pc-sysinstall will auto-generate +a hostname such as freebsd-XXXX or pcbsd-XXXX + +# installMode=(fresh or upgrade) + +Set the type of install we are doing, fresh or upgrade. + +Fresh installs will format and mount the target disks before +extracting the install images to the system. Using this mode +it is also possible to do a system restore, by specifying a +full system backup as the install source. + +Upgrades will mount the target disk, and extract the system +archive to the disk, overwriting files on the disk. +The conf/exclude-from-upgrade file can be used to specify +additional files to exclude from overwriting during the +install process. + +# installInteractive=(yes or no) + +Set if the installer is running in interactive mode, and +is able to prompt for input from the user, defaults to no + + +######################################################################## +# NETWORK SETTINGS +######################################################################## + +# netDev=(AUTO-DHCP or <nic>) + +netDev specifies what type of networking to enable for the installer +Can be set to AUTO-DHCP or to a network interface, such as et0 + +When set to AUTO-DHCP, pc-sysinstall will probe for all network devices +and attempt to set DHCP mode on each, until a working network connection +is established + +If netDev= is set to a network interface such as et0, the following options +will need to be set in order to enable the interface + +# netIP=(IP address such as 192.168.0.100) + + Set netIP to an address that you wish to have the interface specified in + netDev set to + Only used when netDev is not set to AUTO-DHCP + +# netMask=(Netmask such as 255.255.255.0) + +Set netMask to the address you with to have the interface specified in +netDev set to +Only used when netDev is not set to AUTO-DHCP + + +# netNameServer=(DNS Server such as 192.168.0.1) + +Set netNameServer to the DNS address you want to use during the install +Only used when netDev is not set to AUTO-DHCP + + +# netDefaultRouter=(192.168.0.1) + +Set netDefaultRouter to the gateway you wish to have the installer use +Only used when netDev is not set to AUTO-DHCP + + + +# netSaveDev=(AUTO-DHCP or network interface) + +netSaveDev specifies what networking to enable on the installed system + +When set to AUTO-DHCP, pc-sysinstall will probe all network interfaces, and +set them all to DHCP in the systems /etc/rc.conf file. Wireless devices will also +have the corresponding wlan[0-9] device created. + +When set to a network interface, pc-sysinstall will set the target device with +the settings specified by the variables below. + +# netSaveIP=192.168.0.49 +# netSaveMask=255.255.255.0 +# netSaveNameServer=208.67.222.222 +# netSaveDefaultRouter=192.168.0.1 + + + + +######################################################################## +# DISK SLICE SETTINGS +######################################################################## + +The following section specifies the target disk(s) to be used in the +install or upgrade. + +# disk0=(disk device, such as ad0) + +The diskX= variable should be set to the target device for this drive, such +as ad0, da0 +The first should begin with disk0=, and additional drives to disk1=, disk2 +if additional disks are to be setup. + + +# partition=(all, free, s1, s1, s3, s4) + +After setting disk[0-9], the partition= variable is used to specify which target +partition we will be working with for this device. + +Setting this to "all" will setup the disk with a single FreeBSD slice as "s1" + +Setting this to "free" will allow pc-sysinstall to search for the first available +primary slice with free space, and create the slice. + +Setting this to "s1, s2, s3 or s4" will use the specified slice + + +# mirror=(disk device such as ad1) + +Setting the mirror= variable will setup the target device as a gmirror +of the diskX= device. The mirror device must be the same size or larger +than the drive being mirrored. + + +# mirrorbal=(load, prefer, round-robin, split) + +Allows the setting of the mirror balance method to be used, if not +specified this defaults to "round-robin" + +# bootManager=(none, bsd) + +Setting this option will instruct pc-sysinstall to install the BSD boot Manager, +or leave it empty + +# commitDiskPart + +This command must be placed at the end of the diskX= section, before starting +the listing of any additional diskX= directives. + + +######################################################################## +# DISK PARTITION / MOUNT SETTINGS +######################################################################## + +The following settings specify the partitioning / mount points to setup +on the target partition + +# disk0-part=UFS+S 500 / +# disk0-part=SWAP 2000 none +# disk0-part=UFS.eli 500 /usr +# encpass=mypass +# disk0-part=UFS+J 500 /tmp +# disk0-part=ZFS 0 /data,/storage (mirror: ad1) +# commitDiskLabel + +The above values instructs pc-sysinstall which partitions / mounts +to create on the target drive / slice, specified by "disk0". +(disk0 will resolve to the drive / slice specified in the previous section) + +The notation is as follows: +<File System Type> <Size> <Mountpoint> + +Available FileSystems: + UFS - Standard UFS2 FileSystem +UFS+S - UFS2 + Softupdates enabled +UFS+J - UFS2 + Journaling through gjournal + ZFS - Z File System, pools / mounts created automatically + SWAP - BSD Swap space partition, mountpoint should be set to "none" + +Adding the ".eli" extension to any of the above file systems +will enable disk encryption via geli +(UFS.eli, UFS+S.eli, UFS+J.eli, ZFS.eli, SWAP.eli) + +If you with to use a passphrase with this encrypted partition, on the next line +the flag "encpass=" should be entered: +encpass=mypass + +All sizes are expressed in MegaBytes +Specifying a size 0 instructs pc-sysinstall to use the rest of the +available slice size, and should only be used for the last partition / mount + +When using "ZFS" specifically, it is possible to specify additional disks / partitions +to include in the zpool. By using the syntax: (mirror: ad1,ad2) or (raidz: ad1,ad2), it is possible +to include the disk "ad1" into the zpool for this partition, using the raidz / mirror methods. +If you with to just include the disk into the pool in "basic" mode, then use (ad1,ad2) with no flags + +######################################################################## +# INSTALL OPTIONS / SOURCES +######################################################################## + +The following settings specify the type, locations and sources +for this installation + +# installMedium=(dvd, usb, ftp, rsync) + +Set installMedium= to the source type we will be using for this install. + +Available Types: + dvd - Search for and mount the DVD which contains the install archive + usb - Search for and mount the USB drive which contains the install archive + ftp - The install archive will be fetched from a FTP / HTTP server before install +rsync - Pull the system data from a ssh + rsync server, specified with variables below + +# installType=(PCBSD, FreeBSD) + +Set the type of system we are installing, PCBSD or FreeBSD + +# installFile=fbsd-release.tbz + +The installer archive, if not using the defaults specified in conf/pc-sysinstall.conf + +# packageType=(tar, uzip, split) + +The archive type we are extracting from when using dvd, usb or ftp + +# ftpPath=ftp://ftp.pcbsd.org/pub/8.0/netinstall + +Location of the installer archive when using a installMedium=ftp + +# rsyncPath=life-preserver/back-2009-11-12T14_53_14 + +The location of the rsync data on the remote server when using installMedium=rsync + +# rsyncUser=rsyncuser + +The username to use for the ssh server running rsync + +# rsyncHost=192.168.0.50 + +The rsync / ssh server we wish to connect to + +# rsyncPort=22 + +The port to use when connecting to a ssh + rsync server + +# installComponents=amarok,firefox,ports + +The specified components to install, view available with "./pc-sysinstall list-components" + + +######################################################################## +# UPGRADE OPTIONS +######################################################################## + +Options specific to performing an upgrade + +# upgradeKeepDesktopProfile=(yes/no) + +This option allows you to specify if you wish to keep your existing users desktop +profile data. The default is NO, and your existing profile will be moved to +.kde4.preUpgrade automatically. + +######################################################################## +# USER OPTIONS +######################################################################## + +Options for setting up usernames and passwords on the installed system + +# rootPass=root + +Set the root password of the installed system to the specified string + +The below variables are used to setup a user on the installed system +Be sure to call commitUser after after adding these values, and before +starting another user block + +# userName=kris +# userComment=Kris Moore +# userPass=mypass +# userShell=/bin/csh +# userHome=/home/kris +# userGroups=wheel,operator +# commitUser + +######################################################################## +# RUN COMMANDS +######################################################################## + +The following variables can be set to run commands post-installation, +allowing the user to further tweak / modify the system + +# runCommand= + +Run the specified command within chroot of the installed system + +# runScript= + +runScript will copy the specified script into FSMNT, and run it in chroot of the system +Usefull when you have a 3rd party script on the DVD / USB, and you want to copy it into +the installed system and run + +# runExtCommand= + +runExtCommand is used when you wish to run a command outside the chroot +The variable $FSMNT is set to the mount-point of your installed system + + +######################################################################## +# PC-BSD SPECIFC OPTIONS +######################################################################## + +Options for time-zones and NTP on the installed system + +# timeZone= + +timeZone can be set to the zone file in /usr/share/zoneinfo/ that is to be used +example: America/New_York + +# enableNTP= (yes / no) + +set enableNTP to yes or no to enable or disable the NTP service on the system + + +######################################################################## +# PC-BSD SPECIFC OPTIONS +######################################################################## + +Options specific to installing PC-BSD, such as localization, and KDE settings + +# localizeLang=en + +localizeLang will set the system console and Desktop to the target language + +# localizeKeyLayout=en + +localizeKeyLayout updates the system's xorg config to set the keyboard layout + +# localizeKeyModel=pc104 + +localizeKeyModel updates the system's xorg config to set the keyboard model + +# localizeKeyVariant=intl + +localizeKeyVariant is used to update the xorg config to set the keyboard variant + +# autoLoginUser=kris + +Setting autoLoginUser will enable the specified user to log into the desktop +automatically without entering a password diff --git a/PCBSD/pc-sysinstall/examples/pc-autoinstall.conf b/PCBSD/pc-sysinstall/examples/pc-autoinstall.conf new file mode 100644 index 0000000..b6d1de1 --- /dev/null +++ b/PCBSD/pc-sysinstall/examples/pc-autoinstall.conf @@ -0,0 +1,51 @@ +# 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 + +# 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 +confirm_install: yes + +# 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 -p 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: em0 192.168.0.101 255.255.255.0 + +# DNS server to use +# nic_dns: 192.168.0.1 + +# Default router / gateway +# nic_gateway: 192.168.0.1 diff --git a/PCBSD/pc-sysinstall/examples/pcinstall.cfg.fbsd-netinstall b/PCBSD/pc-sysinstall/examples/pcinstall.cfg.fbsd-netinstall new file mode 100644 index 0000000..687a741 --- /dev/null +++ b/PCBSD/pc-sysinstall/examples/pcinstall.cfg.fbsd-netinstall @@ -0,0 +1,70 @@ +# Sample configuration file for an installation using pc-sysinstall + +installMode=fresh +installInteractive=yes +hostname=pcbsd8 + +# Set the disk parameters +disk0=ad0 +partition=all +bootManager=none +commitDiskPart + +# Setup the disk label +# All sizes are expressed in MB +# Avail FS Types, UFS, UFS+S, UFS+J, ZFS, SWAP +disk0-part=UFS 1000 / +disk0-part=SWAP 2000 none +disk0-part=UFS 0 /usr +# Size 0 means use the rest of the slice size +# Do it now! +commitDiskLabel + +netDev=AUTO-DHCP +#netDev=nfe0 +#netIP=192.168.0.49 +#netMask=255.255.255.0 +#netNameServer=208.67.222.222 +#netDefaultRouter=192.168.0.1 + +netSaveDev=AUTO-DHCP +#netSaveDev=nfe0 +#netSaveIP=192.168.0.49 +#netSaveMask=255.255.255.0 +#netSaveNameServer=208.67.222.222 +#netSaveDefaultRouter=192.168.0.1 + +# Set if we are installing via optical, USB, or FTP +#installType=PCBSD +installType=FreeBSD +#installMedium=dvd +installMedium=ftp + +ftpPath=ftp://192.168.0.2/netinstall + +#packageType=uzip +packageType=tar + +# List our components to install +installComponents=ports,src + +# Setup user "kris" to log into the desktop automatically +autoLoginUser=kris + +# Set the root pass +rootPass=root + +# Setup our users +userName=kris +userComment=Kris Moore +userPass=kris +userShell=/bin/csh +userHome=/home/kris +userGroups=wheel,operator +commitUser + +# Options for localizing an install +localizeLang="ru" +localizeKeyLayout="ru" +localizeKeyModel="pc104" +localizeKeyVariant="intl" diff --git a/PCBSD/pc-sysinstall/examples/pcinstall.cfg.geli b/PCBSD/pc-sysinstall/examples/pcinstall.cfg.geli new file mode 100644 index 0000000..04ee91b --- /dev/null +++ b/PCBSD/pc-sysinstall/examples/pcinstall.cfg.geli @@ -0,0 +1,48 @@ +# Auto-Generated pc-sysinstall configuration +installInteractive=no +installMode=fresh +installType=FreeBSD +packageType=tar +installMedium=dvd +netSaveDev=AUTO-DHCP + +# Timezone +timeZone=America/New_York +enableNTP=yes + +# Keyboard Layout Options +localizeKeyModel=pc104 +localizeKeyLayout=us + +# Disk Setup for ad0 +disk0=ad0 +partition=ALL +bootManager=none +commitDiskPart + +# Partition Setup for ad0(ALL) +# All sizes are expressed in MB +# Avail FS Types, UFS, UFS+S, UFS+J, ZFS, SWAP +# UFS.eli, UFS+S.eli, UFS+J.eli, ZFS.eli, SWAP.eli +disk0-part=UFS 500 /boot +disk0-part=UFS.eli 500 / +disk0-part=UFS.eli 500 /usr +encpass=mypass +commitDiskLabel + +# Optional Components +installComponents= + +# Root Password +rootPass=mypass + +# Users +userName=kris +userComment=Kris Moore +userPass=mypass +userShell=/bin/csh +userHome=/home/kris +userGroups=wheel,operator +autoLoginUser=kris +commitUser + diff --git a/PCBSD/pc-sysinstall/examples/pcinstall.cfg.gmirror b/PCBSD/pc-sysinstall/examples/pcinstall.cfg.gmirror new file mode 100644 index 0000000..c796d94 --- /dev/null +++ b/PCBSD/pc-sysinstall/examples/pcinstall.cfg.gmirror @@ -0,0 +1,44 @@ +# Sample configuration file for an installation using pc-sysinstall + +installMode=fresh +installInteractive=yes +hostname=pcbsd8 + +# Set the disk parameters +disk0=ad0 +mirror=ad1 +mirrorbal=split +partition=all +bootManager=bsd +commitDiskPart + +# Setup the disk label +# All sizes are expressed in MB +# Avail FS Types, UFS, UFS+S, UFS+J, ZFS, SWAP +disk0-part=UFS+S 500 / +disk0-part=SWAP 2000 none +disk0-part=UFS+S 0 /usr +# Size 0 means use the rest of the slice size +# Do it now! +commitDiskLabel + +# Set if we are installing via optical, USB, or FTP +installType=FreeBSD +installMedium=dvd + +#packageType=uzip +packageType=tar +#installComponents=ports,src + +# Run any commands post-install +runCommand=echo 'root' | pw usermod root -h 0 +#runScript=/root/test.sh +#runExtCommand=echo 'hey there'; touch $FSMNT/touched + +#autoLoginUser=kris + +# Options for localizing an install +localizeLang="ru" +localizeKeyLayout="ru" +localizeKeyModel="pc104" +localizeKeyVariant="intl" diff --git a/PCBSD/pc-sysinstall/examples/pcinstall.cfg.netinstall b/PCBSD/pc-sysinstall/examples/pcinstall.cfg.netinstall new file mode 100644 index 0000000..7c7841b --- /dev/null +++ b/PCBSD/pc-sysinstall/examples/pcinstall.cfg.netinstall @@ -0,0 +1,67 @@ +# Sample configuration file for an installation using pc-sysinstall + +installMode=fresh +installInteractive=yes +hostname=pcbsd8 + +# Set the disk parameters +disk0=ad0 +partition=all +bootManager=none +commitDiskPart + +# Setup the disk label +# All sizes are expressed in MB +# Avail FS Types, UFS, UFS+S, UFS+J, ZFS, SWAP +disk0-part=UFS 1000 / +disk0-part=SWAP 2000 none +disk0-part=UFS 0 /usr +# Size 0 means use the rest of the slice size +# Do it now! +commitDiskLabel + +netDev=AUTO-DHCP +#netDev=nfe0 +#netIP=192.168.0.49 +#netMask=255.255.255.0 +#netNameServer=208.67.222.222 +#netDefaultRouter=192.168.0.1 + +netSaveDev=AUTO-DHCP +#netSaveDev=nfe0 +#netSaveIP=192.168.0.49 +#netSaveMask=255.255.255.0 +#netSaveNameServer=208.67.222.222 +#netSaveDefaultRouter=192.168.0.1 + +# Set if we are installing via optical, USB, or FTP +#installType=PCBSD +installType=FreeBSD +#installMedium=dvd +installMedium=ftp + +ftpPath=ftp://192.168.0.2/netinstall + +#packageType=uzip +packageType=tar +#installComponents=ports,src + +#autoLoginUser=kris + +# Set the root pass +rootPass=root + +# Setup our users +userName=kris +userComment=Kris Moore +userPass=kris +userShell=/bin/csh +userHome=/home/kris +userGroups=wheel,operator +commitUser + +# Options for localizing an install +localizeLang="ru" +localizeKeyLayout="ru" +localizeKeyModel="pc104" +localizeKeyVariant="intl" diff --git a/PCBSD/pc-sysinstall/examples/pcinstall.cfg.restore b/PCBSD/pc-sysinstall/examples/pcinstall.cfg.restore new file mode 100644 index 0000000..aad239a --- /dev/null +++ b/PCBSD/pc-sysinstall/examples/pcinstall.cfg.restore @@ -0,0 +1,56 @@ +# Sample configuration file for an installation using pc-sysinstall + +installMode=fresh +installInteractive=no +hostname=freebsd8 + +# Set the disk parameters +disk0=ad1 +partition=all +bootManager=none +commitDiskPart + +# Setup the disk label +# All sizes are expressed in MB +# Avail FS Types, UFS, UFS+S, UFS+J, ZFS, SWAP +# UFS.eli, UFS+S.eli, UFS+J.eli, ZFS.eli, SWAP.eli +disk0-part=UFS+S 500 / +disk0-part=SWAP.eli 2000 none +disk0-part=UFS+S 0 /usr +# Size 0 means use the rest of the slice size +# Do it now! +commitDiskLabel + +# Set if we are installing via optical, USB, or FTP +installType=FreeBSD +installMedium=dvd +installFile=freebsd-release.tbz + +#packageType=uzip +packageType=tar +#installComponents=ports,src + +# Run any commands post-install +#runCommand=echo 'root' | pw usermod root -h 0 +#runScript=/root/test.sh +#runExtCommand=echo 'hey there'; touch $FSMNT/touched + +# Set the root pass +rootPass=root + +# Setup our users +userName=kris +userComment=Kris Moore +userPass=kris +userShell=/bin/csh +userHome=/home/kris +userGroups=wheel,operator +commitUser + +#autoLoginUser=kris + +# Options for localizing an install +localizeLang="ru" +localizeKeyLayout="ru" +localizeKeyModel="pc104" +localizeKeyVariant="intl" diff --git a/PCBSD/pc-sysinstall/examples/pcinstall.cfg.rsync b/PCBSD/pc-sysinstall/examples/pcinstall.cfg.rsync new file mode 100644 index 0000000..a22dc24 --- /dev/null +++ b/PCBSD/pc-sysinstall/examples/pcinstall.cfg.rsync @@ -0,0 +1,44 @@ +# Sample configuration file for an installation using pc-sysinstall + +installMode=fresh +installInteractive=yes +hostname=pcbsd8 + +# Set the disk parameters +disk0=ad0 +partition=all +bootManager=none +commitDiskPart + +# Setup the disk label +# All sizes are expressed in MB +# Avail FS Types, UFS, UFS+S, UFS+J, ZFS, SWAP +disk0-part=UFS 2000 / +disk0-part=SWAP 2000 none +disk0-part=UFS 0 /usr +# Size 0 means use the rest of the slice size +# Do it now! +commitDiskLabel + +netDev=AUTO-DHCP +#netDev=nfe0 +#netIP=192.168.0.49 +#netMask=255.255.255.0 +#netNameServer=208.67.222.222 +#netDefaultRouter=192.168.0.1 + +# Set if we are installing via optical, USB, or FTP +#installType=PCBSD +installType=FreeBSD +#installMedium=dvd +installMedium=rsync + +rsyncPath=life-preserver/back-2009-11-12T14_53_14 +rsyncUser=lifep +rsyncHost=192.168.0.50 +rsyncPort=22 + +#packageType=uzip +packageType=tar +#installComponents=ports,src + diff --git a/PCBSD/pc-sysinstall/examples/pcinstall.cfg.upgrade b/PCBSD/pc-sysinstall/examples/pcinstall.cfg.upgrade new file mode 100644 index 0000000..7992d4c --- /dev/null +++ b/PCBSD/pc-sysinstall/examples/pcinstall.cfg.upgrade @@ -0,0 +1,27 @@ +# Sample configuration file for an installation using pc-sysinstall + +installMode=upgrade +installInteractive=no +hostname=freebsd8 + +# Set the disk parameters +disk0=ad1 +partition=s1 +bootManager=none +commitDiskPart + +# Set if we are installing via optical, USB, or FTP +installType=PCBSD +installMedium=dvd + +#packageType=uzip +packageType=tar +#installComponents=ports,src + +#autoLoginUser=kris + +# Options for localizing an install +localizeLang="ru" +localizeKeyLayout="ru" +localizeKeyModel="pc104" +localizeKeyVariant="intl" diff --git a/PCBSD/pc-sysinstall/examples/pcinstall.cfg.zfs b/PCBSD/pc-sysinstall/examples/pcinstall.cfg.zfs new file mode 100644 index 0000000..14610c0 --- /dev/null +++ b/PCBSD/pc-sysinstall/examples/pcinstall.cfg.zfs @@ -0,0 +1,58 @@ +# Auto-Generated pc-sysinstall configuration +installInteractive=no +installMode=fresh +installType=FreeBSD +packageType=tar +installMedium=dvd +netSaveDev=AUTO-DHCP + +# Timezone +timeZone=America/New_York +enableNTP=yes + +# Keyboard Layout Options +localizeKeyModel=pc104 +localizeKeyLayout=us + +# Disk Setup for ad0 +disk0=ad0 +partition=ALL +bootManager=none +commitDiskPart + +# Partition Setup for ad0(ALL) +# All sizes are expressed in MB +# Avail FS Types, UFS, UFS+S, UFS+J, ZFS, SWAP +# UFS.eli, UFS+S.eli, UFS+J.eli, ZFS.eli, SWAP.eli +disk0-part=ZFS 0 /,/usr,/var,/data (mirror: ad1) +commitDiskLabel + +# Disk Setup for ad3 +disk1=ad3 +partition=ALL +bootManager=none +commitDiskPart + +# Partition Setup for ad3(ALL) +# All sizes are expressed in MB +# Avail FS Types, UFS, UFS+S, UFS+J, ZFS, SWAP +# UFS.eli, UFS+S.eli, UFS+J.eli, ZFS.eli, SWAP.eli +disk1-part=SWAP 0 none +commitDiskLabel + +# Optional Components +installComponents= + +# Root Password +rootPass=mypass + +# Users +userName=kris +userComment=Kris Moore +userPass=mypass +userShell=/bin/csh +userHome=/home/kris +userGroups=wheel,operator +autoLoginUser=kris +commitUser + diff --git a/PCBSD/pc-sysinstall/pc-sysinstall b/PCBSD/pc-sysinstall/pc-sysinstall new file mode 100755 index 0000000..dc5a594 --- /dev/null +++ b/PCBSD/pc-sysinstall/pc-sysinstall @@ -0,0 +1,202 @@ +#!/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 Kris Moore +# 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. +##################################################################### + +# User-editable configuration variables + +# Set this to the program location +PROGDIR="/PCBSD/pc-sysinstall" +export PROGDIR + +# Set this to the components location +COMPDIR="${PROGDIR}/components" +export COMPDIR + +# 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 vmware + detect-vmware) ${QUERYDIR}/detect-vmware.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 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 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 0 |