|
From: <abe...@us...> - 2012-03-01 20:07:01
|
Revision: 5474
http://astlinux.svn.sourceforge.net/astlinux/?rev=5474&view=rev
Author: abelbeck
Date: 2012-03-01 20:06:55 +0000 (Thu, 01 Mar 2012)
Log Message:
-----------
astlinux-makeimage, add REQUIRED_CMDS check
Modified Paths:
--------------
branches/1.0/scripts/astlinux-makeimage
Modified: branches/1.0/scripts/astlinux-makeimage
===================================================================
--- branches/1.0/scripts/astlinux-makeimage 2012-03-01 14:58:13 UTC (rev 5473)
+++ branches/1.0/scripts/astlinux-makeimage 2012-03-01 20:06:55 UTC (rev 5474)
@@ -2,11 +2,13 @@
#
# astlinux-makeimage [imagesize in MB] [dos partition size in MB] [ASTURW partition size in MB]
#
-# astlinux-makeimage -z 128 128 0
+# astlinux-makeimage -z 256 256 0
#
PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin
+REQUIRED_CMDS="which sudo mkdosfs mkfs fdisk losetup gzip"
+
RUNNIX_VER="$(awk -F'=' '/^RUNNIX_VER/ { print $2; exit }' boot/runnix/runnix.mk)"
RUNNIX_DIR="output/build/runnix-${RUNNIX_VER// /}"
@@ -57,6 +59,21 @@
exit 1
fi
+error=0
+for i in $REQUIRED_CMDS; do
+ if ! which $i >/dev/null 2>&1; then
+ error=1
+ echo "astlinux-makeimage: Required command \"$i\" is missing in your build environment." >&2
+ if [ "$i" = "which" ]; then # no use proceeding
+ break
+ fi
+ fi
+done
+if [ $error -ne 0 ]; then
+ echo "Missing Required Command(s)." >&2
+ exit 1
+fi
+
DISK_SIZE=$1
DOS_SIZE=$2
AST_SIZE=$3
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|