syslinux is no longer included. Use the system version, which uses mtools.
[bootcd.git] / build.sh
index c986d81..7964a1d 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
         ;;
@@ -151,9 +155,10 @@ trap "do_cleanup" ERR INT EXIT
 BUILDTMP=$(mktemp -d ${BUILDTMP}/bootcd.XXXXXX)
 push_cleanup rm -fr "${BUILDTMP}"
 mkdir "${BUILDTMP}/isofs"
-for i in "$isofs"/{bootcd.img,kernel,isolinux.bin}; do
+for i in "$isofs"/{bootcd.img,kernel}; do
     ln -s "$i" "${BUILDTMP}/isofs"
 done
+cp "$isofs/isolinux.bin" "${BUILDTMP}/isofs"
 isofs="${BUILDTMP}/isofs"
 
 # Root of the ISO and USB images
@@ -319,7 +324,7 @@ EOF
     rm -f "$tmp"
 
     echo "making USB image bootable."
-    $srcdir/syslinux/unix/syslinux "$usb"
+    syslinux "$usb"
 }
 
 
@@ -438,8 +443,6 @@ EOF
 
     popd
 
-    chown -R 0.0 $tmp
-
     # create the cramfs image
     echo "* Creating cramfs image"
     mkfs.cramfs $tmp/ ${BUILDTMP}/cramfs.img
@@ -506,11 +509,11 @@ DISPLAY pl_version
 PROMPT 0
 TIMEOUT 40
 EOF
-  mcopy -bsQ -i "$usb" "$tmp" ::/syslinux.cfg
-  rm -f "$tmp"
+    mcopy -bsQ -i "$usb" "$tmp" ::/syslinux.cfg
+    rm -f "$tmp"
 
-  echo "* Making USB CRAMFS based image bootable"
-  $srcdir/syslinux/unix/syslinux "$usb"
+    echo "* Making USB CRAMFS based image bootable"
+    syslinux "$usb"
 }
 
 function type_to_name()