Mercurial > hg > aboriginal
annotate run-from-build.sh @ 772:7cb6ef2cdf10
Busybox unstable currently needs this patch too.
author | Rob Landley <rob@landley.net> |
---|---|
date | Wed, 01 Jul 2009 18:02:44 -0500 |
parents | d0157468f73d |
children | e373d2b6d0b8 |
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 |
669 | 3 source sources/include.sh || exit 1 |
636
d658f28e36ae
Move adding /sbin to $PATH to run-from-build.sh.
Rob Landley <rob@landley.net>
parents:
613
diff
changeset
|
4 |
746
93f2e856357e
Missed a script that needs to call read_arch_dir now.
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
5 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
|
6 |
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
|
7 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
|
8 |
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
|
9 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
|
10 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
|
11 [ -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
|
12 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
|
13 fi |
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 |
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 cd "$SYSDIR" || exit 1 |
446
06a005fcdacc
Teach emulator-build.sh to fsck the root filesystem before running it.
Rob Landley <rob@landley.net>
parents:
356
diff
changeset
|
16 |
06a005fcdacc
Teach emulator-build.sh to fsck the root filesystem before running it.
Rob Landley <rob@landley.net>
parents:
356
diff
changeset
|
17 # A little paranoia. |
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
|
18 [ -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
|
19 |
06a005fcdacc
Teach emulator-build.sh to fsck the root filesystem before running it.
Rob Landley <rob@landley.net>
parents:
356
diff
changeset
|
20 # And run it, using the distccd we built (if necessary) and the cross-compiler. |
06a005fcdacc
Teach emulator-build.sh to fsck the root filesystem before running it.
Rob Landley <rob@landley.net>
parents:
356
diff
changeset
|
21 |
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
|
22 trap "pkill -P$$" EXIT |
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
|
23 |
678
ea25e4da724e
Path cleanup: host-tools.sh should handle this now.
Rob Landley <rob@landley.net>
parents:
669
diff
changeset
|
24 ./run-emulator.sh --make-hdb 2048 --memory 256 --with-distcc \ |
ea25e4da724e
Path cleanup: host-tools.sh should handle this now.
Rob Landley <rob@landley.net>
parents:
669
diff
changeset
|
25 "${BUILD}/cross-compiler-${ARCH}" |