annotate images/hello-world/build.sh @ 40:ef471ef37665 draft default tip

Yank reliance on ash.
author Rob Landley <rob@landley.net>
date Sat, 18 Jul 2015 01:39:24 -0500
parents 242a1e03ce15
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
1 #!/bin/bash
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
2
2
1a7e1616ab9d Convert builds to use the new layout.
Rob Landley <rob@landley.net>
parents: 0
diff changeset
3 # Simple self-contained build control image creation script. Doesn't use
1a7e1616ab9d Convert builds to use the new layout.
Rob Landley <rob@landley.net>
parents: 0
diff changeset
4 # the bootstrap skeleton, instead compiles and runs the threaded "hello world"
1a7e1616ab9d Convert builds to use the new layout.
Rob Landley <rob@landley.net>
parents: 0
diff changeset
5 # program from the Aboriginal Linux /usr/src directory as a build environment
1a7e1616ab9d Convert builds to use the new layout.
Rob Landley <rob@landley.net>
parents: 0
diff changeset
6 # smoketest. Grep the output for "Hello world!" to test for success.
1a7e1616ab9d Convert builds to use the new layout.
Rob Landley <rob@landley.net>
parents: 0
diff changeset
7
1a7e1616ab9d Convert builds to use the new layout.
Rob Landley <rob@landley.net>
parents: 0
diff changeset
8 # Write init script via a "here" document.
0
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
9
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
10 cat > "$WORK"/init << 'EOF' || dienow
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
11 #!/bin/bash
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
12
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
13 echo Started second stage init
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
14
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
15 cd /home &&
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
16 gcc -lpthread /usr/src/thread-hello2.c -o hello &&
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
17 ./hello
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
18
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
19 # Upload our hello world file to the output directory (named hello-$HOST).
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
20 # No reason, just an example.
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
21
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
22 ftpput $FTP_SERVER -P $FTP_PORT hello-$HOST hello
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
23
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
24 sync
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
25
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
26 EOF
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
27
bcd2e358d57f Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff changeset
28 chmod +x "$WORK"/init || dienow