changeset 1343:214b23b707b0

Factor out make-hdb.sh from dev-environment.sh.
author Rob Landley <rob@landley.net>
date Sun, 03 Apr 2011 15:05:11 -0500
parents 08134b65336e
children 6a04a89a0d19
files sources/toys/dev-environment.sh sources/toys/make-hdb.sh
diffstat 2 files changed, 16 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/sources/toys/dev-environment.sh	Sun Apr 03 15:03:33 2011 -0500
+++ b/sources/toys/dev-environment.sh	Sun Apr 03 15:05:11 2011 -0500
@@ -14,6 +14,7 @@
 # in the $PATH.
 
 INCLUDE unique-port.sh
+INCLUDE make-hdb.sh
 
 source ./run-emulator.sh --norun || exit 1
 
@@ -33,17 +34,7 @@
 
     [ -z "$HDBMEGS" ] && HDBMEGS=2048
 
-    # Some distros don't put /sbin:/usr/sbin in the $PATH for non-root users.
-    if [ -z "$(which  mke2fs)" ] || [ -z "$(which tune2fs)" ]
-    then
-      export PATH=/sbin:/usr/bin:$PATH
-    fi
-
-    dd if=/dev/zero of="$HDB" bs=1024 seek=$[$HDBMEGS*1024-1] count=1 &&
-    mke2fs -q -b 1024 -F "$HDB" -i 4096 &&
-    tune2fs -j -c 0 -i 0 "$HDB"
-
-    [ $? -ne 0 ] && exit 1
+    make_hdb
   fi
 fi
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/toys/make-hdb.sh	Sun Apr 03 15:05:11 2011 -0500
@@ -0,0 +1,14 @@
+make_hdb()
+{
+  # Some distros don't put /sbin:/usr/sbin in the $PATH for non-root users.
+  if [ -z "$(which  mke2fs)" ] || [ -z "$(which tune2fs)" ]
+  then
+    export PATH=/sbin:/usr/bin:$PATH
+  fi
+
+  dd if=/dev/zero of="$HDB" bs=1024 seek=$[$HDBMEGS*1024-1] count=1 &&
+  mke2fs -q -b 1024 -F "$HDB" -i 4096 &&
+  tune2fs -j -c 0 -i 0 "$HDB"
+
+  [ $? -ne 0 ] && exit 1
+}