annotate root-filesystem.sh @ 1633:a4823c561e28

Patrick Lauer suggested making the smoketest timeout configurable, and default to 3 minutes when FORK=1.
author Rob Landley <rob@landley.net>
date Tue, 15 Oct 2013 22:25:55 -0500
parents f1d2afdf2034
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
177
6b4844b708b9 dash->bash.
Rob Landley <rob@landley.net>
parents: 164
diff changeset
1 #!/bin/bash
43
6d16887ec084 Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff changeset
2
1128
e5f9681a8b3c Lots of comment updates. Add a NO_HOST_TOOLS=1 config option, and a few "time" calls to stages that didn't have them. Put native-compiler.sh after root-filesystem.sh in build so it's slightly easier to document.
Rob Landley <rob@landley.net>
parents: 1116
diff changeset
3 # Combine the output of simple-root-filesystem and native-compiler.
888
626288dd5cf3 Lots of comments.
Rob Landley <rob@landley.net>
parents: 882
diff changeset
4
1116
2b68517f5b62 Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents: 1108
diff changeset
5 . sources/include.sh || exit 1
658
dc5512d734f0 Actually put MANIFEST into mini-native.
Rob Landley <rob@landley.net>
parents: 633
diff changeset
6
1398
b74d36876c0a Replace read_arch_dir with load_target, which understands that sources/targets/$TARGET can be a file or a directory.
Rob Landley <rob@landley.net>
parents: 1336
diff changeset
7 load_target "$1"
944
fc134a13357e Largeish refactoring and cleanup of compiler build:
Rob Landley <rob@landley.net>
parents: 941
diff changeset
8
1401
f1d2afdf2034 Add base_architecture, make base architectures and extra targets work, and move i586 virtio stuff to new i686-kvm target.
Rob Landley <rob@landley.net>
parents: 1398
diff changeset
9 check_for_base_arch || exit 0
f1d2afdf2034 Add base_architecture, make base architectures and extra targets work, and move i586 virtio stuff to new i686-kvm target.
Rob Landley <rob@landley.net>
parents: 1398
diff changeset
10
1116
2b68517f5b62 Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents: 1108
diff changeset
11 [ ! -d "$BUILD/simple-root-filesystem-$ARCH" ] &&
2b68517f5b62 Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents: 1108
diff changeset
12 echo "No $BUILD/simple-root-filesystem-$ARCH" >&2 &&
2b68517f5b62 Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents: 1108
diff changeset
13 exit 1
52
6d6551a37687 Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents: 51
diff changeset
14
1116
2b68517f5b62 Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents: 1108
diff changeset
15 [ ! -d "$BUILD/native-compiler-$ARCH" ] &&
2b68517f5b62 Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents: 1108
diff changeset
16 echo "No $BUILD/native-compiler-$ARCH" >&2 &&
2b68517f5b62 Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents: 1108
diff changeset
17 exit 1
83
8fb80545fe84 Move the "hello world" source into sources/toys. Build (in mini-native)
Rob Landley <rob@landley.net>
parents: 81
diff changeset
18
1336
c7dfe0e54a80 Might as well preserve hard links while assembling root-filsystem. Neither busybox tar nor mksquashfs are currently using them, but maybe someday...
Rob Landley <rob@landley.net>
parents: 1332
diff changeset
19 cp -al "$BUILD/simple-root-filesystem-$ARCH/." "$STAGE_DIR" || dienow
1128
e5f9681a8b3c Lots of comment updates. Add a NO_HOST_TOOLS=1 config option, and a few "time" calls to stages that didn't have them. Put native-compiler.sh after root-filesystem.sh in build so it's slightly easier to document.
Rob Landley <rob@landley.net>
parents: 1116
diff changeset
20
1332
42496ee2815f Fix regression: make #!/bin/sh point to bash instead of busybox shell for dev environment. (Oops.)
Rob Landley <rob@landley.net>
parents: 1198
diff changeset
21 # Remove shared libraries copied from cross compiler, and let /bin/sh point
42496ee2815f Fix regression: make #!/bin/sh point to bash instead of busybox shell for dev environment. (Oops.)
Rob Landley <rob@landley.net>
parents: 1198
diff changeset
22 # to bash out of native compiler instead of busybox shell.
944
fc134a13357e Largeish refactoring and cleanup of compiler build:
Rob Landley <rob@landley.net>
parents: 941
diff changeset
23
1332
42496ee2815f Fix regression: make #!/bin/sh point to bash instead of busybox shell for dev environment. (Oops.)
Rob Landley <rob@landley.net>
parents: 1198
diff changeset
24 rm -rf "$BUILD/root-filesystem-$ARCH/"{usr/lib,bin/sh} 2>/dev/null
944
fc134a13357e Largeish refactoring and cleanup of compiler build:
Rob Landley <rob@landley.net>
parents: 941
diff changeset
25
1116
2b68517f5b62 Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents: 1108
diff changeset
26 # Copy native compiler, but do not overwrite existing files (which could
2b68517f5b62 Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents: 1108
diff changeset
27 # do bad things to busybox).
713
9282f84b31a1 Add NATIVE_TOOLCHAIN=only, to build _just_ the native toolchain (sae set of packages as the cross compiler, only --enable-shared and with uClibc++).
Rob Landley <rob@landley.net>
parents: 711
diff changeset
28
1116
2b68517f5b62 Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents: 1108
diff changeset
29 [ -z "$ROOT_NODIRS" ] && USRDIR="/usr" || USRDIR=""
1336
c7dfe0e54a80 Might as well preserve hard links while assembling root-filsystem. Neither busybox tar nor mksquashfs are currently using them, but maybe someday...
Rob Landley <rob@landley.net>
parents: 1332
diff changeset
30 yes 'n' | cp -ial "$BUILD/native-compiler-$ARCH/." \
1116
2b68517f5b62 Break out simple-root-filesystem.sh and root-filesystem.sh (adding native-compiler.sh output), and use NO_NATIVE_COMPILER to determine which to use. Rename STATIC_CC_HOST to CROSS_HOST_ARCH.
Rob Landley <rob@landley.net>
parents: 1108
diff changeset
31 "$BUILD/root-filesystem-$ARCH$USRDIR" 2>/dev/null || dienow
1135
2b7100b7de0c Remember to make the root-filesystem tarball.
Rob Landley <rob@landley.net>
parents: 1128
diff changeset
32
1198
78e786334c5b Polish the strip logic a bit.
Rob Landley <rob@landley.net>
parents: 1135
diff changeset
33 # Strip everything again, just to be sure.
78e786334c5b Polish the strip logic a bit.
Rob Landley <rob@landley.net>
parents: 1135
diff changeset
34
78e786334c5b Polish the strip logic a bit.
Rob Landley <rob@landley.net>
parents: 1135
diff changeset
35 if [ -z "$SKIP_STRIP" ]
78e786334c5b Polish the strip logic a bit.
Rob Landley <rob@landley.net>
parents: 1135
diff changeset
36 then
78e786334c5b Polish the strip logic a bit.
Rob Landley <rob@landley.net>
parents: 1135
diff changeset
37 "${ARCH}-strip" --strip-unneeded "$STAGE_DIR"/lib/*.so
78e786334c5b Polish the strip logic a bit.
Rob Landley <rob@landley.net>
parents: 1135
diff changeset
38 "${ARCH}-strip" "$STAGE_DIR"/{bin/*,sbin/*}
78e786334c5b Polish the strip logic a bit.
Rob Landley <rob@landley.net>
parents: 1135
diff changeset
39 fi
78e786334c5b Polish the strip logic a bit.
Rob Landley <rob@landley.net>
parents: 1135
diff changeset
40
1135
2b7100b7de0c Remember to make the root-filesystem tarball.
Rob Landley <rob@landley.net>
parents: 1128
diff changeset
41 create_stage_tarball