Commit 02bb6153 authored by Adam Wujek's avatar Adam Wujek 💬

rootfs: use /etc/ppsi.conf not /wr/etc/ppsi.conf

Keep created ppsi.conf in /etc not in /wr/etc.
There is no need to keep it in the flash instead of ramdisk.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 9ff4f969
...@@ -935,7 +935,7 @@ in @ref{wrs_vlans}. ...@@ -935,7 +935,7 @@ in @ref{wrs_vlans}.
In addition to that, to have synchronization working with VLANs, you have to In addition to that, to have synchronization working with VLANs, you have to
prepare a custom @i{PPSi} configuration file with VLANs specified per-port. You prepare a custom @i{PPSi} configuration file with VLANs specified per-port. You
can simply copy the file generated in the WRS filesystem can simply copy the file generated in the WRS filesystem
(@i{/wr/etc/ppsi.conf}) to a central @t{tftp}/@t{http}/@t{ftp} server where (@i{/etc/ppsi.conf}) to a central @t{tftp}/@t{http}/@t{ftp} server where
@i{dot-config} files for your switches are stored and fetched on boot time. @i{dot-config} files for your switches are stored and fetched on boot time.
For every VLAN-enabled port you should add the following line: For every VLAN-enabled port you should add the following line:
@example @example
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
//Global Variables //Global Variables
$etcdir="/usr/wr/etc/"; //configuration file folder for WRS $etcdir="/usr/wr/etc/"; //configuration file folder for WRS
$snmpconf="snmpd.conf"; $snmpconf="snmpd.conf";
$ppsiconf="ppsi-pre.conf"; $ppsipreconf="ppsi-pre.conf";
$sfpdatabaseconf="sfp_database.conf"; $sfpdatabaseconf="sfp_database.conf";
$wrdateconf="wr_date.conf"; $wrdateconf="wr_date.conf";
$vlancolor = array("#27DE2A", "#B642A8", "#6E42B6", "#425DB6" , "#428DB6", "#4686B6", "#43B88B", "#42B65F", "#82B642", "#B6AE42", "#B67E42"); $vlancolor = array("#27DE2A", "#B642A8", "#6E42B6", "#425DB6" , "#428DB6", "#4686B6", "#43B88B", "#42B65F", "#82B642", "#B6AE42", "#B67E42");
...@@ -883,16 +883,16 @@ function wrs_ptp_configuration(){ ...@@ -883,16 +883,16 @@ function wrs_ptp_configuration(){
header('Location: ptp.php'); header('Location: ptp.php');
} }
if (!empty($_POST["clkclass"])){ if (!empty($_POST["clkclass"])){
$old_value= rtrim(shell_exec("cat ".$GLOBALS['etcdir'].$GLOBALS['ppsiconf']." | grep class ")); $old_value= rtrim(shell_exec("cat ".$GLOBALS['etcdir'].$GLOBALS['ppsipreconf']." | grep class "));
$new_value="clock-class ".htmlspecialchars($_POST["clkclass"]); $new_value="clock-class ".htmlspecialchars($_POST["clkclass"]);
$sed = 'sed -i "s/'.$old_value.'/'.$new_value.'/g" '.$GLOBALS['etcdir'].$GLOBALS['ppsiconf'];echo $sed; $sed = 'sed -i "s/'.$old_value.'/'.$new_value.'/g" '.$GLOBALS['etcdir'].$GLOBALS['ppsipreconf'];echo $sed;
shell_exec($sed); shell_exec($sed);
echo '<br>Clock Class changed to '.htmlspecialchars($_POST["clkclass"]); echo '<br>Clock Class changed to '.htmlspecialchars($_POST["clkclass"]);
} }
if (!empty($_POST["clkacc"])){ if (!empty($_POST["clkacc"])){
$old_value= rtrim(shell_exec("cat ".$GLOBALS['etcdir'].$GLOBALS['ppsiconf']." | grep accuracy ")); $old_value= rtrim(shell_exec("cat ".$GLOBALS['etcdir'].$GLOBALS['ppsipreconf']." | grep accuracy "));
$new_value="clock-accuracy ".htmlspecialchars($_POST["clkacc"]); $new_value="clock-accuracy ".htmlspecialchars($_POST["clkacc"]);
$sed ='sed -i "s/'.$old_value.'/'.$new_value.'/g" '.$GLOBALS['etcdir'].$GLOBALS['ppsiconf'];echo $sed; $sed ='sed -i "s/'.$old_value.'/'.$new_value.'/g" '.$GLOBALS['etcdir'].$GLOBALS['ppsipreconf'];echo $sed;
shell_exec($sed); shell_exec($sed);
echo '<br>Clock Accuracy changed to '.htmlspecialchars($_POST["clkacc"]); echo '<br>Clock Accuracy changed to '.htmlspecialchars($_POST["clkacc"]);
} }
......
...@@ -84,6 +84,7 @@ ...@@ -84,6 +84,7 @@
$section = "WRS_FORMS"; $section = "WRS_FORMS";
$subsection = "CONFIG_PPSI"; $subsection = "CONFIG_PPSI";
wrs_ptp_configuration();
$_SESSION["WRS_FORMS"]["CONFIG_PPSI"][CONFIG_PPSI_00]["value"]= $_SESSION["WRS_FORMS"]["CONFIG_PPSI"][CONFIG_PPSI_00]["value"]=
shell_exec("cat /wr/etc/ppsi-pre.conf | grep clock-class | awk '{print $2}'"); shell_exec("cat /wr/etc/ppsi-pre.conf | grep clock-class | awk '{print $2}'");
$_SESSION["WRS_FORMS"]["CONFIG_PPSI"][CONFIG_PPSI_01]["value"]= $_SESSION["WRS_FORMS"]["CONFIG_PPSI"][CONFIG_PPSI_01]["value"]=
...@@ -91,7 +92,6 @@ ...@@ -91,7 +92,6 @@
print_form($section, $subsection, $formatID, $class, $infoname, $format); print_form($section, $subsection, $formatID, $class, $infoname, $format);
wrs_ptp_configuration();
wrs_management(); wrs_management();
if ((!empty($_POST["modegroup"]))){ if ((!empty($_POST["modegroup"]))){
......
...@@ -108,7 +108,7 @@ copy_conf /wr/etc/snmpd.conf ...@@ -108,7 +108,7 @@ copy_conf /wr/etc/snmpd.conf
if [ "$CONFIG_PTP_PORT_PARAMS" = "y" ]; then if [ "$CONFIG_PTP_PORT_PARAMS" = "y" ]; then
/wr/bin/assembly_ppsi_conf.sh /wr/bin/assembly_ppsi_conf.sh
elif [ "$CONFIG_PTP_CUSTOM" = "y" ]; then elif [ "$CONFIG_PTP_CUSTOM" = "y" ]; then
cp "$CONFIG_PTP_CUSTOM_FILENAME" /wr/etc/ppsi.conf cp "$CONFIG_PTP_CUSTOM_FILENAME" /etc/ppsi.conf
elif [ "$CONFIG_PTP_REMOTE_CONF" = "y" ]; then elif [ "$CONFIG_PTP_REMOTE_CONF" = "y" ]; then
# Warning: code below copied from /etc/init.d/dot-config. # Warning: code below copied from /etc/init.d/dot-config.
...@@ -144,14 +144,10 @@ elif [ "$CONFIG_PTP_REMOTE_CONF" = "y" ]; then ...@@ -144,14 +144,10 @@ elif [ "$CONFIG_PTP_REMOTE_CONF" = "y" ]; then
;; ;;
esac esac
if [ -f $tmpconfig ]; then if [ -f $tmpconfig ]; then
# copy it in place to use the new file (unless it is identical) # copy it in place to use the new file
cmp -s $tmpconfig /wr/etc/ppsi.conf || \ cp $tmpconfig /etc/ppsi.conf
cp $tmpconfig /wr/etc/ppsi.conf
fi fi
else else
# no valid PTP option keep ppsi.conf with old postfix # no valid PTP option keep ppsi.conf with old postfix
echo "No valid PTP option in dot-config!" >& 2 echo "No valid PTP option in dot-config!" >& 2
if [ -f /wr/etc/ppsi.conf ]; then
mv -f /wr/etc/ppsi.conf /wr/etc/ppsi.conf.old
fi
fi fi
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# script to assembly ppsi.conf based on dot-config configuration # script to assembly ppsi.conf based on dot-config configuration
PRE_FILE="/wr/etc/ppsi-pre.conf" PRE_FILE="/wr/etc/ppsi-pre.conf"
OUTPUT_FILE="/wr/etc/ppsi.conf" OUTPUT_FILE="/etc/ppsi.conf"
if [ -f /wr/etc/dot-config ]; then if [ -f /wr/etc/dot-config ]; then
. /wr/etc/dot-config . /wr/etc/dot-config
......
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