--- /dev/null
+#!/bin/bash
+
+. common.sh
+
+if [ -z "$TARGET" -o ! -d "$TARGET" ]; then
+ echo "Missing target directory"
+ exit 1
+fi
+
+dd if=/dev/zero of="$TARGET/swapfile" bs=1024k count=512
+chmod 400 "$TARGET/swapfile"
+mkswap "$TARGET/swapfile"
+
+cat >> "$TARGET/etc/fstab" <<EOF
+# /etc/resolv.conf
+/swapfile none swap sw 0 0
+EOF
+
+exit 0
+
+# vim:set syn=sh: