From 131889b454b8ec33434ab3092e2b2283600ec594 Mon Sep 17 00:00:00 2001
From: Jake Guffey <jake.guffey@eprotex.com>
Date: Mon, 23 Apr 2012 14:39:26 -0400
Subject: [PATCH] Added jail_${name}_flags variable

To make future work, such as resource limiting (rctl(8)) easier, added
"-n ${name}" to jail_flags for each jail.
---
 conf/type/__jail/gencode-remote | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/conf/type/__jail/gencode-remote b/conf/type/__jail/gencode-remote
index 23e8debc..9b91bd50 100755
--- a/conf/type/__jail/gencode-remote
+++ b/conf/type/__jail/gencode-remote
@@ -198,8 +198,8 @@ cat <<EOF
       cp -r ${jaildir}/base/usr/home/* "${jaildir}/rw/${name}/home/"
    fi
    mkdir "${jaildir}/rw/${name}/root"
-   if [ -n "\$(ls ${jaildir}/base/root)" ]; then
-      cp -r ${jaildir}/base/root/* "${jaildir}/rw/${name}/root/"
+   if [ -n "\$(ls -A ${jaildir}/base/root)" ]; then
+      cp -r ${jaildir}/base/root/ "${jaildir}/rw/${name}/root/"
    fi
 
 EOF
@@ -234,7 +234,8 @@ jail_${name}_hostname="${hostname}"
 jail_${name}_ip="${ip}"
 jail_${name}_devfs_enable="${devfsenable}"
 jail_${name}_mount_enable="YES"
-jail_${name}_fstab="/etc/fstab.$name"
+jail_${name}_fstab="/etc/fstab.${name}"
+jail_${name}_flags="-n ${name} \\\${jail_flags}"
 END
 EOF