Date: Thu, 24 Jun 2010 22:21:47 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r209513 - in head: etc/mtree usr.sbin usr.sbin/pc-sysinstall usr.sbin/pc-sysinstall/backend usr.sbin/pc-sysinstall/backend-partmanager usr.sbin/pc-sysinstall/backend-query usr.sbin/pc-s... Message-ID: <201006242221.o5OMLljr017477@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: imp Date: Thu Jun 24 22:21:47 2010 New Revision: 209513 URL: http://svn.freebsd.org/changeset/base/209513 Log: Bring in Kris Moore's pc-sysinstall shell script from PC-BSD. This shell script is the back end logic necessary for an installer. It contains both query routines to allow a front-end installer to present reasonable choices to the user and also action routines which allow the front end installer to put a FreeBSD distribution onto a disk. It supports installing onto the usual suspects, as well as advanced features like Mirroring, ZFS, Encryprion and GPT labels. While this is only the back-end of the installer, it can do unattended scripted installations. In PC-BSD's world view, all installations are scripted and all the front-end does is write the script. As such, it is useful in its own right. This has been extensively tested over the past several releases of PC-BSD. However, differences between that environment and FreeBSD suggest there will be a period of shake-out while those differences are discovered and corrected. A text-based front-end is in the works. For the GUI-based front-end, you can use the PC-BSD distribution. Kris' BSDcan paper on pc-sysinstall is linked off his talk on the BSDcan site: http://www.bsdcan.org/2010/schedule/events/173.en.html The man page is written by Josh Paetzel, and I wrote the Makefiles for the FreeBSD integration. Kris wrote the rest. This represents version r7010 in the PC-BSD repo. http://svn.pcbsd.org/pcbsd/current/pc-sysinstall Submitted by: kris@ Sponsored by: iX Systems Added: head/usr.sbin/pc-sysinstall/ head/usr.sbin/pc-sysinstall/Makefile (contents, props changed) head/usr.sbin/pc-sysinstall/backend/ head/usr.sbin/pc-sysinstall/backend-partmanager/ head/usr.sbin/pc-sysinstall/backend-partmanager/Makefile (contents, props changed) head/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-partmanager/delete-part.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/ head/usr.sbin/pc-sysinstall/backend-query/Makefile (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/detect-laptop.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/detect-nics.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/detect-vmware.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/disk-info.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/disk-list.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/disk-part.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/enable-net.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/list-components.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/list-rsync-backups.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/list-tzones.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/query-langs.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/send-logs.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/setup-ssh-keys.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/test-live.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/test-netup.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/update-part-list.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-models.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-variants.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/Makefile (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-cleanup.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-disk.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-installcomponents.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-localize.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-mountoptical.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-networking.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-newfs.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-parse.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-runcommands.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-unmount.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-upgrade.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-users.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/parseconfig.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/startautoinstall.sh (contents, props changed) head/usr.sbin/pc-sysinstall/conf/ head/usr.sbin/pc-sysinstall/conf/Makefile (contents, props changed) head/usr.sbin/pc-sysinstall/conf/avail-langs (contents, props changed) head/usr.sbin/pc-sysinstall/conf/exclude-from-upgrade (contents, props changed) head/usr.sbin/pc-sysinstall/conf/licenses/ head/usr.sbin/pc-sysinstall/conf/licenses/bsd-en.txt (contents, props changed) head/usr.sbin/pc-sysinstall/conf/licenses/intel-en.txt (contents, props changed) head/usr.sbin/pc-sysinstall/conf/licenses/nvidia-en.txt (contents, props changed) head/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf (contents, props changed) head/usr.sbin/pc-sysinstall/doc/ head/usr.sbin/pc-sysinstall/doc/Makefile (contents, props changed) head/usr.sbin/pc-sysinstall/doc/help-disk-list (contents, props changed) head/usr.sbin/pc-sysinstall/doc/help-disk-size (contents, props changed) head/usr.sbin/pc-sysinstall/doc/help-index (contents, props changed) head/usr.sbin/pc-sysinstall/doc/help-start-autoinstall (contents, props changed) head/usr.sbin/pc-sysinstall/examples/ head/usr.sbin/pc-sysinstall/examples/Makefile (contents, props changed) head/usr.sbin/pc-sysinstall/examples/README (contents, props changed) head/usr.sbin/pc-sysinstall/examples/pc-autoinstall.conf (contents, props changed) head/usr.sbin/pc-sysinstall/examples/pcinstall.cfg.fbsd-netinstall (contents, props changed) head/usr.sbin/pc-sysinstall/examples/pcinstall.cfg.geli (contents, props changed) head/usr.sbin/pc-sysinstall/examples/pcinstall.cfg.gmirror (contents, props changed) head/usr.sbin/pc-sysinstall/examples/pcinstall.cfg.netinstall (contents, props changed) head/usr.sbin/pc-sysinstall/examples/pcinstall.cfg.restore (contents, props changed) head/usr.sbin/pc-sysinstall/examples/pcinstall.cfg.rsync (contents, props changed) head/usr.sbin/pc-sysinstall/examples/pcinstall.cfg.upgrade (contents, props changed) head/usr.sbin/pc-sysinstall/examples/pcinstall.cfg.zfs (contents, props changed) head/usr.sbin/pc-sysinstall/pc-sysinstall/ head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8 (contents, props changed) head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh (contents, props changed) Modified: head/etc/mtree/BSD.usr.dist head/usr.sbin/Makefile Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Thu Jun 24 21:17:58 2010 (r209512) +++ head/etc/mtree/BSD.usr.dist Thu Jun 24 22:21:47 2010 (r209513) @@ -261,6 +261,8 @@ .. nwclient .. + pc-sysinstall + .. perfmon .. pf @@ -1226,6 +1228,20 @@ .. .. .. + pc-sysinstall + backend + .. + backend-partmanager + .. + backend-query + .. + conf + license + .. + .. + doc + .. + .. security .. sendmail Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Thu Jun 24 21:17:58 2010 (r209512) +++ head/usr.sbin/Makefile Thu Jun 24 22:21:47 2010 (r209513) @@ -125,6 +125,7 @@ SUBDIR= ${_ac} \ ${_ntp} \ ${_nvram} \ ${_ofwdump} \ + pc-sysinstall \ pciconf \ periodic \ ${_pkg_install} \ Added: head/usr.sbin/pc-sysinstall/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/Makefile Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,5 @@ +# $FreeBSD$ +SUBDIR=backend backend-partmanager backend-query conf doc examples +SUBDIR+=pc-sysinstall + +.include <bsd.subdir.mk> Added: head/usr.sbin/pc-sysinstall/backend-partmanager/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-partmanager/Makefile Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +FILES= create-part.sh delete-part.sh + +FILESDIR=${SHAREDIR}/pc-sysinstall/backend-partmanager +NO_OBJ= + +.include <bsd.prog.mk> Added: head/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,92 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +# 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 "$?" Added: head/usr.sbin/pc-sysinstall/backend-partmanager/delete-part.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-partmanager/delete-part.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,89 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +# 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 "$?" Added: head/usr.sbin/pc-sysinstall/backend-query/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/Makefile Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +FILES= detect-laptop.sh detect-nics.sh detect-vmware.sh disk-info.sh \ + disk-list.sh disk-part.sh enable-net.sh list-components.sh \ + list-rsync-backups.sh list-tzones.sh query-langs.sh send-logs.sh \ + setup-ssh-keys.sh sys-mem.sh test-live.sh test-netup.sh \ + update-part-list.sh xkeyboard-layouts.sh xkeyboard-models.sh \ + xkeyboard-variants.sh + +FILESDIR=${SHAREDIR}/pc-sysinstall/backend-query +NO_OBJ= + +.include <bsd.prog.mk> Added: head/usr.sbin/pc-sysinstall/backend-query/detect-laptop.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/detect-laptop.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,33 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +dmesgLine=`dmesg | grep "acpi_acad0"` +if test "${dmesgLine}" = ""; then + echo "laptop: NO" +else + echo "laptop: YES" +fi Added: head/usr.sbin/pc-sysinstall/backend-query/detect-nics.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/detect-nics.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,41 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +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 Added: head/usr.sbin/pc-sysinstall/backend-query/detect-vmware.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/detect-vmware.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,36 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +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 Added: head/usr.sbin/pc-sysinstall/backend-query/disk-info.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/disk-info.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,68 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +# 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" Added: head/usr.sbin/pc-sysinstall/backend-query/disk-list.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/disk-list.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,60 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +# 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 Added: head/usr.sbin/pc-sysinstall/backend-query/disk-part.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/disk-part.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,119 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +# 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" Added: head/usr.sbin/pc-sysinstall/backend-query/enable-net.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/enable-net.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,65 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +# 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 Added: head/usr.sbin/pc-sysinstall/backend-query/list-components.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/list-components.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,54 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +# 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 + Added: head/usr.sbin/pc-sysinstall/backend-query/list-rsync-backups.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/list-rsync-backups.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,70 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +# 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 Added: head/usr.sbin/pc-sysinstall/backend-query/list-tzones.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/list-tzones.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,43 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +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 -f ${TMPDIR}/.tzonetmp >/dev/null 2>/dev/null + +exit 0 Added: head/usr.sbin/pc-sysinstall/backend-query/query-langs.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/query-langs.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,32 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +FOUND="0" + +cat ${PROGDIR}/conf/avail-langs + +exit 0 Added: head/usr.sbin/pc-sysinstall/backend-query/send-logs.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/send-logs.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,83 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +# 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 *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006242221.o5OMLljr017477>