Mercurial > hg > aboriginal
annotate 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 |
rev | line source |
---|---|
333
77c10235464d
Simple script to run mini-native under its emulator, with distcc hooked
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
1 #!/bin/bash |
77c10235464d
Simple script to run mini-native under its emulator, with distcc hooked
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
2 |
811
aea72ecff868
Comment tweaks, better document what it's doing.
Rob Landley <rob@landley.net>
parents:
779
diff
changeset
|
3 # Read the configuration files for this target. |
aea72ecff868
Comment tweaks, better document what it's doing.
Rob Landley <rob@landley.net>
parents:
779
diff
changeset
|
4 |
669 | 5 source sources/include.sh || exit 1 |
746
93f2e856357e
Missed a script that needs to call read_arch_dir now.
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
6 read_arch_dir "$1" |
93f2e856357e
Missed a script that needs to call read_arch_dir now.
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
7 |
811
aea72ecff868
Comment tweaks, better document what it's doing.
Rob Landley <rob@landley.net>
parents:
779
diff
changeset
|
8 # Fail if this target hasn't been built yet. |
aea72ecff868
Comment tweaks, better document what it's doing.
Rob Landley <rob@landley.net>
parents:
779
diff
changeset
|
9 |
744
759adf5a0fe9
Refactor so include.sh mostly just sets environment variables. Move read_arch_dir to function and call it explicitly (no more need for $NO_ARCH). Make blank_tempdir a function, called explicitly by stages when needed, with some sanity checks. Insert prerequisite tests to later stages so they can detect failure early and provide an explicit erro rmessage, and have those tests happen before blanking $WORK dir, to preserve debugging info. Make buildall.sh depend on prerequisite tests rather than trying to avoid calling later stages (and thus do flow control from asynchronous context). Add FAIL_QUIET option so buildall.sh doesn't spam the log with the new prerequisite error messages.
Rob Landley <rob@landley.net>
parents:
678
diff
changeset
|
10 SYSDIR="${BUILD}/system-image-$ARCH_NAME" |
759adf5a0fe9
Refactor so include.sh mostly just sets environment variables. Move read_arch_dir to function and call it explicitly (no more need for $NO_ARCH). Make blank_tempdir a function, called explicitly by stages when needed, with some sanity checks. Insert prerequisite tests to later stages so they can detect failure early and provide an explicit erro rmessage, and have those tests happen before blanking $WORK dir, to preserve debugging info. Make buildall.sh depend on prerequisite tests rather than trying to avoid calling later stages (and thus do flow control from asynchronous context). Add FAIL_QUIET option so buildall.sh doesn't spam the log with the new prerequisite error messages.
Rob Landley <rob@landley.net>
parents:
678
diff
changeset
|
11 if [ ! -f "$SYSDIR/run-emulator.sh" ] |
759adf5a0fe9
Refactor so include.sh mostly just sets environment variables. Move read_arch_dir to function and call it explicitly (no more need for $NO_ARCH). Make blank_tempdir a function, called explicitly by stages when needed, with some sanity checks. Insert prerequisite tests to later stages so they can detect failure early and provide an explicit erro rmessage, and have those tests happen before blanking $WORK dir, to preserve debugging info. Make buildall.sh depend on prerequisite tests rather than trying to avoid calling later stages (and thus do flow control from asynchronous context). Add FAIL_QUIET option so buildall.sh doesn't spam the log with the new prerequisite error messages.
Rob Landley <rob@landley.net>
parents:
678
diff
changeset
|
12 then |
759adf5a0fe9
Refactor so include.sh mostly just sets environment variables. Move read_arch_dir to function and call it explicitly (no more need for $NO_ARCH). Make blank_tempdir a function, called explicitly by stages when needed, with some sanity checks. Insert prerequisite tests to later stages so they can detect failure early and provide an explicit erro rmessage, and have those tests happen before blanking $WORK dir, to preserve debugging info. Make buildall.sh depend on prerequisite tests rather than trying to avoid calling later stages (and thus do flow control from asynchronous context). Add FAIL_QUIET option so buildall.sh doesn't spam the log with the new prerequisite error messages.
Rob Landley <rob@landley.net>
parents:
678
diff
changeset
|
13 [ -z "$FAIL_QUIET" ] && echo "No $SYSDIR/run-emulator.sh" >&2 |
759adf5a0fe9
Refactor so include.sh mostly just sets environment variables. Move read_arch_dir to function and call it explicitly (no more need for $NO_ARCH). Make blank_tempdir a function, called explicitly by stages when needed, with some sanity checks. Insert prerequisite tests to later stages so they can detect failure early and provide an explicit erro rmessage, and have those tests happen before blanking $WORK dir, to preserve debugging info. Make buildall.sh depend on prerequisite tests rather than trying to avoid calling later stages (and thus do flow control from asynchronous context). Add FAIL_QUIET option so buildall.sh doesn't spam the log with the new prerequisite error messages.
Rob Landley <rob@landley.net>
parents:
678
diff
changeset
|
14 exit 1 |
759adf5a0fe9
Refactor so include.sh mostly just sets environment variables. Move read_arch_dir to function and call it explicitly (no more need for $NO_ARCH). Make blank_tempdir a function, called explicitly by stages when needed, with some sanity checks. Insert prerequisite tests to later stages so they can detect failure early and provide an explicit erro rmessage, and have those tests happen before blanking $WORK dir, to preserve debugging info. Make buildall.sh depend on prerequisite tests rather than trying to avoid calling later stages (and thus do flow control from asynchronous context). Add FAIL_QUIET option so buildall.sh doesn't spam the log with the new prerequisite error messages.
Rob Landley <rob@landley.net>
parents:
678
diff
changeset
|
15 fi |
811
aea72ecff868
Comment tweaks, better document what it's doing.
Rob Landley <rob@landley.net>
parents:
779
diff
changeset
|
16 cd "$SYSDIR" || exit 1 |
744
759adf5a0fe9
Refactor so include.sh mostly just sets environment variables. Move read_arch_dir to function and call it explicitly (no more need for $NO_ARCH). Make blank_tempdir a function, called explicitly by stages when needed, with some sanity checks. Insert prerequisite tests to later stages so they can detect failure early and provide an explicit erro rmessage, and have those tests happen before blanking $WORK dir, to preserve debugging info. Make buildall.sh depend on prerequisite tests rather than trying to avoid calling later stages (and thus do flow control from asynchronous context). Add FAIL_QUIET option so buildall.sh doesn't spam the log with the new prerequisite error messages.
Rob Landley <rob@landley.net>
parents:
678
diff
changeset
|
17 |
811
aea72ecff868
Comment tweaks, better document what it's doing.
Rob Landley <rob@landley.net>
parents:
779
diff
changeset
|
18 # Should we create a 2 gigabyte /dev/hdb image to provide the emulator with |
aea72ecff868
Comment tweaks, better document what it's doing.
Rob Landley <rob@landley.net>
parents:
779
diff
changeset
|
19 # some writable scratch space? (If one already exists, fsck it.) This |
aea72ecff868
Comment tweaks, better document what it's doing.
Rob Landley <rob@landley.net>
parents:
779
diff
changeset
|
20 # image (if it exists) will be mounted on /home by the emulated system's |
aea72ecff868
Comment tweaks, better document what it's doing.
Rob Landley <rob@landley.net>
parents:
779
diff
changeset
|
21 # init script. |
446
06a005fcdacc
Teach emulator-build.sh to fsck the root filesystem before running it.
Rob Landley <rob@landley.net>
parents:
356
diff
changeset
|
22 |
779
6caf372a8b12
Teach smoketest to skip creation of hdb for /home when not needed.
Rob Landley <rob@landley.net>
parents:
778
diff
changeset
|
23 [ -z "$SKIP_HOME" ] && [ -z "$MAKE_HDB" ] && MAKE_HDB="--make-hdb 2048" |
590
8e7db79a3d75
Make initramfs work, add "--memory MEGS" option to ./run-emulator.sh and make run-from-build.sh use it.
Rob Landley <rob@landley.net>
parents:
585
diff
changeset
|
24 [ -f "image-${ARCH}.ext2" ] && fsck.ext2 -y "image-${ARCH}.ext2" </dev/null |
446
06a005fcdacc
Teach emulator-build.sh to fsck the root filesystem before running it.
Rob Landley <rob@landley.net>
parents:
356
diff
changeset
|
25 |
811
aea72ecff868
Comment tweaks, better document what it's doing.
Rob Landley <rob@landley.net>
parents:
779
diff
changeset
|
26 # Run the emulator, using the distccd we built (if necessary) to dial out |
aea72ecff868
Comment tweaks, better document what it's doing.
Rob Landley <rob@landley.net>
parents:
779
diff
changeset
|
27 # to the cross-compiler. If emulator is killed, take down distccd processes |
aea72ecff868
Comment tweaks, better document what it's doing.
Rob Landley <rob@landley.net>
parents:
779
diff
changeset
|
28 # as well. |
446
06a005fcdacc
Teach emulator-build.sh to fsck the root filesystem before running it.
Rob Landley <rob@landley.net>
parents:
356
diff
changeset
|
29 |
778
e373d2b6d0b8
Add killtree and make stuff use it. Update smoketest-all.sh to use doforklog, allowing FORK=1 to run stuff in parallel.
Rob Landley <rob@landley.net>
parents:
751
diff
changeset
|
30 trap "killtree $$" EXIT |
751
d0157468f73d
Prevent smoketest-all.sh from hanging if an individual smoketest.sh doesn't exit properly.
Rob Landley <rob@landley.net>
parents:
746
diff
changeset
|
31 |
779
6caf372a8b12
Teach smoketest to skip creation of hdb for /home when not needed.
Rob Landley <rob@landley.net>
parents:
778
diff
changeset
|
32 ./run-emulator.sh $MAKE_HDB --memory 256 --with-distcc \ |
678
ea25e4da724e
Path cleanup: host-tools.sh should handle this now.
Rob Landley <rob@landley.net>
parents:
669
diff
changeset
|
33 "${BUILD}/cross-compiler-${ARCH}" |