# HG changeset patch # User Rob Landley # Date 1301861111 18000 # Node ID 214b23b707b0865231a9a3d48ae6019b9f0ba575 # Parent 08134b65336e1844df4bbb06665b932a64fa3e29 Factor out make-hdb.sh from dev-environment.sh. diff -r 08134b65336e -r 214b23b707b0 sources/toys/dev-environment.sh --- 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 diff -r 08134b65336e -r 214b23b707b0 sources/toys/make-hdb.sh --- /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 +}