diff options
Diffstat (limited to 'usr.sbin/bsdconfig/examples')
| -rw-r--r-- | usr.sbin/bsdconfig/examples/Makefile | 4 | ||||
| -rw-r--r-- | usr.sbin/bsdconfig/examples/Makefile.depend | 10 | ||||
| -rwxr-xr-x | usr.sbin/bsdconfig/examples/add_some_packages.sh | 12 | ||||
| -rwxr-xr-x | usr.sbin/bsdconfig/examples/browse_packages_http.sh | 31 | ||||
| -rw-r--r-- | usr.sbin/bsdconfig/examples/bsdconfigrc | 41 |
5 files changed, 98 insertions, 0 deletions
diff --git a/usr.sbin/bsdconfig/examples/Makefile b/usr.sbin/bsdconfig/examples/Makefile new file mode 100644 index 000000000000..3f7d638e2fa5 --- /dev/null +++ b/usr.sbin/bsdconfig/examples/Makefile @@ -0,0 +1,4 @@ +FILESDIR= ${SHAREDIR}/examples/bsdconfig +FILES= add_some_packages.sh browse_packages_http.sh bsdconfigrc + +.include <bsd.prog.mk> diff --git a/usr.sbin/bsdconfig/examples/Makefile.depend b/usr.sbin/bsdconfig/examples/Makefile.depend new file mode 100644 index 000000000000..11aba52f82cf --- /dev/null +++ b/usr.sbin/bsdconfig/examples/Makefile.depend @@ -0,0 +1,10 @@ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + + +.include <dirdeps.mk> + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif diff --git a/usr.sbin/bsdconfig/examples/add_some_packages.sh b/usr.sbin/bsdconfig/examples/add_some_packages.sh new file mode 100755 index 000000000000..b9bb8418610b --- /dev/null +++ b/usr.sbin/bsdconfig/examples/add_some_packages.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# +# This sample installs a short list of packages from the main HTTP site. +# +[ "$_SCRIPT_SUBR" ] || . /usr/share/bsdconfig/script.subr || exit 1 +nonInteractive=1 +_httpPath=http://pkg.freebsd.org +mediaSetHTTP +mediaOpen +for package in wget bash rsync; do + packageAdd +done diff --git a/usr.sbin/bsdconfig/examples/browse_packages_http.sh b/usr.sbin/bsdconfig/examples/browse_packages_http.sh new file mode 100755 index 000000000000..258e63d25c6a --- /dev/null +++ b/usr.sbin/bsdconfig/examples/browse_packages_http.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# +# This sample downloads the package digests.txz and packagesite.txz files from +# HTTP to /tmp (if they don't already exist) and then displays the package +# configuration/management screen using the local files (resulting in faster +# browsing of packages from-start since digests.txz/packagesite.txz can be +# loaded from local media). +# +# NOTE: Packages cannot be installed unless staged to +# /tmp/packages/$PKG_ABI/All +# +[ "$_SCRIPT_SUBR" ] || . /usr/share/bsdconfig/script.subr || exit 1 +nonInteractive=1 +f_musthavepkg_init # Make sure we have a usable pkg(8) with $PKG_ABI +TMPDIR=/tmp +PKGDIR=$TMPDIR/packages/$PKG_ABI +[ -d "$PKGDIR" ] || mkdir -p "$PKGDIR" || exit 1 +for file in digests.txz packagesite.txz; do + [ -s "$PKGDIR/$file" ] && continue + if [ ! "$HTTP_INITIALIZED" ]; then + _httpPath=http://pkg.freebsd.org + mediaSetHTTP + mediaOpen + fi + f_show_info "Downloading %s from\n %s" "$file" "$_httpPath" + f_device_get device_media "/$PKG_ABI/latest/$file" > $PKGDIR/$file || + exit 1 +done +_directoryPath=$TMPDIR +mediaSetDirectory +configPackages diff --git a/usr.sbin/bsdconfig/examples/bsdconfigrc b/usr.sbin/bsdconfig/examples/bsdconfigrc new file mode 100644 index 000000000000..b36031b484ec --- /dev/null +++ b/usr.sbin/bsdconfig/examples/bsdconfigrc @@ -0,0 +1,41 @@ +# Copyright (c) 2012 Ron McDowell +# Copyright (c) 2012 Devin Teske +# 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. +# + +# This file allows you to customize the behavior of bsdconfig. +# Copy it to your $HOME/.bsdconfigrc and edit to suit. + +# Debugging aids for development +# +#debug=1 +#debugFile=$HOME/out +#debugFile=+$HOME/out # includes debug to stdout + +# Optionally override functions to be more verbose (like including the date) +# +# f_dprintf() { +# local format="$1"; shift +# printf "$(date):$pgm:$format\n" "$@" >> $HOME/out +# } |
