changeset 1280:35dc1da8988c

Change control image scripts so they always build in build/control-images, and put the extracted and archived (squashfs) versions in the same directory the way the other build scripts do. Also use utility_functions.sh as appropriate.
author Rob Landley <rob@landley.net>
date Mon, 08 Nov 2010 21:24:58 -0600
parents 8c0b1c9b6525
children 720b109bc978
files more/build-control-images.sh sources/control-images/bootstrap-skeleton/control-image-wrapper.sh sources/control-images/busybox-test.sh sources/control-images/hello-world.sh sources/control-images/static-tools.sh
diffstat 5 files changed, 7 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/more/build-control-images.sh	Mon Nov 08 21:07:36 2010 -0600
+++ b/more/build-control-images.sh	Mon Nov 08 21:24:58 2010 -0600
@@ -2,7 +2,7 @@
 
 # Build all control images (for native-build.sh) in build/control-images.
 
-. sources/include.sh || exit 1
+. sources/utility_functions.sh || exit 1
 
 blank_tempdir build/control-images
 
@@ -11,8 +11,7 @@
 
 for i in sources/control-images/{*.sh,*/make-control-image.sh}
 do
-  SCRIPTNAME=$(echo $i | sed 's@sources/control-images/\([^./]*\).*@\1@')
+  $i | maybe_quiet
   # Forking doesn't work yet due to extract collisions with the same package
-  #maybe_fork "$i build/control-images/$SCRIPTNAME.hdc | maybe_quiet"
-  $i build/control-images/$SCRIPTNAME.hdc | maybe_quiet
+  #maybe_fork "$i | maybe_quiet"
 done
--- a/sources/control-images/bootstrap-skeleton/control-image-wrapper.sh	Mon Nov 08 21:07:36 2010 -0600
+++ b/sources/control-images/bootstrap-skeleton/control-image-wrapper.sh	Mon Nov 08 21:24:58 2010 -0600
@@ -4,12 +4,6 @@
 
 source sources/include.sh || exit 1
 
-# Did caller specify the name of a control image to generate?  Explicit
-# /dev/null means none.
-
-[ $# -ne 1 ] && echo "usage: $0 FILENAME" >&2 && exit 1
-[ "$1" != "/dev/null" ] && [ -e "$1" ] && echo "$1" exists && exit 0
-
 # Find path to our working directory.
 
 MYDIR="$(readlink -f "$(dirname "$(which "$0")")")"
@@ -50,8 +44,4 @@
 
 # Create sqaushfs image
 
-if [ "$1" != "/dev/null" ]
-then
-  cd "$TOP" &&
-  mksquashfs "$WORK" "$1" -noappend -all-root || dienow
-fi
+mksquashfs "$WORK" "$WORK.hdc" -noappend -all-root || dienow
--- a/sources/control-images/busybox-test.sh	Mon Nov 08 21:07:36 2010 -0600
+++ b/sources/control-images/busybox-test.sh	Mon Nov 08 21:24:58 2010 -0600
@@ -4,9 +4,6 @@
 
 source sources/include.sh || exit 1
 
-[ $# -ne 1 ] && echo "usage: $0 FILENAME" >&2 && exit 1
-[ -e "$1" ] && echo "$1" exists && exit 0
-
 WORK="$BUILD/control-images/busybox-test" && blank_tempdir "$WORK"
 
 # Don't download busybox, it's got to already be there in standard sources.
@@ -33,4 +30,4 @@
 
 chmod +x "$WORK"/init || dienow
 
-mksquashfs "$WORK" "$1" -noappend -all-root
+mksquashfs "$WORK" "$WORK.hdc" -noappend -all-root
--- a/sources/control-images/hello-world.sh	Mon Nov 08 21:07:36 2010 -0600
+++ b/sources/control-images/hello-world.sh	Mon Nov 08 21:24:58 2010 -0600
@@ -7,9 +7,6 @@
 
 source sources/include.sh || exit 1
 
-[ $# -ne 1 ] && echo "usage: $0 FILENAME" >&2 && exit 1
-[ -e "$1" ] && echo "$1 exists" && exit 0
-
 # Set up working directories
 
 WORK="$BUILD/control-images/hello-world"
@@ -37,4 +34,4 @@
 
 cd "$TOP"
 
-mksquashfs "$WORK" "$1" -noappend -all-root
+mksquashfs "$WORK" "$WORK.hdc" -noappend -all-root
--- a/sources/control-images/static-tools.sh	Mon Nov 08 21:07:36 2010 -0600
+++ b/sources/control-images/static-tools.sh	Mon Nov 08 21:24:58 2010 -0600
@@ -7,9 +7,6 @@
 
 source sources/include.sh || exit 1
 
-[ $# -ne 1 ] && echo "usage: $0 FILENAME" >&2 && exit 1
-[ -e "$1" ] && echo "$1" exists && exit 0
-
 PATCHDIR="$SOURCES/native-builds/static-tools-patches"
 SRCDIR="$SRCDIR/native" && mkdir -p "$SRCDIR" || dienow
 WORK="$BUILD/control-images/static-tools" && blank_tempdir "$WORK"
@@ -90,4 +87,4 @@
 
 cd "$TOP"
 
-mksquashfs "$WORK" "$1" -noappend -all-root
+mksquashfs "$WORK" "$WORK.hdc" -noappend -all-root