author | Paul Crowley <paul@lshift.net> |
Tue, 01 Dec 2009 12:37:20 +0000 | |
changeset 265 | 6629144cf111 |
parent 264 | cd7f901d3902 |
child 266 | 7cc208cbf2be |
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 |
264
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
15 |
cp -av action $BACKING |
265
6629144cf111
More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents:
264
diff
changeset
|
16 |
mkdir -p $BACKING/etc |
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 |
|
265
6629144cf111
More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents:
264
diff
changeset
|
19 |
unionfs-fuse -o cow -o allow_root,suid,dev $BACKING=RW:$PRISTINE=RO $MOUNT |
6629144cf111
More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents:
264
diff
changeset
|
20 |
|
6629144cf111
More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents:
264
diff
changeset
|
21 |
#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
|
22 |
#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
|
23 |
mount -t proc proc $MOUNT/proc |
264
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
24 |
|
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
25 |
chroot $MOUNT ./action/go |
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
26 |
cd $TOPDIR |
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
27 |
|
265
6629144cf111
More complete test - inhibit daemons, mount proc, add safety guard
Paul Crowley <paul@lshift.net>
parents:
264
diff
changeset
|
28 |
umount $MOUNT/proc |
264
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
29 |
umount $MOUNT |
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
30 |
|
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
31 |
cat $BACKING/action/results |
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 |
rm -rf build/env |
cd7f901d3902
Do something with unionfs - it works
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
34 |