Commit bbec3a8f authored by Franco Fichtner's avatar Franco Fichtner

etc: start moving files to new home

parent f32a21fc
___
___/ f \
/ p \___/ Sense
\___/ \
\___/
\ No newline at end of file
......@@ -328,7 +328,7 @@ exec("rm ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/etc/fstab 2>/dev/null");
exec("rm ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/etc/ttys 2>/dev/null");
exec("rm ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/etc/group 2>/dev/null");
exec("rm ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/etc/fstab 2>/dev/null");
exec("rm ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/etc/platform 2>/dev/null");
exec("rm ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/usr/local/etc/platform 2>/dev/null");
exec("rm ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/boot/device.hints 2>/dev/null");
exec("rm ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/boot/loader.conf 2>/dev/null");
exec("rm ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/boot/loader.rc 2>/dev/null");
......
......@@ -18,10 +18,10 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
export HOME PATH
# Set our operating platform
PLATFORM=`/bin/cat /etc/platform`
PLATFORM=`/bin/cat /usr/local/etc/platform`
# Set our current version
version=`/bin/cat /etc/version`
version=`/bin/cat /usr/local/etc/version`
# Setup dumpdev/ddb/savecore"
echo "Configuring crash dumps..."
......@@ -160,9 +160,6 @@ else
platformbanner=" on the '${PLATFORM}' platform"
fi
echo
cat /etc/ascii-art/pfsense-logo-small.txt
echo
echo
echo "Welcome to ${product} ${version} ${platformbanner} ..."
echo
......
......@@ -473,9 +473,6 @@ pfSenseupgrade)
/etc/init_bootloader.sh >> /conf/upgrade_log.txt 2>&1
fi
# Remove saved commit ID for gitsync
rm -f /etc/version.gitsync
# If /tmp/post_upgrade_command exists after update
# then execute the command.
if [ -f /tmp/post_upgrade_command ]; then
......
......@@ -26,7 +26,7 @@ fi
PMD=`/bin/cat /tmp/latest.tgz.md5 | cut -d" " -f4 `
MD=`/sbin/md5 /tmp/latest.tgz | cut -d" " -f4`
PLATFORM=`cat /etc/platform`
PLATFORM=`cat /usr/local/etc/platform`
echo " Package MD5: ${PMD}" | logger -p daemon.info -i -t AutoUpgrade
echo "Downloaded MD5: ${MD}" | logger -p daemon.info -i -t AutoUpgrade
......
......@@ -42,7 +42,7 @@ CONFIG="/cf/conf/config.xml"
WORD="https"
# Set our operating platform
PLATFORM=`cat /etc/platform`
PLATFORM=`cat /usr/local/etc/platform`
if [ "$PLATFORM" = "jail" ]; then
exit
......
......@@ -26,7 +26,7 @@
# POSSIBILITY OF SUCH DAMAGE.
# Set our operating platform
PLATFORM=`/bin/cat /etc/platform`
PLATFORM=`/bin/cat /usr/local/etc/platform`
if [ -d /usr/local/lib/php/20131226 ]; then
# PHP 5.6
......
......@@ -11,7 +11,7 @@ sleep 1
# If PLATFORM is pfSense then remove
# temporary files on shutdown from /tmp/
PLATFORM=`cat /etc/platform`
PLATFORM=`cat /usr/local/etc/platform`
if [ "$PLATFORM" = "pfSense" ]; then
rm -rf /tmp/*
fi
......
......@@ -22,7 +22,7 @@ export PATH
# If PLATFORM is pfSense then remove
# temporary files on shutdown from /tmp/
PLATFORM=`cat /etc/platform`
PLATFORM=`cat /usr/local/etc/platform`
if [ "$PLATFORM" = "pfSense" ]; then
find -x /tmp/* -type f -exec rm -f {} \; >/dev/null 2>&1
fi
......
This source diff could not be displayed because it is too large. You can view the blob instead.
set prompt="%{\033[0;1;33m%}[%{\033[0;1;37m%}`cat /etc/version`%{\033[0;1;33m%}]%{\033[0;1;33m%}%B[%{\033[0;1;37m%}%n%{\033[0;1;31m%}@%{\033[0;1;37m%}%M%{\033[0;1;33m%}]%{\033[0;1;32m%}%b%/%{\033[0;1;33m%}(%{\033[0;1;37m%}%h%{\033[0;1;33m%})%{\033[0;1;36m%}%{\033[0;1;31m%}:%{\033[0;0;0m%} "
set autologout="0"
set autolist set color set colorcat
setenv CLICOLOR "true"
setenv LSCOLORS "exfxcxdxbxegedabagacad"
if ($term == "xterm" || $term == "vt100" || $term == "vt102" || $term == "vt220" || $term !~ "con*") then
bindkey "\e[2~" overwrite-mode # Ins
bindkey "\e[3~" delete-char # Del
bindkey "\e[1~" beginning-of-line # Home vt
bindkey "\e[4~" end-of-line # End vt
bindkey "\eOH" beginning-of-line # Home vt220
bindkey "\eOF" end-of-line # End vt220
bindkey "\e[H" beginning-of-line # Home kvt
bindkey "\e[F" end-of-line # End kvt
bindkey "\e[7~" beginning-of-line # Home rxvt/konsole
bindkey "\e[8~" end-of-line # End rxvt/konsole
endif
set prompt="%{\033[0;1;33m%}[%{\033[0;1;37m%}`cat /etc/version`%{\033[0;1;33m%}]%{\033[0;1;33m%}%B[%{\033[0;1;37m%}%n%{\033[0;1;31m%}@%{\033[0;1;37m%}%M%{\033[0;1;33m%}]%{\033[0;1;32m%}%b%/%{\033[0;1;33m%}(%{\033[0;1;37m%}%h%{\033[0;1;33m%})%{\033[0;1;36m%}%{\033[0;1;31m%}:%{\033[0;0;0m%} "
set autologout="0"
set autolist set color set colorcat
setenv CLICOLOR "true"
......
......@@ -2,7 +2,7 @@
/etc/rc.conf_mount_rw
PFSENSETYPE=`cat /etc/platform`
PFSENSETYPE=`cat /usr/local/etc/platform`
if [ $PFSENSETYPE = "pfSense" ] || [ $PFSENSETYPE = "nanobsd" ]; then
touch /conf/needs_package_sync
......
......@@ -349,7 +349,7 @@ function conf_mount_ro() {
global $g, $config;
/* Do not trust $g['platform'] since this can be clobbered during factory reset. */
$platform = trim(file_get_contents("/etc/platform"));
$platform = trim(file_get_contents("/usr/local/etc/platform"));
/* do not umount on cdrom or pfSense platforms */
if($platform == "cdrom" or $platform == "pfSense")
return;
......
......@@ -96,7 +96,7 @@ $iptos = array("lowdelay", "throughput", "reliability");
/* TCP flags */
$tcpflags = array("syn", "ack", "fin", "rst", "psh", "urg", "ece", "cwr");
if(file_exists("/etc/platform")) {
if(file_exists("/usr/local/etc/platform")) {
$arch = php_uname("m");
/* Do not remove this, it is not needed for the snapshots URL but is needed later for the -RELEASE/stable URLs */
//$arch = ($arch == "i386") ? "" : '/' . $arch;
......@@ -105,7 +105,7 @@ if(file_exists("/etc/platform")) {
$g['update_url']="https://snapshots.opnsense.org/FreeBSD_releng/10.1/{$arch}/pfSense_HEAD/.updaters/";
$g['update_manifest']="https://updates.opnsense.org/manifest";
$g['platform'] = trim(file_get_contents("/etc/platform"));
$g['platform'] = trim(file_get_contents("/usr/local/etc/platform"));
if($g['platform'] == "nanobsd") {
$g['firmware_update_text']="OPNsense-*.img.gz";
$g['hidedownloadbackup'] = true;
......
......@@ -725,10 +725,10 @@ function check_firmware_version($tocheck = "all", $return_php = true) {
return false;
$version = php_uname('r');
$version = explode('-', $version);
$rawparams = array("firmware" => array("version" => trim(file_get_contents('/etc/version'))),
$rawparams = array("firmware" => array("version" => trim(file_get_contents('/usr/local/etc/version'))),
"kernel" => array("version" => $version[0]),
"base" => array("version" => $version[0]),
"platform" => trim(file_get_contents('/etc/platform')),
"platform" => trim(file_get_contents('/usr/local/etc/platform')),
"config_version" => $config['version']
);
unset($version);
......@@ -763,10 +763,10 @@ function host_firmware_version($tocheck = "") {
$os_version = trim(substr(php_uname("r"), 0, strpos(php_uname("r"), '-')));
return array(
"firmware" => array("version" => trim(file_get_contents('/etc/version', " \n"))),
"firmware" => array("version" => trim(file_get_contents('/usr/local/etc/version', " \n"))),
"kernel" => array("version" => $os_version),
"base" => array("version" => $os_version),
"platform" => trim(file_get_contents('/etc/platform', " \n")),
"platform" => trim(file_get_contents('/usr/local/etc/platform', " \n")),
"config_version" => $config['version']
);
}
......@@ -1617,7 +1617,7 @@ function download_file($url, $destination, $verify_ssl = false, $connect_timeout
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . rtrim(file_get_contents("/etc/version")));
curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . rtrim(file_get_contents("/usr/local/etc/version")));
if (!empty($config['system']['proxyurl'])) {
curl_setopt($ch, CURLOPT_PROXY, $config['system']['proxyurl']);
......@@ -1659,7 +1659,7 @@ function download_file_with_progress_bar($url_file, $destination_file, $readbody
curl_setopt($ch, CURLOPT_NOPROGRESS, '1');
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $connect_timeout);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . rtrim(file_get_contents("/etc/version")));
curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . rtrim(file_get_contents("/usr/local/etc/version")));
if (!empty($config['system']['proxyurl'])) {
curl_setopt($ch, CURLOPT_PROXY, $config['system']['proxyurl']);
......
......@@ -79,7 +79,7 @@ if (!function_exists("pkg_debug")) {
$vardb = "/var/db/pkg";
safe_mkdir($vardb);
$g['platform'] = trim(file_get_contents("/etc/platform"));
$g['platform'] = trim(file_get_contents("/usr/local/etc/platform"));
if(!is_dir("/usr/local/pkg") or !is_dir("/usr/local/pkg/pf")) {
conf_mount_rw();
......@@ -620,7 +620,7 @@ function install_package($package, $pkg_info = "", $force_install = false) {
}
if (!$force_install) {
$compatible = true;
$version = rtrim(file_get_contents("/etc/version"));
$version = rtrim(file_get_contents("/usr/local/etc/version"));
if (isset($pkg_info['required_version']))
$compatible = (pfs_version_compare("", $version, $pkg_info['required_version']) >= 0);
......@@ -1311,7 +1311,7 @@ function package_skip_tests($index,$requested_version){
global $config, $g;
/* Get pfsense version*/
$version = rtrim(file_get_contents("/etc/version"));
$version = rtrim(file_get_contents("/usr/local/etc/version"));
if($g['platform'] == "nanobsd")
if($index['noembedded'])
......@@ -1396,7 +1396,7 @@ function check_package_server_ssl() {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, '30');
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . rtrim(file_get_contents("/etc/version")));
curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . rtrim(file_get_contents("/usr/local/etc/version")));
$result_page = curl_exec($ch);
$verifyfail = curl_getinfo($ch, CURLINFO_SSL_VERIFYRESULT);
curl_close($ch);
......
......@@ -1950,8 +1950,8 @@ trap := "{$config['snmpd']['trapstring']}"
EOD;
}
$version = trim(file_get_contents('/etc/version'));
$platform = trim(file_get_contents('/etc/platform'));
$version = trim(file_get_contents('/usr/local/etc/version'));
$platform = trim(file_get_contents('/usr/local/etc/platform'));
if (($platform == "pfSense") && ($g['product_name'] != "pfSense"))
$platform = $g['product_name'];
$sysDescr = "{$g['product_name']} " . php_uname("n") .
......
......@@ -1643,7 +1643,7 @@ function mute_kernel_msgs() {
global $config;
// Do not mute serial console. The kernel gets very very cranky
// and will start dishing you cannot control tty errors.
switch (trim(file_get_contents("/etc/platform"))) {
switch (trim(file_get_contents("/usr/local/etc/platform"))) {
case "nanobsd":
case "jail":
return;
......@@ -1657,7 +1657,7 @@ function unmute_kernel_msgs() {
global $config;
// Do not mute serial console. The kernel gets very very cranky
// and will start dishing you cannot control tty errors.
switch (trim(file_get_contents("/etc/platform"))) {
switch (trim(file_get_contents("/usr/local/etc/platform"))) {
case "nanobsd":
case "jail":
return;
......
......@@ -206,7 +206,7 @@
$config_text .= "serial=".strtoupper(substr(upnp_uuid(),0,8))."\n";
/* set model number */
$config_text .= "model_number=".file_get_contents("/etc/version")."\n";
$config_text .= "model_number=".file_get_contents("/usr/local/etc/version")."\n";
/* upnp access restrictions */
for($i=1; $i<=4; $i++) {
......
......@@ -134,7 +134,7 @@ include("head.inc");
<?php
$version = rtrim(file_get_contents("/etc/version"));
$version = rtrim(file_get_contents("/usr/local/etc/version"));
$tab_array = array();
$tab_array[] = array(gettext("Available Packages"), $requested_version <> "" ? false : true, "pkg_mgr.php");
......@@ -147,7 +147,7 @@ include("head.inc");
<div class="container-fluid">
<?php
$version = rtrim(file_get_contents("/etc/version"));
$version = rtrim(file_get_contents("/usr/local/etc/version"));
if($pkg_info) {
$pkg_keys = array_keys($pkg_info);
natcasesort($pkg_keys);
......@@ -307,4 +307,4 @@ include("head.inc");
</div>
</div>
</section>
<?php include("foot.inc"); ?>
\ No newline at end of file
<?php include("foot.inc"); ?>
......@@ -109,7 +109,7 @@ include("head.inc");
<?php
$version = file_get_contents("/etc/version");
$version = file_get_contents("/usr/local/etc/version");
$tab_array = array();
$tab_array[] = array(gettext("Available Packages"), false, "pkg_mgr.php");
// $tab_array[] = array("{$version} " . gettext("packages"), false, "pkg_mgr.php");
......@@ -247,4 +247,4 @@ include("head.inc");
</div>
</section>
<?php include("foot.inc"); ?>
\ No newline at end of file
<?php include("foot.inc"); ?>
......@@ -95,7 +95,7 @@ function enable_altpkgrepourl(enable_over) {
<tr>
<td>
<?php
$version = file_get_contents("/etc/version");
$version = file_get_contents("/usr/local/etc/version");
$tab_array = array();
$tab_array[] = array(sprintf(gettext("%s packages"), $version), false, "pkg_mgr.php");
$tab_array[] = array(gettext("Installed Packages"), false, "pkg_mgr_installed.php");
......
......@@ -64,13 +64,13 @@ function file_is_for_platform($filename, $ul_name) {
else
return false;
}
$_gb = exec("/usr/bin/tar xzf $filename -C /tmp/ etc/platform");
$_gb = exec("/usr/bin/tar xzf $filename -C /tmp/ usr/local/etc/platform");
unset($_gb);
if(!file_exists("/tmp/etc/platform"))
if(!file_exists("/tmp/usr/local/etc/platform"))
return false;
$upgrade_is_for_platform = trim(file_get_contents("/tmp/etc/platform", " \n\t\r"));
$upgrade_is_for_platform = trim(file_get_contents("/tmp/usr/local/etc/platform", " \n\t\r"));
if ($g['platform'] == $upgrade_is_for_platform) {
@unlink("/tmp/etc/platform");
@unlink("/tmp/usr/local/etc/platform");
return true;
}
return false;
......
......@@ -156,8 +156,8 @@ if(!$latest_version) {
require("fend.inc");
exit;
} else {
$current_installed_buildtime = trim(file_get_contents("/etc/version.buildtime"));
$current_installed_version = trim(file_get_contents("/etc/version"));
$current_installed_buildtime = ''; /* XXX zap */
$current_installed_version = trim(file_get_contents("/usr/local/etc/version"));
$latest_version = trim(@file_get_contents("/tmp/{$g['product_name']}_version"));
$latest_version_pfsense = strtotime($latest_version);
if(!$latest_version) {
......
......@@ -153,8 +153,8 @@ if (!$remote_version) {
$static_text .= gettext("Obtaining current version information...");
update_output_window($static_text);
$current_installed_buildtime = trim(file_get_contents("/etc/version.buildtime"));
$current_installed_version = trim(file_get_contents("/etc/version"));
$current_installed_buildtime = ''; /* XXX zap */
$current_installed_version = trim(file_get_contents("/usr/local/etc/version"));
$static_text .= "done\\n";
update_output_window($static_text);
......
......@@ -61,8 +61,8 @@ if($_REQUEST['getupdatestatus']) {
if(empty($remote_version))
echo "<br /><br />Unable to check for updates.";
else {
$current_installed_buildtime = trim(file_get_contents("/etc/version.buildtime"));
$current_installed_version = trim(file_get_contents("/etc/version"));
$current_installed_buildtime = ''; /* XXX zap */
$current_installed_version = trim(file_get_contents("/usr/local/etc/version"));
if(!$remote_version) {
echo "<br /><br />Unable to check for updates.";
......@@ -122,10 +122,10 @@ $filesystems = get_mounted_filesystems();
<tr>
<td width="25%" valign="top" class="vncellt"><?=gettext("Version");?></td>
<td width="75%" class="listr">
<strong><?php readfile("/etc/version"); ?></strong>
<strong><?php readfile("/usr/local/etc/version"); ?></strong>
(<?php echo php_uname("m"); ?>)
<br />
built on <?php readfile("/etc/version.buildtime"); ?>
built on <?php readfile("/usr/local/etc/version.buildtime"); ?>
<?php if(!$g['hideuname']): ?>
<br />
<div id="uname"><a href="#" onclick='swapuname(); return false;'><?php echo php_uname("s") . " " . php_uname("r"); ?></a></div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment