[206] in Info-AFS_Redistribution
Re: Package Config File Needed
daemon@ATHENA.MIT.EDU (Daniel Edward Lovinger)
Sat Jul 13 15:11:06 1991
Date: Sat, 13 Jul 91 13:55:25 -0400 (EDT)
From: Daniel Edward Lovinger <dl2n+@andrew.cmu.edu>
To: Info-AFS@transarc.com
Cc: alex@aix.nih.gov
In-Reply-To: <EcTnkAK00Voo4=gJ5M@andrew.cmu.edu>
Sorry about that ... ;-)
Ted Persky <tpersky+@alw.nih.gov> writes:
> Does anyone have a complete, working package configuration
> file for an IBM RS 6000 workstation running AIX 3.1? I've
> been working on one, but why reinvent the wheel if I don't
> have to?
Well, I have a wheel in somewhat useful shape. It is a pair of
perl scripts that walk across a "virgin" OS tree and produce a basic
package description for it that can be mangled at will - one for the
OS tree, one for /dev when you have one fully populated. We've used
these things to help create two new systypes in the last few months
(pmax_ul4 and sun4c_411).
For pckg-tree, modify the value of $os_tree as appropriate to
point at a populated OS volume. It takes a while to run - about 7
hours for the Sparc. You may want to point it at a small tree just to
convince yourself that it works.
${machine}, the default place to pull files from, is (for us)
an mpp variable that points to the top of the OS tree in AFS. You may
want to change this.
Dan Lovinger Computing & Comunications Carnegie Mellon U.
Internet: dl2n+@andrew.cmu.edu Bitnet: dl2n+%andrew.cmu.edu@carnegie
"... and in the stillness, they heard the cry of the golden banana ..."
------------------------------------------------------------------------------
#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of archive 1 (of 1)."
# Contents: dev-tree pckg-tree
# Wrapped by dl2n@antares.weh.andrew.cmu.edu on Sat Jul 13 13:50:29 1991
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f dev-tree -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"dev-tree\"
else
echo shar: Extracting \"dev-tree\" \(613 characters\)
sed "s/^X//" >dev-tree <<'END_OF_dev-tree'
X#!/usr/local/bin/perl
X
X$X =1;
X
Xopendir(DIR, "/dev");
Xlocal(@dir) = readdir(DIR);
Xclosedir(DIR);
X
Xforeach $d (@dir) {
X $name = "/dev/" . $d;
X
X if (! -b $name && ! -c $name)
X {
X next;
X }
X
X ($mydev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime,
X $mtime, $ctime, $blksize, $blocks)
X = stat($name);
X ($oname) = getpwuid($uid);
X ($gname) = getgrgid($gid);
X $mode = $mode & 0007777;
X
X $major_dev = ($rdev >> 8) & 0x00ff;
X $minor_dev = ($rdev) & 0x00ff;
X
X if (-b $d)
X {
X print("B\t");
X } else {
X print("C\t");
X }
X
X printf("%s\t%d\t%d\t%s %s %o\n", $name, $major_dev, $minor_dev, $oname, $gname, $mode);
X}
END_OF_dev-tree
if test 613 -ne `wc -c <dev-tree`; then
echo shar: \"dev-tree\" unpacked with wrong size!
fi
chmod +x dev-tree
# end of overwriting check
fi
if test -f pckg-tree -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"pckg-tree\"
else
echo shar: Extracting \"pckg-tree\" \(1362 characters\)
sed "s/^X//" >pckg-tree <<'END_OF_pckg-tree'
X#!/usr/local/bin/perl -s
X
X# TODO
X# resolve ../../{foo} in front of links
X
X# force flushes - why doesn't this work?
X$X = 1;
X
Xlocal($os_tree) = "/afs/.andrew.cmu.edu/system/beta/sun4c_411/os";
X
Xsub traverse {
X local($dir)=@_;
X local($d);
X
X $rdir= $os_tree . $dir;
X
X opendir(DIR, $rdir);
X local(@dir) = readdir(DIR);
X closedir(DIR);
X
X foreach $d (@dir) {
X if ($d eq "." || $d eq "..")
X {
X next;
X }
X
X $file = $dir . "/" . $d;
X $rfile = $os_tree . $file;
X
X ($mydev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime,
X $mtime, $ctime, $blksize, $blocks)
X = stat($rfile);
X ($oname) = getpwuid($uid);
X ($gname) = getgrgid($gid);
X $mode = $mode & 0007777;
X
X # just in case, handle unknown users/groups
X if ($oname eq "")
X {
X $oname = "root";
X }
X
X if ($gname eq "")
X {
X $gname = "wheel";
X }
X
X # why does perl resolve links?
X if (-d $rfile && ! -l $rfile)
X {
X printf("D\t%s\t\t\t\t%s %s %o\n",$file,$oname,$gname,
X $mode);
X do traverse($file);
X next;
X }
X
X if (-f $rfile && ! -l $rfile)
X {
X local($remotefile) = '${machine}';
X printf("F\t%s\t\t%s", $file, $remotefile);
X printf("\t%s %s %o\n", $oname, $gname, $mode);
X next;
X }
X
X if (-l $rfile)
X {
X local($link) = readlink($rfile);
X printf("LA\t%s\t\t%s", $file, $link);
X printf("\t%s %s %o\n", $oname, $gname, $mode);
X }
X }
X}
X
Xdo traverse ("");
END_OF_pckg-tree
if test 1362 -ne `wc -c <pckg-tree`; then
echo shar: \"pckg-tree\" unpacked with wrong size!
fi
chmod +x pckg-tree
# end of overwriting check
fi
echo shar: End of archive 1 \(of 1\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have unpacked all 1 archives.
rm -f ark[1-9]isdone
else
echo You still need to unpack the following archives:
echo " " ${MISSING}
fi
## End of shell archive.
exit 0