diff images/hello-world/build.sh @ 0:bcd2e358d57f

Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
author Rob Landley <rob@landley.net>
date Sun, 03 Jul 2011 17:23:26 -0500
parents
children 1a7e1616ab9d
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/images/hello-world/build.sh	Sun Jul 03 17:23:26 2011 -0500
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+# Download all the source tarballs we haven't got up-to-date copies of.
+
+# The tarballs are downloaded into the "packages" directory, which is
+# created as needed.
+
+source sources/include.sh || exit 1
+
+# Set up working directories
+
+WORK="$BUILD/control-images/hello-world"
+blank_tempdir "$WORK"
+
+cat > "$WORK"/init << 'EOF' || dienow
+#!/bin/bash
+
+echo Started second stage init
+
+cd /home &&
+gcc -lpthread /usr/src/thread-hello2.c -o hello &&
+./hello
+
+# Upload our hello world file to the output directory (named hello-$HOST).
+# No reason, just an example.
+
+ftpput $FTP_SERVER -P $FTP_PORT hello-$HOST hello
+
+sync
+
+EOF
+
+chmod +x "$WORK"/init || dienow
+
+cd "$TOP"
+
+mksquashfs "$WORK" "$WORK.hdc" -noappend -all-root