genfio: Splitting gen_template in 2 parts
[fio.git] / tools / genfio
index 6d3220daf1a4d93568a20f5950272a8f1198ac37..3f9ab283840a54bef1c1ae2ef70bf2e1ccc7d759 100755 (executable)
@@ -89,13 +89,9 @@ Estimated Time = 6000 seconds : 1 hour 40 minutes
 EOF
 }
 
-gen_template() {
-cat >$TEMPLATE << EOF
-[global]
-ioengine=libaio
+finish_template() {
+cat >>$TEMPLATE <<EOF
 iodepth=$IODEPTH
-invalidate=1
-ramp_time=5
 EOF
 
 if [ "$RUNTIME" != "0" ]; then
@@ -110,7 +106,15 @@ cat >>$TEMPLATE << EOF
 direct=1
 EOF
 fi
+}
 
+gen_template() {
+cat >$TEMPLATE << EOF
+[global]
+ioengine=libaio
+invalidate=1
+ramp_time=5
+EOF
 }
 
 gen_seq_suite() {
@@ -303,9 +307,10 @@ done
 
 
 ########## MAIN
+gen_template
 parse_cmdline $@
+finish_template
 check_mode_order
-gen_template
 
 echo "Generating $OUTFILE"
 cp -f $TEMPLATE $OUTFILE