[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

patch: ezjail_default_flavour option



Hello,

here is another small patch that adds a new ezjail_default_flavour option in ezjail.conf. It does what its name implies.

Regards,
Panagiotis

ps. also included some minor fixes; leftovers of the default flavour to example renaming.

--
Panagiotis J. Christias    Network Management Center
p.christias AT noc.ntua DOT gr    National Technical Univ. of Athens, GREECE
--- Makefile.orig	2010-01-13 00:50:13.000000000 +0200
+++ Makefile	2010-01-14 00:36:22.000000000 +0200
@@ -17,4 +17,4 @@
 	sed s:EZJAIL_PREFIX:${PREFIX}: man5/ezjail.5 > ${PREFIX}/man/man5/ezjail.5
 	chmod 755 ${PREFIX}/etc/rc.d/ezjail.sh ${PREFIX}/bin/ezjail-admin
 	chown -R root:wheel ${PREFIX}/man/man1/ezjail-admin.1 ${PREFIX}/man/man5/ezjail.conf.5 ${PREFIX}/man/man5/ezjail.5 ${PREFIX}/share/examples/ezjail/
-	chmod 0440 ${PREFIX}/share/examples/ezjail/default/usr/local/etc/sudoers
+	chmod 0440 ${PREFIX}/share/examples/ezjail/example/usr/local/etc/sudoers
--- ezjail-admin.orig	2010-01-14 00:03:14.000000000 +0200
+++ ezjail-admin	2010-01-14 00:37:16.000000000 +0200
@@ -23,6 +23,7 @@
 : ${ezjail_sourcetree="/usr/src"}
 : ${ezjail_uglyperlhack="YES"}
 : ${ezjail_default_execute="/usr/bin/login -f root"}
+: ${ezjail_default_flavour=""}
 
 : ${ezjail_mount_enable="YES"}
 : ${ezjail_devfs_enable="YES"}
@@ -268,15 +269,15 @@
   fi
 
   # If the default flavour example has not yet been copied, do it now
-  [ -d "${ezjail_flavours}/default" ] || mkdir -p "${ezjail_flavours}" && cp -p -R "${ezjail_examples}/default" "${ezjail_flavours}"
+  [ -d "${ezjail_flavours}/example" ] || mkdir -p "${ezjail_flavours}" && cp -p -R "${ezjail_examples}/example" "${ezjail_flavours}"
 
   # no /usr/ports? link to /basejail/usr/ports
   [ -e "${ezjail_jailtemplate}/usr/ports" ] || ln -s /basejail/usr/ports "${ezjail_jailtemplate}/usr/ports"
 
   # A ports collection inside jails is hardly useful w/o an appropriate
   # /etc/make.conf.
-  if [ -f "${ezjail_examples}/default/etc/make.conf" -a ! -f "${ezjail_jailtemplate}/etc/make.conf" ]; then
-    cp -p "${ezjail_examples}/default/etc/make.conf" "${ezjail_jailtemplate}/etc/"
+  if [ -f "${ezjail_examples}/example/etc/make.conf" -a ! -f "${ezjail_jailtemplate}/etc/make.conf" ]; then
+    cp -p "${ezjail_examples}/example/etc/make.conf" "${ezjail_jailtemplate}/etc/"
     echo "Note: a non-standard /etc/make.conf was copied to the template jail in order to get the ports collection running inside jails."
   fi
 
@@ -480,6 +481,8 @@
     [ -e "${ezjail_softlink}" ] && ezjail_softlink=`mktemp -u "${ezjail_softlink}.XXXXXX"`
   fi
 
+  # if no flavour specified on command use default flavour (if any)
+  [ ! "${ezjail_flavour}" -a "${ezjail_default_flavour}" ] && ezjail_flavour=${ezjail_default_flavour}
   # do some sanity checks on the selected flavour (if any)
   [ "${ezjail_flavour}" -a ! -d "${ezjail_flavours}/${ezjail_flavour}" ] && exerr "Error: Flavour config directory ${ezjail_flavours}/${ezjail_flavour} not found.\n  Refer to ${ezjail_admin}s man page for details on flavours."
 
--- ezjail.conf.sample.orig	2009-05-23 16:09:53.000000000 +0300
+++ ezjail.conf.sample	2010-01-14 00:41:33.000000000 +0200
@@ -47,6 +47,9 @@
 # ezjail_procfs_enable="YES"
 # ezjail_fdescfs_enable="YES"
 
+# This is the flavour used by default when setting up a new jail
+# ezjail_default_flavour=""
+
 # Setting this to YES will start to manage the basejail and newjail in ZFS
 # ezjail_use_zfs="YES"
 # The name of the ZFS ezjail should create jails on, it will be mounted at the ezjail_jaildir
--- man5/ezjail.conf.5.orig	2010-01-13 00:50:13.000000000 +0200
+++ man5/ezjail.conf.5	2010-01-14 00:57:09.000000000 +0200
@@ -112,6 +112,11 @@
 Set to YES, if ezjail should provide a soft link from /usr/bin/perl to /usr/local/bin/perl in base jail.
 .br
 .I default: YES
+.TP
+.B ezjail_default_flavour (str)
+Specifies which flavour should be used for newly created jails.
+.br
+.I default: none
 .SH ZFS OPTIONS
 .TP
 .B ezjail_use_zfs (bool)