source: trunk/packs/build/makeroot.sh @ 19141

Revision 19141, 3.2 KB checked in by ghudson, 21 years ago (diff)
Revert the /usr/{athena,afsws} adjustment; we're back to the old style of build on Solaris.
Line 
1#!/bin/sh
2# $Id: makeroot.sh,v 1.16 2003-03-31 17:28:01 ghudson Exp $
3
4if [ $# -lt 1 ]; then
5  echo "Usage: $0 rootdir [fullversion]" >&2
6  exit 1
7fi
8
9root=$1
10ver=$2
11
12case `machtype` in
13linux)
14  sysprefix=/afs/.dev.mit.edu/system/rhlinux
15  syscontrol=control/control-${ver:-current}
16  pwconv=/usr/sbin/pwconv
17
18  mkdir -p "$root/dev"
19  /dev/MAKEDEV -d "$root/dev" std
20
21  cd "$sysprefix"
22  list=`awk '{ x = $2; } END { print x; }' "$syscontrol"`
23  rpms=`awk '/^athena/ { next; } { print $1; }' $list`
24
25  mkdir -p "$root/var/lib/rpm" "$root/etc"
26  touch "$root/etc/fstab"
27  rpm --root "$root" --initdb
28  rpm --root "$root" -ivh $rpms
29
30  # Make links into destination area.
31  ln -s ../build/athtools/usr/athena "$root/usr/athena"
32  ln -s ../build/athtools/usr/afsws "$root/usr/afsws"
33
34  # So packages can figure out where sendmail is.  (sendmail normally
35  # comes from athena-sendmail, which we don't install; this is simpler
36  # than installing either the athena-sendmail or a native sendmail RPM.)
37  touch "$root/usr/sbin/sendmail"
38  chmod a+x "$root/usr/sbin/sendmail"
39  ;;
40
41sun4)
42  pwconv=/usr/sbin/pwconv
43
44  # Install packages.
45  for i in `cat /install/cdrom/install-local-u`; do
46    echo "$i: \c"
47    jot -b y 50 | pkgadd -R "$root" -d /install/cdrom "$i"
48  done 2>/dev/null
49  for i in `cat /install/cdrom/install-nolocal-u`; do
50    echo "$i: \c"
51    jot -b y 50 | pkgadd -R "$root" -d /install/cdrom/cdrom.link "$i"
52  done 2>/dev/null
53  cp /install/cdrom/INST_RELEASE "$root/var/sadm/system/admin"
54
55  # Install patches.
56  jot -b y 50 | patchadd -d -R "$root" -u -M /install/patches/patches.link \
57    `cat /install/patches/current-patches`
58
59  # /usr/lib/isaexec (a front end which selects between the sparcv7 and
60  # sparcv9 versions of a binary) doesn't work in a chrooted environment
61  # (getexecname() fails due to lack of procfs).  The only binary
62  # linked to isaexec relevant to the build system is "sort".  Work
63  # around the problem by copying the sparcv9 "sort" to /usr/bin,
64  # since ensuring that procfs is always mounted in the chroot area is a
65  # little messy.
66  rm -f "$root/usr/bin/sort"
67  cp "$root/usr/bin/sparcv9/sort" "$root/usr/bin/sort"
68
69  # Make devices.
70  cd "$root"
71  drvconfig -r devices -p "$root/etc/path_to_inst"
72  devlinks -t "$root/etc/devlink.tab" -r "$root"
73  disks -r "$root"
74
75  # third/gnome-utils wants to know where to look for log messages.
76  touch "$root/var/adm/messages"
77
78  # Copy the /os symlink.
79  (cd / && tar cf - os) | (cd "$root" && tar xf -)
80
81  # Make links into destination area.
82  ln -s ../.srvd/usr/athena "$root/usr/athena"
83  ln -s ../.srvd/usr/afsws "$root/usr/afsws"
84  ;;
85
86esac
87
88# It's really convenient to have a nice shell in the build root area,
89# at least on Solaris.
90mkdir -p "$root/bin/athena"
91cp /bin/athena/tcsh "$root/bin/athena/tcsh"
92
93# The discuss build needs the discuss user to be in the passwd file.
94grep '^discuss' /etc/passwd >> $root/etc/passwd
95
96# Create the shadow password file, so programs such as passwd get
97# configured properly.
98chroot $root $pwconv
99
100# Prepare the source locker symlinks.
101mkdir -p "$root/mit"
102ln -s /afs/dev.mit.edu/source/src-current $root/mit/source
103if [ -n "$ver" ]; then
104  ln -s /afs/dev.mit.edu/source/src-$ver $root/mit/source-$ver
105fi
Note: See TracBrowser for help on using the repository browser.