author | Paul Crowley <paul@lshift.net> |
Tue, 01 Dec 2009 15:31:03 +0000 | |
changeset 266 | 7cc208cbf2be |
parent 265 | 6629144cf111 |
child 267 | 4f24892b33fe |
permissions | -rwxr-xr-x |
264
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
1 |
#!/bin/sh |
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
2 |
|
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
3 |
# Must be root to run this |
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
4 |
|
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
5 |
set -e |
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
6 |
|
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
7 |
PRISTINE=/var/local/cache/pristine/sid |
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
8 |
|
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
9 |
TOPDIR=`pwd` |
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
10 |
BACKING=$TOPDIR/build/env/backing |
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
11 |
MOUNT=$TOPDIR/build/env/mount |
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
12 |
mkdir -p $BACKING $MOUNT |
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
13 |
|
265
6629144cf111
More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents:
264
diff
changeset
|
14 |
touch $BACKING/please-trash-this-system |
6629144cf111
More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents:
264
diff
changeset
|
15 |
mkdir -p $BACKING/etc |
266
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
265
diff
changeset
|
16 |
echo "pristine" > $BACKING/etc/debian_chroot |
265
6629144cf111
More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents:
264
diff
changeset
|
17 |
cp -v policy-rc.d $BACKING/etc/policy-rc.d |
264
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
18 |
|
266
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
265
diff
changeset
|
19 |
mkdir -p $BACKING/var/cache/apt/archives |
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
265
diff
changeset
|
20 |
cp -v build/aptcache/* $BACKING/var/cache/apt/archives |
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
265
diff
changeset
|
21 |
|
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
265
diff
changeset
|
22 |
cp -av action $BACKING |
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
265
diff
changeset
|
23 |
#hg -R ../mercurial-server archive -r default $BACKING/action/mercurial-server |
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
265
diff
changeset
|
24 |
( cd ../mercurial-server && \ |
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
265
diff
changeset
|
25 |
hg st -mac0n | cpio -p -0 -d $BACKING/action/mercurial-server ) |
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
265
diff
changeset
|
26 |
|
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
265
diff
changeset
|
27 |
unionfs-fuse -o cow -o allow_other,suid,dev $BACKING=RW:$PRISTINE=RO $MOUNT |
265
6629144cf111
More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents:
264
diff
changeset
|
28 |
|
6629144cf111
More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents:
264
diff
changeset
|
29 |
#mount --bind /dev "$MOUNT/dev" |
6629144cf111
More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents:
264
diff
changeset
|
30 |
#mount --bind /dev/pts "$MOUNT/dev/pts" |
6629144cf111
More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents:
264
diff
changeset
|
31 |
mount -t proc proc $MOUNT/proc |
264
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
32 |
|
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
33 |
chroot $MOUNT ./action/go |
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
34 |
|
265
6629144cf111
More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents:
264
diff
changeset
|
35 |
umount $MOUNT/proc |
264
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
36 |
umount $MOUNT |
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
37 |
|
266
7cc208cbf2be
Runs a real live test of mercurial-server from beginning to end
Paul Crowley <paul@lshift.net>
parents:
265
diff
changeset
|
38 |
#cat $BACKING/action/results |
264
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
39 |
|
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
40 |
rm -rf build/env |
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
41 |