annotate sources/native-builds/hello-world.sh @ 1274:b41dbea3ba14

When building control images, the working directory should be in build/control-images.
author Rob Landley <rob@landley.net>
date Sun, 07 Nov 2010 15:54:37 -0600
parents 6b20e20bb291
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1009
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
1 #!/bin/bash
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
2
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
3 # Download all the source tarballs we haven't got up-to-date copies of.
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
4
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
5 # The tarballs are downloaded into the "packages" directory, which is
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
6 # created as needed.
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
7
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
8 source sources/include.sh || exit 1
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
9
1052
1ddd199ba25f Update hello world example native build.
Rob Landley <rob@landley.net>
parents: 1009
diff changeset
10 [ $# -ne 1 ] && echo "usage: $0 FILENAME" >&2 && exit 1
1ddd199ba25f Update hello world example native build.
Rob Landley <rob@landley.net>
parents: 1009
diff changeset
11 [ -e "$1" ] && echo "$1 exists" && exit 0
1009
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
12
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
13 # Set up working directories
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
14
1274
b41dbea3ba14 When building control images, the working directory should be in build/control-images.
Rob Landley <rob@landley.net>
parents: 1111
diff changeset
15 WORK="$BUILD/control-images/hello-world"
1009
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
16 blank_tempdir "$WORK"
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
17
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
18 cat > "$WORK"/init << 'EOF' || dienow
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
19 #!/bin/bash
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
20
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
21 echo Started second stage init
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
22
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
23 cd /home &&
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
24 gcc -lpthread /usr/src/thread-hello2.c -o hello &&
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
25 ./hello
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
26
1075
0fe8eda4f002 Teach hello world native build to honor $FTP_SERVER
Rob Landley <rob@landley.net>
parents: 1052
diff changeset
27 # Upload our hello world file to the output directory (named hello-$HOST).
1052
1ddd199ba25f Update hello world example native build.
Rob Landley <rob@landley.net>
parents: 1009
diff changeset
28 # No reason, just an example.
1ddd199ba25f Update hello world example native build.
Rob Landley <rob@landley.net>
parents: 1009
diff changeset
29
1075
0fe8eda4f002 Teach hello world native build to honor $FTP_SERVER
Rob Landley <rob@landley.net>
parents: 1052
diff changeset
30 ftpput $FTP_SERVER -P $FTP_PORT hello-$HOST hello
1052
1ddd199ba25f Update hello world example native build.
Rob Landley <rob@landley.net>
parents: 1009
diff changeset
31
1009
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
32 sync
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
33
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
34 EOF
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
35
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
36 chmod +x "$WORK"/init || dienow
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
37
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
38 cd "$TOP"
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
39
6762d6b8d5fc Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it.
Rob Landley <rob@landley.net>
parents:
diff changeset
40 mksquashfs "$WORK" "$1" -noappend -all-root