diff options
Diffstat (limited to 'release/scripts')
34 files changed, 1131 insertions, 0 deletions
diff --git a/release/scripts/X11/build_x.sh b/release/scripts/X11/build_x.sh new file mode 100755 index 0000000..f32da1b --- /dev/null +++ b/release/scripts/X11/build_x.sh @@ -0,0 +1,157 @@ +#!/bin/sh +# +# This script builds X 3.3.x from the XFree86 and XFree86-contrib ports and +# installs it into a work directory. Once that is done, it uses XFree86's +# build-bindist command to package up the binary dists leaving them stored +# in the 'dist/bindist' subdirectory of the specified output directory. + +# usage information +# +usage() { + echo "$0 <work dir> <output dir>" + echo + echo "Where <output dir> is the base directory to install X into," + echo "and <work dir> is a scratch directory that the XFree86 ports" + echo "can be checked out into and built. This script also assumes" + echo "that it can get the distfiles from /usr/ports/distfiles (or" + echo "fetch them into that directory). The CVSROOT environment" + echo "variable should point to a FreeBSD CVS repository." + echo + echo "Before running this script, the following packages should be" + echo "installed:" + echo " XFree86" + echo " Tcl83, Tk83" + echo " ja-Tcl80, ja-Tk80" + echo + echo "Also, this should really be run as root." + exit 1 +} + +# check the command line +if [ $# -ne 2 ]; then + usage +fi + +# check $CVSROOT +if [ -z "$CVSROOT" ]; then + echo "\$CVSROOT not set!" + echo + usage +fi + +# setup the output directory +output_dir=$2 +echo ">>> preparing output directory: ${output_dir}" +case $output_dir in + /*) + ;; + *) + output_dir=`pwd`/${output_dir} + ;; +esac +if [ -r ${output_dir} ]; then + if ! rm -rf ${output_dir}; then + echo "Could not remove ${output_dir}!" + echo + usage + fi +fi +if ! mkdir -p ${output_dir}; then + echo "Could not create ${output_dir}!" + echo + usage +fi +if ! rmdir ${output_dir}; then + echo "Could not remove ${output_dir} the second time!" + echo + usage +fi + +# setup the work directory +work_dir=$1 +echo ">>> preparing work directory: ${work_dir}" +if [ -r ${work_dir} ]; then + if ! rm -rf ${work_dir}; then + echo "Could not remove ${work_dir}!" + echo + usage + fi +fi +if ! mkdir -p ${work_dir}; then + echo "Could not create ${work_dir}!" + echo + usage +fi +if ! mkdir ${work_dir}/base; then + echo "Could not create ${work_dir}/base!" + echo + usage +fi +if ! mkdir ${work_dir}/dist; then + echo "Could not create ${work_dir}/dist!" + echo + usage +fi +if ! mkdir ${work_dir}/ports; then + echo "Could not create ${work_dir}/ports!" + echo + usage +fi + +# check out the XFree86 and XFree86-contrib ports and set them up +echo ">>> checking out ports" +if ! ( cd ${work_dir}/ports && \ + cvs -R -d ${CVSROOT} co -P XFree86 XFree86-contrib ); then + echo "Could not checkout the XFree86 port!" + echo + usage +fi +if [ -r XF86.patch ]; then + echo ">>> patching ports" + if ! patch -d ${work_dir}/ports/XFree86 < XF86.patch; then + echo "Could not patch the XFree86 port!" + echo + usage + fi +fi + +# actually build X +echo ">>> building X" +if ! ( cd ${work_dir}/ports/XFree86 && \ + make BUILD_XDIST=yes DISTDIR=/usr/ports/distfiles \ + DESTDIR=${work_dir}/base NO_PKG_REGISTER=yes all install ); then + echo "Could not build XFree86!" + echo + usage +fi +if ! ( cd ${work_dir}/ports/XFree86-contrib && \ + make DISTDIR=/usr/ports/distfiles DESTDIR=${work_dir}/base \ + NO_PKG_REGISTER=yes all install ); then + echo "Could not build XFree86-contrib!" + echo + usage +fi + +# now package up the bindists +echo ">>> building bindist" +bindist_dir=${work_dir}/ports/XFree86/work/xc/programs/Xserver/hw/xfree86/etc/bindist +if ! cp ${bindist_dir}/FreeBSD-ELF/* ${work_dir}/dist; then + echo "Could not copy over distribution lists!" + echo + usage +fi +if ! cp ${bindist_dir}/common/* ${work_dir}/dist; then + echo "Could not copy over distribution lists!" + echo + usage +fi +if ! ${bindist_dir}/build-bindist X ${work_dir}/base ${work_dir}/dist; then + echo "Could not package up binary dists!" + echo + usage +fi +if ! mv ${work_dir}/dist/bindist ${output_dir}; then + echo "Could not move binary dists into ${output_dir}!" + echo + usage +fi diff --git a/release/scripts/base-install.sh b/release/scripts/base-install.sh new file mode 100755 index 0000000..c87a38b --- /dev/null +++ b/release/scripts/base-install.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +if [ "`id -u`" != "0" ]; then + echo "Sorry, this must be done as root." + exit 1 +fi + +echo "You are about to extract the base distribution into ${DESTDIR:-/} - are you SURE" +echo -n "you want to do this over your installed system (y/n)? " +read ans +if [ "$ans" = "y" ]; then + cat base.?? | tar --unlink -xpzf - -C ${DESTDIR:-/} +fi diff --git a/release/scripts/bin-install.sh b/release/scripts/bin-install.sh new file mode 100755 index 0000000..c87a38b --- /dev/null +++ b/release/scripts/bin-install.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +if [ "`id -u`" != "0" ]; then + echo "Sorry, this must be done as root." + exit 1 +fi + +echo "You are about to extract the base distribution into ${DESTDIR:-/} - are you SURE" +echo -n "you want to do this over your installed system (y/n)? " +read ans +if [ "$ans" = "y" ]; then + cat base.?? | tar --unlink -xpzf - -C ${DESTDIR:-/} +fi diff --git a/release/scripts/catpages-install.sh b/release/scripts/catpages-install.sh new file mode 100755 index 0000000..2e618ca --- /dev/null +++ b/release/scripts/catpages-install.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +if [ "`id -u`" != "0" ]; then + echo "Sorry, this must be done as root." + exit 1 +fi +cat catpages.?? | tar --unlink -xpzf - -C ${DESTDIR:-/} +exit 0 diff --git a/release/scripts/catpages-make.sh b/release/scripts/catpages-make.sh new file mode 100755 index 0000000..755057d --- /dev/null +++ b/release/scripts/catpages-make.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# Move all the catpages out to their own dist, using the base dist as a +# starting point. This must precede the manpages dist script. +if [ -d ${RD}/trees/base/usr/share/man ]; then + ( cd ${RD}/trees/base/usr/share/man; + find cat* whatis | cpio -dumpl ${RD}/trees/catpages/usr/share/man > /dev/null 2>&1) && + rm -rf ${RD}/trees/base/usr/share/man/cat*; +fi diff --git a/release/scripts/commerce-install.sh b/release/scripts/commerce-install.sh new file mode 100755 index 0000000..9bf67a3 --- /dev/null +++ b/release/scripts/commerce-install.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +if [ "`id -u`" != "0" ]; then + echo "Sorry, this must be done as root." + exit 1 +fi +echo "Extracting commerce tarball into ${DESTDIR}/usr/local" +tar --unlink -xpzf commerce.tgz -C ${DESTDIR}/usr/local +exit 0 diff --git a/release/scripts/compat1x-install.sh b/release/scripts/compat1x-install.sh new file mode 100755 index 0000000..b471caa --- /dev/null +++ b/release/scripts/compat1x-install.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +if [ "`id -u`" != "0" ]; then + echo "Sorry, this must be done as root." + exit 1 +fi +cat compat1x.?? | tar --unlink -xpzf - -C ${DESTDIR:-/} +exit 0 diff --git a/release/scripts/compat20-install.sh b/release/scripts/compat20-install.sh new file mode 100755 index 0000000..ec0faec --- /dev/null +++ b/release/scripts/compat20-install.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +if [ "`id -u`" != "0" ]; then + echo "Sorry, this must be done as root." + exit 1 +fi +cat compat20.?? | tar --unlink -xpzf - -C ${DESTDIR:-/} +exit 0 diff --git a/release/scripts/compat21-install.sh b/release/scripts/compat21-install.sh new file mode 100755 index 0000000..5680c29 --- /dev/null +++ b/release/scripts/compat21-install.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +if [ "`id -u`" != "0" ]; then + echo "Sorry, this must be done as root." + exit 1 +fi +cat compat21.?? | tar --unlink -xpzf - -C ${DESTDIR:-/} +exit 0 diff --git a/release/scripts/compat22-install.sh b/release/scripts/compat22-install.sh new file mode 100755 index 0000000..97708c5 --- /dev/null +++ b/release/scripts/compat22-install.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +if [ "`id -u`" != "0" ]; then + echo "Sorry, this must be done as root." + exit 1 +fi +cat compat22.?? | tar --unlink -xpzf - -C ${DESTDIR:-/} +exit 0 diff --git a/release/scripts/compat3x-install.sh b/release/scripts/compat3x-install.sh new file mode 100755 index 0000000..e216818 --- /dev/null +++ b/release/scripts/compat3x-install.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +if [ "`id -u`" != "0" ]; then + echo "Sorry, this must be done as root." + exit 1 +fi +cat compat3x.?? | tar --unlink -xpzf - -C ${DESTDIR:-/} +exit 0 diff --git a/release/scripts/compat4x-install.sh b/release/scripts/compat4x-install.sh new file mode 100755 index 0000000..2950a1b --- /dev/null +++ b/release/scripts/compat4x-install.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +if [ "`id -u`" != "0" ]; then + echo "Sorry, this must be done as root." + exit 1 +fi +cat compat4x.?? | tar --unlink -xpzf - -C ${DESTDIR:-/} +exit 0 diff --git a/release/scripts/crypto-install.sh b/release/scripts/crypto-install.sh new file mode 100755 index 0000000..d51caac --- /dev/null +++ b/release/scripts/crypto-install.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +if [ "`id -u`" != "0" ]; then + echo "Sorry, this must be done as root." + exit 1 +fi +_DEST=${DESTDIR:-/} +echo "You are about to extract the CRYPTO distribution into ${_DEST} - are you SURE" +echo "you want to do this over your installed system? If not, hit ^C now," +echo -n "otherwise hit return to continue. " +read junk +cat crypto.?? | tar --unlink -xpzf - -C ${_DEST} +cat krb4.?? | tar --unlink -xpzf - -C ${_DEST} +cat krb5.?? | tar --unlink -xpzf - -C ${_DEST} +echo -n "Do you want to install the CRYPTO sources (y/n)? " +read ans +if [ "$ans" = "y" ]; then + cat scrypto.?? | tar --unlink -xpzf - -C ${_DEST}/usr/src + cat ssecure.?? | tar --unlink -xpzf - -C ${_DEST}/usr/src + cat skrb4.?? | tar --unlink -xpzf - -C ${_DEST}/usr/src + cat skrb5.?? | tar --unlink -xpzf - -C ${_DEST}/usr/src +fi +exit 0 diff --git a/release/scripts/dict-install.sh b/release/scripts/dict-install.sh new file mode 100755 index 0000000..4f57aaa --- /dev/null +++ b/release/scripts/dict-install.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +if [ "`id -u`" != "0" ]; then + echo "Sorry, this must be done as root." + exit 1 +fi +cat dict.?? | tar --unlink -xpzf - -C ${DESTDIR:-/} +exit 0 diff --git a/release/scripts/dict-make.sh b/release/scripts/dict-make.sh new file mode 100755 index 0000000..c0ca6a5 --- /dev/null +++ b/release/scripts/dict-make.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# Move the dict stuff out to its own dist +if [ -d ${RD}/trees/base/usr/share/dict ]; then + tar -cf - -C ${RD}/trees/base/usr/share/dict . | + tar -xpf - -C ${RD}/trees/dict/usr/share/dict && + rm -rf ${RD}/trees/base/usr/share/dict; +fi + +for i in birthtoken flowers; do + if [ -f ${RD}/trees/base/usr/share/misc/$i ]; then + mv ${RD}/trees/base/usr/share/misc/$i \ + ${RD}/trees/dict/usr/share/misc; + fi; +done diff --git a/release/scripts/doFS.sh b/release/scripts/doFS.sh new file mode 100644 index 0000000..12aceaa --- /dev/null +++ b/release/scripts/doFS.sh @@ -0,0 +1,135 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +set -e + +export BLOCKSIZE=512 + +if [ "$1" = "-s" ]; then + do_size="yes"; shift +else + do_size="" +fi + +FSIMG=$1; shift +RD=$1 ; shift +MNT=$1 ; shift +FSSIZE=$1 ; shift +FSPROTO=$1 ; shift +FSINODE=$1 ; shift +FSLABEL=$1 ; shift + +deadlock=20 + +dofs_vn () { + if [ "x$VNDEVICE" = "x" ] ; then + VNDEVICE=vn0 + fi + u=`expr $VNDEVICE : 'vn\([0-9]*\)' || true` + VNDEVICE=vnn$u + + rm -f /dev/*vnn* + mknod /dev/rvnn${u} c 43 `expr 65538 + $u '*' 8` + mknod /dev/rvnn${u}c c 43 `expr 2 + $u '*' 8` + mknod /dev/vnn${u} b 15 `expr 65538 + $u '*' 8` + mknod /dev/vnn${u}c b 15 `expr 2 + $u '*' 8` + + while true + do + rm -f ${FSIMG} + + umount /dev/${VNDEVICE} 2>/dev/null || true + umount ${MNT} 2>/dev/null || true + vnconfig -u /dev/r${VNDEVICE} 2>/dev/null || true + + dd of=${FSIMG} if=/dev/zero count=${FSSIZE} bs=1k 2>/dev/null + + vnconfig -s labels -c /dev/r${VNDEVICE} ${FSIMG} + disklabel -Brw ${VNDEVICE} ${FSLABEL} + newfs -i ${FSINODE} -o space -m 1 /dev/r${VNDEVICE}c + + mount /dev/${VNDEVICE}c ${MNT} + + if [ -d ${FSPROTO} ]; then + (set -e && cd ${FSPROTO} && find . -print | cpio -dump ${MNT}) + else + cp -p ${FSPROTO} ${MNT} + fi + + df -ki ${MNT} + + set `df -ki ${MNT} | tail -1` + + umount ${MNT} + vnconfig -u /dev/r${VNDEVICE} 2>/dev/null || true + + echo "*** Filesystem is ${FSSIZE} K, $4 left" + echo "*** ${FSINODE} bytes/inode, $7 left" + if [ "${do_size}" ]; then + echo ${FSSIZE} > ${FSIMG}.size + fi + break; + done + + rm -f /dev/*vnn* +} + +dofs_md () { + while true + do + rm -f ${FSIMG} + + if [ "x${MDDEVICE}" != "x" ] ; then + umount /dev/${MDDEVICE} 2>/dev/null || true + umount ${MNT} 2>/dev/null || true + mdconfig -d -u ${MDDEVICE} 2>/dev/null || true + fi + + dd of=${FSIMG} if=/dev/zero count=${FSSIZE} bs=1k 2>/dev/null + + MDDEVICE=`mdconfig -a -t vnode -f ${FSIMG}` + if [ ! -c /dev/${MDDEVICE} ] ; then + if [ -f /dev/MAKEDEV ] ; then + ( cd /dev && sh MAKEDEV ${MDDEVICE} ) + else + echo "No /dev/$MDDEVICE and no MAKEDEV" 1>&2 + exit 1 + fi + fi + disklabel -Brw ${MDDEVICE} ${FSLABEL} + newfs -i ${FSINODE} -o space -m 0 /dev/${MDDEVICE}c + + mount /dev/${MDDEVICE}c ${MNT} + + if [ -d ${FSPROTO} ]; then + (set -e && cd ${FSPROTO} && find . -print | cpio -dump ${MNT}) + else + cp -p ${FSPROTO} ${MNT} + fi + + df -ki ${MNT} + + set `df -ki ${MNT} | tail -1` + + umount ${MNT} + mdconfig -d -u ${MDDEVICE} 2>/dev/null || true + + echo "*** Filesystem is ${FSSIZE} K, $4 left" + echo "*** ${FSINODE} bytes/inode, $7 left" + if [ "${do_size}" ]; then + echo ${FSSIZE} > ${FSIMG}.size + fi + break; + done +} + +case `uname -r` in +[1-4].*) + dofs_vn + ;; +*) + dofs_md + ;; +esac diff --git a/release/scripts/doc-install.sh b/release/scripts/doc-install.sh new file mode 100755 index 0000000..5609720 --- /dev/null +++ b/release/scripts/doc-install.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +if [ "`id -u`" != "0" ]; then + echo "Sorry, this must be done as root." + exit 1 +fi +echo "You are about to extract the doc distribution into ${DESTDIR:-/} - are you SURE" +echo -n "you want to do this over your installed system (y/n)? " +read ans +if [ "$ans" = "y" ]; then + cat doc.?? | tar --unlink -xpzf - -C ${DESTDIR:-/} +fi diff --git a/release/scripts/doc-make.sh b/release/scripts/doc-make.sh new file mode 100755 index 0000000..0335540 --- /dev/null +++ b/release/scripts/doc-make.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# Create the doc dist. +if [ -d ${RD}/trees/base/usr/share/doc ]; then + ( cd ${RD}/trees/base/usr/share/doc; + find . | cpio -dumpl ${RD}/trees/doc/usr/share/doc ) && + rm -rf ${RD}/trees/base/usr/share/doc +fi diff --git a/release/scripts/driver-copy2.pl b/release/scripts/driver-copy2.pl new file mode 100644 index 0000000..6c4dfe6 --- /dev/null +++ b/release/scripts/driver-copy2.pl @@ -0,0 +1,78 @@ +#!/usr/bin/perl +# +# Copyright (c) 2000 "HOSOKAWA, Tatsumi" <hosokawa@FreeBSD.org> +# 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$ +# + +if ($#ARGV != 2) { + print STDERR "usage: driver-copy.pl config_file src_ko_dir dst_ko_dir\n"; + exit 1; +} + +$config = $ARGV[0]; +$srcdir = $ARGV[1]; +$dstdir = $ARGV[2]; + +open CONFIG, "< $config" or die "Cannot open $config.\n"; +while (<CONFIG>) { + s/#.*$//; + if (/^(\w+)\s+(\w+)\s+(\d+)\s+(\w+)\s+\"(.*)\"\s*$/) { + $flp{$2} = $3; + $dsc{$2} = $5; + } +} +close CONFIG; + +-d $srcdir or die "Cannot find $srcdir directory.\n"; +-d $dstdir or die "Cannot find $dstdir directory.\n"; + +undef $/; + +foreach $f (sort keys %flp) { + if ($flp{$f} == 1) { + print STDERR "$f: There's nothing to do with driver on first floppy.\n"; + } + elsif ($flp{$f} == 2) { + $srcfile = $srcdir . '/' . $f . '.ko'; + $dstfile = $dstdir . '/' . $f . '.ko'; + $dscfile = $dstdir . '/' . $f . '.dsc'; + print STDERR "Copying $f.ko to $dstdir\n"; + open SRC, "< $srcfile" or die "Cannot open $srcfile\n"; + $file = <SRC>; + close SRC; + open DST, "> $dstfile" or die "Cannot open $dstfile\n"; + print DST $file; + close DST; + open DSC, "> $dscfile" or die "Cannot open $dscfile\n"; + print DSC $dsc{$f}; + close DSC; + } + elsif ($flp{$f} == 3) { + # third driver floppy (currently not implemnted yet...) + print STDERR "3rd driver floppy support has not implemented yet\n"; + exit 1; + } +} diff --git a/release/scripts/driver-remove.pl b/release/scripts/driver-remove.pl new file mode 100644 index 0000000..aa8ec1c --- /dev/null +++ b/release/scripts/driver-remove.pl @@ -0,0 +1,58 @@ +#!/usr/bin/perl +# +# Copyright (c) 2000 "HOSOKAWA, Tatsumi" <hosokawa@FreeBSD.org> +# 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$ +# + +if ($#ARGV != 1) { + print STDERR "usage: driver-remove.pl config_file BOOTMFS\n"; + exit 1; +} + +$config = $ARGV[0]; +$bootmfs = $ARGV[1]; + +open CONFIG, "< $config" or die "Cannot open $config.\n"; +while (<CONFIG>) { + s/#.*$//; + if (/^(\w+)\s+(\w+)\s+(\d+)\s+(\w+)\s+\"(.*)\"\s*$/) { + $drivers{$1} = 1; + } +} +close CONFIG; + +open BOOTMFS, "< $bootmfs" or die "Cannot open $bootmfs.\n"; +while (<BOOTMFS>) { + next if (/^device\s+(\w+)/ && $drivers{$1}); + push @bootmfs, $_; +} +close BOOTMFS; + +open BOOTMFS, "> $bootmfs" or die "Cannot open $bootmfs.\n"; +foreach (@bootmfs) { + print BOOTMFS; +} +close BOOTMFS; diff --git a/release/scripts/games-install.sh b/release/scripts/games-install.sh new file mode 100755 index 0000000..6c94077 --- /dev/null +++ b/release/scripts/games-install.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +if [ "`id -u`" != "0" ]; then + echo "Sorry, this must be done as root." + exit 1 +fi +cat games.?? | tar --unlink -xpzf - -C ${DESTDIR:-/} +exit 0 diff --git a/release/scripts/games-make.sh b/release/scripts/games-make.sh new file mode 100755 index 0000000..6e83d14 --- /dev/null +++ b/release/scripts/games-make.sh @@ -0,0 +1,37 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# Move all the games out to their own dist +if [ -d ${RD}/trees/base/usr/games ]; then + tar -cf - -C ${RD}/trees/base/usr/games . | + tar -xpf - -C ${RD}/trees/games/usr/games && + rm -rf ${RD}/trees/base/usr/games; +fi + +if [ -d ${RD}/trees/base/usr/share/games ]; then + tar -cf - -C ${RD}/trees/base/usr/share/games . | + tar -xpf - -C ${RD}/trees/games/usr/share/games && + rm -rf ${RD}/trees/base/usr/share/games; +fi + +if [ -d ${RD}/trees/base/var/games ]; then + tar -cf - -C ${RD}/trees/base/var/games . | + tar -xpf - -C ${RD}/trees/games/var/games && + rm -rf ${RD}/trees/base/var/games; +fi + +if [ -d ${RD}/trees/manpages/usr/share/man/man6 ]; then + mkdir -p ${RD}/trees/games/usr/share/man/man6 + tar -cf - -C ${RD}/trees/manpages/usr/share/man/man6 . | + tar -xpf - -C ${RD}/trees/games/usr/share/man/man6 && + rm -rf ${RD}/trees/manpages/usr/share/man/man6 +fi + +if [ -d ${RD}/trees/catpages/usr/share/man/cat6 ]; then + mkdir -p ${RD}/trees/games/usr/share/man/cat6 + tar -cf - -C ${RD}/trees/catpages/usr/share/man/cat6 . | + tar -xpf - -C ${RD}/trees/games/usr/share/man/cat6 && + rm -rf ${RD}/trees/catpages/usr/share/man/cat6 +fi diff --git a/release/scripts/info-install.sh b/release/scripts/info-install.sh new file mode 100755 index 0000000..30c12bf --- /dev/null +++ b/release/scripts/info-install.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +if [ "`id -u`" != "0" ]; then + echo "Sorry, this must be done as root." + exit 1 +fi +cat info.?? | tar --unlink -xpzf - -C ${DESTDIR:-/} +exit 0 diff --git a/release/scripts/info-make.sh b/release/scripts/info-make.sh new file mode 100755 index 0000000..12fd29d --- /dev/null +++ b/release/scripts/info-make.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# Move the info files out to their own dist +if [ -d ${RD}/trees/base/usr/share/info ]; then + tar -cf - -C ${RD}/trees/base/usr/share/info . | + tar -xpf - -C ${RD}/trees/info/usr/share/info && + rm -rf ${RD}/trees/base/usr/share/info; +fi diff --git a/release/scripts/info.sh b/release/scripts/info.sh new file mode 100644 index 0000000..e25ceb7 --- /dev/null +++ b/release/scripts/info.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# +# $ANA: info.sh,v 1.3 1996/06/04 16:25:30 wollman Exp $ +# $FreeBSD$ +# + +ls $1.[a-z][a-z] | wc | awk '{ print "Pieces = ",$1 }' +for FILE in $1.[a-z][a-z]; do + PIECE=`echo $FILE | cut -d . -f 2` + echo -n "cksum.$PIECE = " + cksum $FILE | awk ' { print $1,$2 } ' +done diff --git a/release/scripts/manpages-install.sh b/release/scripts/manpages-install.sh new file mode 100755 index 0000000..35eb4b7 --- /dev/null +++ b/release/scripts/manpages-install.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +if [ "`id -u`" != "0" ]; then + echo "Sorry, this must be done as root." + exit 1 +fi +cat manpages.?? | tar --unlink -xpzf - -C ${DESTDIR:-/} +exit 0 diff --git a/release/scripts/manpages-make.sh b/release/scripts/manpages-make.sh new file mode 100755 index 0000000..bb1326f --- /dev/null +++ b/release/scripts/manpages-make.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# Move all the manpages out to their own dist, using the base dist as a +# starting point. +if [ -d ${RD}/trees/base/usr/share/man ]; then + ( cd ${RD}/trees/base/usr/share/man; + find . | cpio -dumpl ${RD}/trees/manpages/usr/share/man > /dev/null 2>&1) && + rm -rf ${RD}/trees/base/usr/share/man; +fi diff --git a/release/scripts/ports-install.sh b/release/scripts/ports-install.sh new file mode 100755 index 0000000..81c4023 --- /dev/null +++ b/release/scripts/ports-install.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +if [ "`id -u`" != "0" ]; then + echo "Sorry, this must be done as root." + exit 1 +fi +echo "Extracting ports tarball into ${DESTDIR}/usr" +cat ports.tgz | tar --unlink -xpzf - -C ${DESTDIR}/usr +exit 0 diff --git a/release/scripts/print-cdrom-packages.sh b/release/scripts/print-cdrom-packages.sh new file mode 100755 index 0000000..cecc219 --- /dev/null +++ b/release/scripts/print-cdrom-packages.sh @@ -0,0 +1,181 @@ +#!/bin/sh +# +# Author: Jordan Hubbard +# Date: Mon Jul 10 01:18:20 2000 +# Version: $FreeBSD$ +# +# MAINTAINER: jkh +# +# This script prints out the list of "minimum required packages" for +# a given CDROM number, that numer currently referring to the 4 CD +# "official set" published by BSDi. If there is no minimum package +# set for the given CDROM, or none is known, the script will exit +# with a error code of 1. At some point, this script should be extended +# to at least cope with other official CD distributions, like non-US ones. +# +# usage: print-cdrom-packages.sh cdrom-number +# +# example: ./print-cdrom-packages.sh 1 +# will print the minimal package set for the first cdrom (what's generally +# referred to as the installation boot CD). +# +# This information is codified in script form so that some definitive +# reference for the package set info exists rather than having it +# be left up to everybody's best guess. It's currently hard-coded directly +# into the script but may, at some point, switch to a more sophisticated +# data-extraction technique from the ports collection. For now, add your +# packages to the appropriate CDROM_SET_<n> variable as /usr/ports/<your-entry> +# so that the package name and dependency list for each can be at least be +# obtained in an automated fashion. + +# The following are required if you obtained your packages from one of the +# package building clusters or otherwise had these defined when the packages +# were built. +export BATCH=t +export PACKAGE_BUILDING=t + +# usage: extract-names cd# [portsdir] +extract-names() +{ + portsdir=${2-/usr/ports} + _FOO=`eval echo \\${CDROM_SET_$1}` + if [ "${_FOO}" ]; then + TMPNAME="/tmp/_extract_names$$" + rm -f ${TMPNAME} + for i in ${_FOO}; do + ( cd $portsdir/$i && PORTSDIR=$portsdir make package-name package-depends ) >> ${TMPNAME}; + done + if [ -s "${TMPNAME}" ]; then + sort -u ${TMPNAME} + fi + rm -f ${TMPNAME} + else + exit 1 + fi +} + + +## Start of set for CDROM #1 +# This is the set required by sysinstall. +CDROM_SET_1="" +if [ "X`uname -m`" = "Xalpha" ]; then +CDROM_SET_1="${CDROM_SET_1} emulators/osf1_base" +else +CDROM_SET_1="${CDROM_SET_1} emulators/linux_base" +fi +CDROM_SET_1="${CDROM_SET_1} net/pcnfsd" +CDROM_SET_1="${CDROM_SET_1} net/rsync" +CDROM_SET_1="${CDROM_SET_1} x11-fonts/XFree86-4-font100dpi" +CDROM_SET_1="${CDROM_SET_1} x11-fonts/XFree86-4-font75dpi" +CDROM_SET_1="${CDROM_SET_1} x11-fonts/XFree86-4-fontCyrillic" +CDROM_SET_1="${CDROM_SET_1} x11-fonts/XFree86-4-fontDefaultBitmaps" +CDROM_SET_1="${CDROM_SET_1} x11-fonts/XFree86-4-fontEncodings" +CDROM_SET_1="${CDROM_SET_1} x11-fonts/XFree86-4-fontScalable" +CDROM_SET_1="${CDROM_SET_1} x11-servers/XFree86-4-FontServer" +CDROM_SET_1="${CDROM_SET_1} x11-servers/XFree86-4-NestServer" +CDROM_SET_1="${CDROM_SET_1} x11-servers/XFree86-4-PrintServer" +CDROM_SET_1="${CDROM_SET_1} x11-servers/XFree86-4-Server" +CDROM_SET_1="${CDROM_SET_1} x11-servers/XFree86-4-VirtualFramebufferServer" +CDROM_SET_1="${CDROM_SET_1} x11-wm/afterstep" +CDROM_SET_1="${CDROM_SET_1} x11-wm/enlightenment" +CDROM_SET_1="${CDROM_SET_1} x11-wm/fvwm2" +CDROM_SET_1="${CDROM_SET_1} x11-wm/sawfish" +CDROM_SET_1="${CDROM_SET_1} x11-wm/windowmaker" +CDROM_SET_1="${CDROM_SET_1} x11/XFree86-4" +CDROM_SET_1="${CDROM_SET_1} x11/XFree86-4-clients" +CDROM_SET_1="${CDROM_SET_1} x11/XFree86-4-documents" +CDROM_SET_1="${CDROM_SET_1} x11/XFree86-4-libraries" +CDROM_SET_1="${CDROM_SET_1} x11/XFree86-4-manuals" +CDROM_SET_1="${CDROM_SET_1} x11/gnome" +CDROM_SET_1="${CDROM_SET_1} x11/kde2" +CDROM_SET_1="${CDROM_SET_1} www/links" + +# This is the set of "people really want these" packages. Please add to +# this list. +CDROM_SET_1="${CDROM_SET_1} astro/xearth" +CDROM_SET_1="${CDROM_SET_1} editors/emacs21" +CDROM_SET_1="${CDROM_SET_1} editors/vim-lite" +CDROM_SET_1="${CDROM_SET_1} editors/vim5" +CDROM_SET_1="${CDROM_SET_1} emulators/mtools" +CDROM_SET_1="${CDROM_SET_1} ftp/ncftp" +CDROM_SET_1="${CDROM_SET_1} graphics/gimp1" +CDROM_SET_1="${CDROM_SET_1} graphics/xpdf" +CDROM_SET_1="${CDROM_SET_1} graphics/xv" +CDROM_SET_1="${CDROM_SET_1} irc/xchat" +CDROM_SET_1="${CDROM_SET_1} lang/gnat" +CDROM_SET_1="${CDROM_SET_1} mail/exim" +CDROM_SET_1="${CDROM_SET_1} mail/fetchmail" +CDROM_SET_1="${CDROM_SET_1} mail/mutt" +CDROM_SET_1="${CDROM_SET_1} mail/pine4" +CDROM_SET_1="${CDROM_SET_1} mail/xfmail" +CDROM_SET_1="${CDROM_SET_1} misc/screen" +CDROM_SET_1="${CDROM_SET_1} net/cvsup" +CDROM_SET_1="${CDROM_SET_1} net/samba" +CDROM_SET_1="${CDROM_SET_1} news/slrn" +CDROM_SET_1="${CDROM_SET_1} news/tin" +CDROM_SET_1="${CDROM_SET_1} print/a2ps-letter" +CDROM_SET_1="${CDROM_SET_1} print/acroread" +CDROM_SET_1="${CDROM_SET_1} print/apsfilter" +CDROM_SET_1="${CDROM_SET_1} print/ghostscript-gnu-nox11" +CDROM_SET_1="${CDROM_SET_1} print/ghostview" +CDROM_SET_1="${CDROM_SET_1} print/gv" +CDROM_SET_1="${CDROM_SET_1} print/psutils-letter" +CDROM_SET_1="${CDROM_SET_1} security/sudo" +CDROM_SET_1="${CDROM_SET_1} shells/bash2" +CDROM_SET_1="${CDROM_SET_1} shells/pdksh" +CDROM_SET_1="${CDROM_SET_1} shells/zsh" +CDROM_SET_1="${CDROM_SET_1} sysutils/portupgrade" +CDROM_SET_1="${CDROM_SET_1} www/linux-netscape47-communicator" +CDROM_SET_1="${CDROM_SET_1} www/linux-netscape47-navigator" +CDROM_SET_1="${CDROM_SET_1} www/lynx" +CDROM_SET_1="${CDROM_SET_1} www/netscape-remote" +CDROM_SET_1="${CDROM_SET_1} www/netscape-wrapper" +CDROM_SET_1="${CDROM_SET_1} x11/rxvt" + +# VERY common build dependencies +CDROM_SET_1="${CDROM_SET_1} archivers/unzip" +CDROM_SET_1="${CDROM_SET_1} devel/gmake" +CDROM_SET_1="${CDROM_SET_1} graphics/png" +CDROM_SET_1="${CDROM_SET_1} misc/compat22" +CDROM_SET_1="${CDROM_SET_1} misc/compat3x" +CDROM_SET_1="${CDROM_SET_1} misc/compat4x" + +## End of set for CDROM #1 + +## Start of set for CDROM #2 +## Live file system, CVS repositories, and commerical software demos +## typically live on this disc. Users do not expect to find packages +## here. +## End of set for CDROM #2 + +## Start of set for CDROM #3 +CDROM_SET_3="${CDROM_SET_3} editors/xemacs21" +CDROM_SET_3="${CDROM_SET_3} net/cvsup-without-gui" +CDROM_SET_3="${CDROM_SET_3} print/acroread4" +CDROM_SET_3="${CDROM_SET_3} print/teTeX" +CDROM_SET_3="${CDROM_SET_3} textproc/docproj" + +## End of set for CDROM #3 + +## Start of set for CDROM #4 +## End of set for CDROM #4 + + +## Start of set that should not be included on any CDROM. +## This should not contain packages that are already marked BROKEN or +## RESTRICTED, it is only for packages that sysinstall(8) has trouble +## with. +NO_CDROM_SET="" +NO_CDROM_SET="${NO_CDROM_SET} net/cvsupit" + +# Start of actual script. +if [ $# -lt 1 ]; then + echo "usage: $0 cdrom-number [portsdir]" + exit 2 +fi +if [ ${1} = 0 ]; then + echo $NO_CDROM_SET +else + extract-names $* +fi +exit 0 diff --git a/release/scripts/proflibs-install.sh b/release/scripts/proflibs-install.sh new file mode 100755 index 0000000..5dd2b42 --- /dev/null +++ b/release/scripts/proflibs-install.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +if [ "`id -u`" != "0" ]; then + echo "Sorry, this must be done as root." + exit 1 +fi +cat proflibs.?? | tar --unlink -xpzf - -C ${DESTDIR:-/} +cd ${DESTDIR:-/}usr/lib +if [ -f libdescrypt_p.a ] +then + ln -f -s libdescrypt_p.a libcrypt_p.a +fi +exit 0 diff --git a/release/scripts/proflibs-make.sh b/release/scripts/proflibs-make.sh new file mode 100755 index 0000000..e03b8b2 --- /dev/null +++ b/release/scripts/proflibs-make.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# Move the profiled libraries out to their own dist +for i in ${RD}/trees/base/usr/lib/*_p.a; do + if [ -f $i ]; then + mv $i ${RD}/trees/proflibs/usr/lib; + fi; +done diff --git a/release/scripts/src-install.sh b/release/scripts/src-install.sh new file mode 100755 index 0000000..32e667f --- /dev/null +++ b/release/scripts/src-install.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +if [ "`id -u`" != "0" ]; then + echo "Sorry, this must be done as root." + exit 1 +fi +if [ $# -lt 1 ]; then + echo "You must specify which components of src to extract" + echo "possible subcomponents are:" + echo + echo "base bin contrib etc games gnu include lib libexec" + echo "release sbin share sys tools ubin usbin" + echo + echo "You may also specify all to extract all subcomponents." + exit 1 +fi + +if [ "$1" = "all" ]; then + dists="base bin contrib etc games gnu include lib libexec release sbin share sys tools ubin usbin" +else + dists="$*" +fi + +echo "Extracting sources into ${DESTDIR}/usr/src..." +for i in $dists; do + echo " Extracting source component: $i" + cat s${i}.?? | tar --unlink -xpzf - -C ${DESTDIR}/usr/src +done +echo "Done extracting sources." +exit 0 diff --git a/release/scripts/tar.sh b/release/scripts/tar.sh new file mode 100644 index 0000000..e0933f2 --- /dev/null +++ b/release/scripts/tar.sh @@ -0,0 +1,119 @@ +#!/bin/sh -p +# +# Simple replacement for tar(1), using cpio(1). +# +# Copyright (c) 1996 Joerg Wunsch +# 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 DEVELOPERS ``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 DEVELOPERS 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$ +# + +# +# For use on the fixit floppy. External programs required: +# cpio(1), find(1), test(1) +# + + +archive=${TAPE:-/dev/rsa0} +blocksize="20" +device="" +mode="none" +verbose="" + +usage() +{ + echo "usage: tar -{c|t|x} [-v] [-b blocksize] [-f archive] [files...]" 1>&2 + exit 64 # EX_USAGE +} + +# +# Prepend a hyphen to the first arg if necessary, so the traditional form +# ``tar xvf /dev/foobar'' will work, too. More kludgy legacy forms are not +# supported however. +# + +if [ $# -lt 1 ] ; then + usage +fi + +case "$1" in + -*) break + ;; + *) tmp="$1" + shift + set -- -$tmp "$@" + ;; +esac + +while getopts "ctxvb:f:" option +do + case $option in + [ctx]) + if [ $mode = "none" ] ; then + mode=$option + else + usage + fi + ;; + v) + verbose="-v" + ;; + b) + blocksize="${OPTARG}" + ;; + f) + archive="${OPTARG## }" + ;; + *) + usage + ;; + esac +done + +shift $(($OPTIND - 1)) + +if [ "X${archive}" != "X-" ] ; then + device="-F ${archive}" +# else: use stdin or stdout, which is the default for cpio +fi + +case $mode in + none) + usage + ;; + t) + exec cpio -it $verbose $device --block-size="$blocksize" "$@" + ;; + x) + exec cpio -idmu $verbose $device --block-size="$blocksize" "$@" + ;; + c) + if [ $# -eq 0 ] ; then + # use current dir -- slightly bogus + set -- "." + fi + find "$@" -print |\ + cpio -o -H ustar $verbose $device --block-size="$blocksize" + exit $? + ;; +esac diff --git a/release/scripts/xperimnt-install.sh b/release/scripts/xperimnt-install.sh new file mode 100755 index 0000000..3942658 --- /dev/null +++ b/release/scripts/xperimnt-install.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +if [ "`id -u`" != "0" ]; then + echo "Sorry, this must be done as root." + exit 1 +fi +echo "Extracting xperimnt tarball into ${DESTDIR}/usr/local" +tar --unlink -xpzf xperimnt.tgz -C ${DESTDIR}/usr/local +exit 0 |