source: trunk/debathena/config/athena-chroot/installer/install @ 22908

Revision 22908, 2.4 KB checked in by tabbott, 16 years ago (diff)
debathena-athena-chroot: various bugfixes * debian/lastlog.debathena: Add -- to command line. * installer/install: Setup NSS in chroot sloppily. * schroot/exec.d: Remove passwd file copying code. * schroot/schroot.conf.debathena: set personality to linux32.
  • Property svn:executable set to *
RevLine 
[22901]1#!/bin/sh
2set -e
3
4sysimage=/srv/chroot/athena
5
6export SYSTEM=/afs/athena.mit.edu/system/rhlinux
7export CONTROL=control/control-current
8export IPADDR=127.0.0.1
9
10tmpdir=$(mktemp -td)
11chroot="$tmpdir/chroot"
12
13maybe_umount ()
14{
15    grep -q "^[^ ]* $1 " /proc/mounts || return 0
16    umount "$@"
17}
18
19maybe_umount "$chroot/sysimage/proc"
20maybe_umount "$chroot/sysimage"
21maybe_umount "$chroot/mnt/runtime"
22maybe_umount "$chroot/tmp/ramfs"
23maybe_umount "$chroot/tmp"
24maybe_umount "$chroot/dev/pts"
25maybe_umount "$chroot/proc"
26maybe_umount "$chroot/sys"
27maybe_umount "$chroot/afs"
28maybe_umount "$chroot"
29
30rm -rf "$tmpdir"
31mkdir -p "$tmpdir"
32
33mcopy -i /mit/bootkit/rhlinux/athena.img ::/initrd.img "$tmpdir/initrd.img.gz"
34gunzip "$tmpdir/initrd.img.gz"
35mkdir "$chroot"
36mount -t ext2 -o rw,loop "$tmpdir/initrd.img" "$chroot"
37
38mount -t ramfs none "$chroot/tmp"
39mkdir "$chroot/tmp/ramfs"
40mount -t ramfs none "$chroot/tmp/ramfs"
41wget -N http://tae-kwon-leap.mit.edu/linux/rhlinux5a.img -O "$chroot/tmp/ramfs/rhlinux5a.img"
42mkdir -p "$chroot/mnt/runtime"
43mount -t cramfs -o ro,loop "$chroot/tmp/ramfs/rhlinux5a.img" "$chroot/mnt/runtime"
44
45mount -t proc proc "$chroot/proc"
46mount -t devpts devpts "$chroot/dev/pts"
47
48ln -s mnt/runtime/lib mnt/runtime/usr "$chroot/"
49mkdir "$chroot/afs"
50mount --bind /afs "$chroot/afs"
51
52mkdir -p "$sysimage"
53mkdir "$chroot/sysimage"
54mount --bind "$sysimage" "$chroot/sysimage"
55
56mkdir -p "$chroot/sys"
57mount -t sysfs sysfs "$chroot/sys"
58mkdir -p "$sysimage/etc" "$chroot/etc"
59cp -a /etc/fstab "$chroot/etc"
60cp -a /etc/fstab "$sysimage/etc"
61
62cp -a /usr/share/debathena-athena-chroot/installer/phase2.debathena "$chroot"
63cp -a /usr/share/debathena-athena-chroot/installer/phase2.backend.debathena "$chroot"
64chroot "$chroot" /phase2.debathena
65mkdir -p "$sysimage/dev/pts"
66mkdir -p "$sysimage/dev/shm"
[22908]67# setup Athena machine to use NSS for naming information
68# This code currently is an awful hack that assumes a 32-bit host.
69cp -a /etc/hesiod.conf "$sysimage/etc"
70cp -a /etc/nsswitch.conf.debathena "$sysimage/etc/nsswitch.conf"
71cp -a /lib/libnss_nonlocal* "$sysimage/lib"
72cp -a /lib/libnss_afspag* "$sysimage/lib"
[22901]73
74maybe_umount "$chroot/sysimage/proc"
75maybe_umount "$chroot/sysimage"
76maybe_umount "$chroot/mnt/runtime"
77maybe_umount "$chroot/tmp/ramfs"
78maybe_umount "$chroot/tmp"
79maybe_umount "$chroot/dev/pts"
80maybe_umount "$chroot/proc"
81maybe_umount "$chroot/sys"
82maybe_umount "$chroot/afs"
83maybe_umount "$chroot"
Note: See TracBrowser for help on using the repository browser.