From 629e6a296f6121b1e25748fb57c037e8ba4fc4a9 Mon Sep 17 00:00:00 2001 From: JRGTH Date: Mon, 13 Sep 2021 21:42:07 -0400 Subject: [PATCH] Set bastille minimum version for some options --- CHANGELOG | 1 + gui/bastille_manager-lib.inc | 3 ++- gui/bastille_manager_add.php | 8 ++++---- version | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index a2b932b..ae264b6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,7 @@ ====================== Version Description +1.0.96......Set bastille minimum version for some options. 1.0.95......Add new export/import features. 1.0.94......check for required variables for bastille 0.9.x. 1.0.93......Quick update to support bastille 0.9.x. diff --git a/gui/bastille_manager-lib.inc b/gui/bastille_manager-lib.inc index 42a16c4..2faf57a 100755 --- a/gui/bastille_manager-lib.inc +++ b/gui/bastille_manager-lib.inc @@ -58,12 +58,13 @@ $config_path = exec("/usr/bin/grep 'BASTILLE_CONFIG=' $configfile | /usr/bin/cut $default_distfiles = exec("/usr/bin/grep 'bastille_bootstrap_archives=' $config_path | /usr/bin/cut -d'\"' -f2"); $jail_dir = "{$rootfolder}/jails"; $image_dir = "ext/bastille/images"; -$options_support = "yes"; $reldir = "{$rootfolder}/releases"; $backup_path_bastille = exec("/usr/sbin/sysrc -f $rootfolder/bastille-dist/usr/local/etc/bastille/bastille.conf -qn bastille_backupsdir"); $zfs_support = exec("/usr/bin/grep 'ZFS_SUPPORT=' $configfile | /usr/bin/cut -d'\"' -f2"); $zfs_activated = exec("/usr/bin/grep 'ZFS_ACTIVATED=' $configfile | /usr/bin/cut -d'\"' -f2"); $tarballversion = "/usr/local/bin/bastille"; +$bastille_version_min = exec("grep 'BASTILLE_VERSION=' $tarballversion | cut -d '\"' -f2 | tr -d '.'"); +$host_version = exec("/bin/cat /etc/prd.version | tr -d '.'"); // Ensure the root directory is configured. if ($rootfolder == "") diff --git a/gui/bastille_manager_add.php b/gui/bastille_manager_add.php index 8b66252..7262d81 100644 --- a/gui/bastille_manager_add.php +++ b/gui/bastille_manager_add.php @@ -199,11 +199,12 @@ $document->render(); $b_action = $l_release; html_combobox2('interface',gettext('Network interface'),$pconfig['interface'],$a_action,'',true,false); html_combobox2('release',gettext('Base release'),$pconfig['release'],$b_action,'',true,false); - if($options_support): + if($bastille_version_min > "0700000000"): html_checkbox2('thickjail',gettext('Create a thick container'),!empty($pconfig['thickjail']) ? true : false,gettext('These containers consume more space, but are self contained.'),'',false); - html_checkbox2('vnetjail',gettext('Enable VNET(VIMAGE)'),!empty($pconfig['vnetjail']) ? true : false,gettext('VNET-enabled containers are attached to a virtual bridge interface for connectivity(Advanced).'),'',false); + if($host_version > "12100"): + html_checkbox2('vnetjail',gettext('Enable VNET(VIMAGE)'),!empty($pconfig['vnetjail']) ? true : false,gettext('VNET-enabled containers are attached to a virtual bridge interface for connectivity(Advanced).'),'',false); + endif; html_checkbox2('emptyjail',gettext('Create an empty container'),!empty($pconfig['emptyjail']) ? true : false,gettext('This are ideal for custom builds, experimenting with unsupported RELEASES or Linux jails.'),'',false,false,'emptyjail_change()'); - endif; html_checkbox2('nowstart',gettext('Start after creation'),!empty($pconfig['nowstart']) ? true : false,gettext('Start the container after creation(May be overridden by later bastille releases).'),'',false); html_checkbox2('autostart',gettext('Auto start on boot'),!empty($pconfig['autostart']) ? true : false,gettext('Automatically start the container at boot time.'),'',false); @@ -213,7 +214,6 @@ $document->render();
-