Mercurial > hg > aboriginal
comparison run-from-build.sh @ 811:aea72ecff868
Comment tweaks, better document what it's doing.
author | Rob Landley <rob@landley.net> |
---|---|
date | Fri, 21 Aug 2009 23:21:57 -0500 |
parents | 6caf372a8b12 |
children | 4bfe2b34dd9f |
comparison
equal
deleted
inserted
replaced
810:4cfa8c130605 | 811:aea72ecff868 |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Read the configuration files for this target. | |
4 | |
3 source sources/include.sh || exit 1 | 5 source sources/include.sh || exit 1 |
4 | |
5 read_arch_dir "$1" | 6 read_arch_dir "$1" |
6 | 7 |
8 # Fail if this target hasn't been built yet. | |
9 | |
7 SYSDIR="${BUILD}/system-image-$ARCH_NAME" | 10 SYSDIR="${BUILD}/system-image-$ARCH_NAME" |
8 | |
9 if [ ! -f "$SYSDIR/run-emulator.sh" ] | 11 if [ ! -f "$SYSDIR/run-emulator.sh" ] |
10 then | 12 then |
11 [ -z "$FAIL_QUIET" ] && echo "No $SYSDIR/run-emulator.sh" >&2 | 13 [ -z "$FAIL_QUIET" ] && echo "No $SYSDIR/run-emulator.sh" >&2 |
12 exit 1 | 14 exit 1 |
13 fi | 15 fi |
14 | |
15 cd "$SYSDIR" || exit 1 | 16 cd "$SYSDIR" || exit 1 |
16 | 17 |
18 # Should we create a 2 gigabyte /dev/hdb image to provide the emulator with | |
19 # some writable scratch space? (If one already exists, fsck it.) This | |
20 # image (if it exists) will be mounted on /home by the emulated system's | |
21 # init script. | |
22 | |
17 [ -z "$SKIP_HOME" ] && [ -z "$MAKE_HDB" ] && MAKE_HDB="--make-hdb 2048" | 23 [ -z "$SKIP_HOME" ] && [ -z "$MAKE_HDB" ] && MAKE_HDB="--make-hdb 2048" |
18 | |
19 # A little paranoia. | |
20 [ -f "image-${ARCH}.ext2" ] && fsck.ext2 -y "image-${ARCH}.ext2" </dev/null | 24 [ -f "image-${ARCH}.ext2" ] && fsck.ext2 -y "image-${ARCH}.ext2" </dev/null |
21 | 25 |
22 # And run it, using the distccd we built (if necessary) and the cross-compiler. | 26 # Run the emulator, using the distccd we built (if necessary) to dial out |
27 # to the cross-compiler. If emulator is killed, take down distccd processes | |
28 # as well. | |
23 | 29 |
24 trap "killtree $$" EXIT | 30 trap "killtree $$" EXIT |
25 | 31 |
26 ./run-emulator.sh $MAKE_HDB --memory 256 --with-distcc \ | 32 ./run-emulator.sh $MAKE_HDB --memory 256 --with-distcc \ |
27 "${BUILD}/cross-compiler-${ARCH}" | 33 "${BUILD}/cross-compiler-${ARCH}" |