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

Revision 22901, 2.1 KB checked in by tabbott, 16 years ago (diff)
Initial checkin of Athena 9.4 chroot packages. Note that these packages require you to backport schroot 1.1.6
  • Property svn:executable set to *
Line 
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"
67
68maybe_umount "$chroot/sysimage/proc"
69maybe_umount "$chroot/sysimage"
70maybe_umount "$chroot/mnt/runtime"
71maybe_umount "$chroot/tmp/ramfs"
72maybe_umount "$chroot/tmp"
73maybe_umount "$chroot/dev/pts"
74maybe_umount "$chroot/proc"
75maybe_umount "$chroot/sys"
76maybe_umount "$chroot/afs"
77maybe_umount "$chroot"
Note: See TracBrowser for help on using the repository browser.