From 9fd74acfac2194874224ea046953094cd56dfffa Mon Sep 17 00:00:00 2001
From: Steven Armstrong <steven@icarus.ethz.ch>
Date: Tue, 4 Oct 2011 22:50:49 +0200
Subject: [PATCH] add support for swap

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
---
 conf/type/__mkfs/gencode-remote | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/conf/type/__mkfs/gencode-remote b/conf/type/__mkfs/gencode-remote
index e5061013..0a220ec9 100755
--- a/conf/type/__mkfs/gencode-remote
+++ b/conf/type/__mkfs/gencode-remote
@@ -21,16 +21,18 @@
 device="(cat "$__object/parameter/device")"
 type="(cat "$__object/parameter/type")"
 
-command="mkfs -t $type"
-
-if [ -f "$__object/parameter/options" ]; then
-   options="(cat "$__object/parameter/options")"
-   command="$command -o '$options'"
+if [ "$type" = "swap" ]; then
+   echo "mkswap $device"
+else
+   command="mkfs -t $type"
+   if [ -f "$__object/parameter/options" ]; then
+      options="(cat "$__object/parameter/options")"
+      command="$command -o '$options'"
+   fi
+   command="$command $device"
+   if [ -f "$__object/parameter/blocks" ]; then
+      blocks="(cat "$__object/parameter/blocks")"
+      command="$command $blocks"
+   fi
+   echo "$command"
 fi
-command="$command $device"
-if [ -f "$__object/parameter/blocks" ]; then
-   blocks="(cat "$__object/parameter/blocks")"
-   command="$command $blocks"
-fi
-
-echo "$command"