diff --git a/CHANGELOG b/CHANGELOG index c1ec812..e985ce5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,7 @@ ====================== Version Description +1.0.9......Allow for distfiles download override. 1.0.8......Add option for thickjail creation if supported. 1.0.7......Added 12.1-RELEASE. 1.0.6......Reload page after base release download. diff --git a/gui/bastille_manager-lib.inc b/gui/bastille_manager-lib.inc index 17d92e8..e1f7101 100755 --- a/gui/bastille_manager-lib.inc +++ b/gui/bastille_manager-lib.inc @@ -51,6 +51,8 @@ $logfile = "{$rootfolder}/log/bastille_ext.log"; $logevent = "{$rootfolder}/log/bastille_last_event.log"; $backup_path = exec("/bin/cat {$configfile} | /usr/bin/grep 'BACKUP_DIR=' | /usr/bin/cut -d'\"' -f2"); $bastille_config = "{$rootfolder}/conf/bastille_config"; +$config_path = exec("/bin/cat {$configfile} | /usr/bin/grep 'BASTILLE_CONFIG=' | /usr/bin/cut -d'\"' -f2"); +$default_distfiles = exec("/bin/cat {$config_path} | /usr/bin/grep 'bastille_bootstrap_archives=' | /usr/bin/cut -d'\"' -f2"); $jail_dir = "{$rootfolder}/jails"; $image_dir = "ext/bastille/images"; $thick_jail = exec("/usr/local/bin/bastille create | grep -wo '\[option\]'"); diff --git a/gui/bastille_manager_tarballs.php b/gui/bastille_manager_tarballs.php index f4cc3b8..0306e2e 100644 --- a/gui/bastille_manager_tarballs.php +++ b/gui/bastille_manager_tarballs.php @@ -82,15 +82,37 @@ if($_POST): $get_release = $pconfig['release_item']; $check_release = ("{$rootfolder}/releases/{$get_release}"); $cmd = ("/usr/local/bin/bastille bootstrap {$get_release}"); + $base_mandatory = "base"; + + unset($lib32,$ports,$src); + if ($_POST['lib32']): + $lib32 = "lib32"; + endif; + if ($_POST['ports']): + $ports = "ports"; + endif; + if ($_POST['src']): + $src = "src"; + endif; + $opt_tarballs = "$lib32 $ports $src"; + if(file_exists($check_release)): // FreeBSD base release check. $savemsg .= sprintf(gtext('%s base appears to be already extracted.'),$get_release); else: // Download a FreeBSD base release. if ($_POST['Download']): + if ($opt_tarballs): + if ($config_path): + // Override default distfiles. + exec("/usr/sbin/sysrc -f {$config_path} bastille_bootstrap_archives=\"$base_mandatory $opt_tarballs\""); + endif; + endif; unset($output,$retval);mwexec2($cmd,$output,$retval); if($retval == 0): //$savemsg .= sprintf(gtext('%s base downloaded and extracted successfully.'),$get_release); + // Set back default distfiles. + exec("/usr/sbin/sysrc -f {$config_path} bastille_bootstrap_archives=\"$default_distfiles\""); header('Location: bastille_manager_tarballs.php'); else: $errormsg .= sprintf(gtext('%s Failed to download and/or extract release base.'),$get_release); @@ -182,19 +204,24 @@ $document->render();