Mercurial > hg > aboriginal
annotate root-filesystem.sh @ 1336:c7dfe0e54a80
Might as well preserve hard links while assembling root-filsystem. Neither busybox tar nor mksquashfs are currently using them, but maybe someday...
author | Rob Landley <rob@landley.net> |
---|---|
date | Fri, 18 Mar 2011 19:28:50 -0500 |
parents | 42496ee2815f |
children | b74d36876c0a |
rev | line source |
---|---|
177 | 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 | 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 |
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
|
7 read_arch_dir "$1" |
944
fc134a13357e
Largeish refactoring and cleanup of compiler build:
Rob Landley <rob@landley.net>
parents:
941
diff
changeset
|
8 |
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
|
9 [ ! -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
|
10 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
|
11 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
|
12 |
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
|
13 [ ! -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
|
14 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
|
15 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
|
16 |
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
|
17 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
|
18 |
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
|
19 # 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
|
20 # 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
|
21 |
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
|
22 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
|
23 |
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
|
24 # 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
|
25 # 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
|
26 |
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
|
27 [ -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
|
28 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
|
29 "$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
|
30 |
1198
78e786334c5b
Polish the strip logic a bit.
Rob Landley <rob@landley.net>
parents:
1135
diff
changeset
|
31 # Strip everything again, just to be sure. |
78e786334c5b
Polish the strip logic a bit.
Rob Landley <rob@landley.net>
parents:
1135
diff
changeset
|
32 |
78e786334c5b
Polish the strip logic a bit.
Rob Landley <rob@landley.net>
parents:
1135
diff
changeset
|
33 if [ -z "$SKIP_STRIP" ] |
78e786334c5b
Polish the strip logic a bit.
Rob Landley <rob@landley.net>
parents:
1135
diff
changeset
|
34 then |
78e786334c5b
Polish the strip logic a bit.
Rob Landley <rob@landley.net>
parents:
1135
diff
changeset
|
35 "${ARCH}-strip" --strip-unneeded "$STAGE_DIR"/lib/*.so |
78e786334c5b
Polish the strip logic a bit.
Rob Landley <rob@landley.net>
parents:
1135
diff
changeset
|
36 "${ARCH}-strip" "$STAGE_DIR"/{bin/*,sbin/*} |
78e786334c5b
Polish the strip logic a bit.
Rob Landley <rob@landley.net>
parents:
1135
diff
changeset
|
37 fi |
78e786334c5b
Polish the strip logic a bit.
Rob Landley <rob@landley.net>
parents:
1135
diff
changeset
|
38 |
1135
2b7100b7de0c
Remember to make the root-filesystem tarball.
Rob Landley <rob@landley.net>
parents:
1128
diff
changeset
|
39 create_stage_tarball |