Non-root users cannot chown.
[bootcd.git] / build.sh
index faf52e7..ff4dcfb 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -30,6 +30,7 @@ usage()
     echo "    -c name          (Deprecated) Static configuration to use (default: $CONFIGURATION)"
     echo "    -f planet.cnf    Node to customize CD for (default: none)"
     echo "    -t 'types'       Build the specified images (default: $TYPES)"
+    echo "    -a               Build all supported images"
     echo "    -C custom-dir    Custom directory"
     echo "    -O output-base   The basename of the generated files (default: PLC_NAME-BootCD-VERSION)"
     echo "    -h               This message"
@@ -37,7 +38,7 @@ usage()
 }
 
 # Get options
-while getopts "O:c:f:t:C:h" opt ; do
+while getopts "O:c:f:t:C:ah" opt ; do
     case $opt in
     c)
         CONFIGURATION=$OPTARG
@@ -54,6 +55,9 @@ while getopts "O:c:f:t:C:h" opt ; do
     O)
         OUTPUT_BASE="$OPTARG"
         ;;
+    a)
+        TYPES="usb iso usb_serial iso_serial usb_cramfs iso_cramfs usb_cramfs_serial iso_cramfs_serial"
+        ;;
     h|*)
         usage
         ;;
@@ -121,11 +125,11 @@ echo "* Building images for $FULL_VERSION_STRING"
 # should do is check whether the expected amount of space
 # is available.
 BUILDTMP=/usr/tmp
-if [ -d /data ] ; then
-    isreadonly=$(mktemp /data/isreadonly.XXXXXX || /bin/true)
+if [ -d /data/tmp ] ; then
+    isreadonly=$(mktemp /data/tmp/isreadonly.XXXXXX || /bin/true)
     if [ -n "$isreadonly" ] ; then
         rm -f "$isreadonly"
-        BUILDTMP=/data
+        BUILDTMP=/data/tmp
     fi
 fi
 
@@ -438,8 +442,6 @@ EOF
 
     popd
 
-    chown -R 0.0 $tmp
-
     # create the cramfs image
     echo "* Creating cramfs image"
     mkfs.cramfs $tmp/ ${BUILDTMP}/cramfs.img