Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
398172e2
Commit
398172e2
authored
Nov 27, 2014
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
/wr/bin: added change_dot-config and documented it
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
9a376bca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
2 deletions
+46
-2
wrs-developer-manual.in
doc/wrs-developer-manual.in
+20
-2
change_dot-config
userspace/rootfs_override/wr/bin/change_dot-config
+26
-0
No files found.
doc/wrs-developer-manual.in
View file @
398172e2
...
...
@@ -805,7 +805,11 @@ The main components are:
@
end
table
The
most
important
tools
in
@
file
{
userspace
/
tools
}
are
the
following
:
@
sc
{
wrs
}
user
space
includes
also
some
tools
and
scripts
.
Tools
are
build
from
source
files
in
@
file
{
userspace
/
tools
}
while
the
scripts
are
copied
directly
from
@
file
{
userspace
/
rootfs_override
/
wr
/
bin
}.
The
following
tools
and
scripts
are
provided
:
@
table
@
file
...
...
@@ -832,7 +836,7 @@ The most important tools in @file{userspace/tools} are the following:
The
program
is
a
simple
program
for
talking
with
serial
ports
.
@
item
wr_phytool
A
tool
to
read
and
write
PHY
registers
in
the
switch
A
tool
to
read
and
write
PHY
registers
in
the
switch
.
@
item
wr_mon
A
simple
monitor
of
White
Rabbit
status
.
It
prints
to
@
i
{
stdout
}
...
...
@@ -874,6 +878,20 @@ The most important tools in @file{userspace/tools} are the following:
for each port and for the RTU daemon. The @t{--help} option
lists all configuration items of the tool.
@item apply_dot-config
The script is used to apply @t{dot-config} settings to the
current configuration files. It is run at boot time before
any service is started. The @t{dot-config} mechanism is
documented in the @i{@sc{wrs} Users'
Manual
}.
@
item
change_dot
-
config
This
script
changes
the
current
@
t
{
dot
-
config
}
file
.
It
is
designed
to
be
the
back
-
end
of
the
web
interface
,
when
changing
configuration
items
.
The
script
does
nothing
to
@
i
{
apply
}
the
changes
,
and
it
only
performs
editing
.
It
is
the
responsibility
of
the
caller
to
ensure
the
proper
service
is
restarted
with
the
new
configuration
.
@
item
sdb
-
read
The
tool
,
copied
from
the
@
t
{
fpga
-
config
-
space
}
project
,
is
documented
in
the
next
section
,
...
...
userspace/rootfs_override/wr/bin/change_dot-config
0 → 100755
View file @
398172e2
#!/bin/sh
# Change a configuration item in dot-config. "=n" is special and it means
# the option is being unset. "=y" remains unquoted, all the rest is quoted.
# We still lack support for integers, not used in wrs' .config so far.
dotconfig
=
"/wr/etc/dot-config"
for
action
in
"
$*
"
;
do
# We accept both CONFIG_THIS= and THIS=
item
=
"CONFIG_
$(
echo
$action
|
cut
-d
=
-f
1 |
sed
's/^CONFIG_//'
)
"
value
=
$(
echo
$action
|
cut
-d
=
-f
2
)
if
[
"
$value
"
=
"n"
]
;
then
line
=
"#
$item
is not set"
else
if
[
"
$value
"
=
"y"
]
;
then
line
=
"
${
item
}
=y"
else
line
=
"
${
item
}
=
\"
$value
\"
"
fi
fi
# now, a config item may be a substring of another one: careful
sed
-i
-e
"/^
${
item
}
=/d"
-e
"/#
${
item
}
is/d"
$dotconfig
echo
$line
>>
$dotconfig
done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment