Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
lede-mikrotik
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johannes Rudolph
lede-mikrotik
Commits
4f6c58ad
Commit
4f6c58ad
authored
13 years ago
by
Gabor Juhos
Browse files
Options
Downloads
Patches
Plain Diff
ramips: use /lib/functions/uci-defaults.sh
SVN-Revision: 29386
parent
39348e38
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
target/linux/ramips/base-files/etc/uci-defaults/network
+12
-26
12 additions, 26 deletions
target/linux/ramips/base-files/etc/uci-defaults/network
with
12 additions
and
26 deletions
target/linux/ramips/base-files/etc/uci-defaults/network
+
12
−
26
View file @
4f6c58ad
...
...
@@ -2,23 +2,13 @@
.
/etc/functions.sh
.
/lib/ramips.sh
.
/lib/functions/uci-defaults.sh
if
[
!
-x
/usr/sbin/maccalc
]
;
then
echo
"
$0
: maccalc not found!"
return
fi
create_lan_wan
()
{
uci batch
<<
EOF
set network.lan.ifname=eth0.1
set network.wan=interface
set network.wan.ifname=eth0.2
set network.wan.proto=dhcp
commit network
EOF
}
get_mac_binary
()
{
local
mtdname
=
"
$1
"
...
...
@@ -52,32 +42,24 @@ get_mac_nvram()
maccalc add
"
$mac_dirty
"
0
}
set_interface_mac
()
{
local
iface
=
"
$1
"
local
mac
=
"
$2
"
uci batch
<<
EOF
set network.
$iface
.macaddr=""
$mac
"
commit network
EOF
}
ramips_setup_interfaces
()
{
local
board
=
"
$1
"
ucidef_set_interface_loopback
case
$board
in
argus-atp52b
|
\
b2c
|
\
f5d8235-v2
|
\
nw718
)
create_lan_wan
ucidef_set_interfaces_lan_wan
"eth0.1 eth0.2"
;;
*
)
RT3X5X
=
`
cat
/proc/cpuinfo |
grep
RT3.5
`
[
-z
"
${
RT3X5X
}
"
]
||
create_lan_wan
[
-z
"
${
RT3X5X
}
"
]
||
\
ucidef_set_interfaces_lan_wan
"eth0.1 eth0.2"
;;
esac
}
...
...
@@ -102,11 +84,15 @@ ramips_setup_macs()
;;
esac
[
-n
$lan_mac
]
&&
set_interface_mac lan
$lan_mac
[
-n
$wan_mac
]
&&
set_interface_mac wan
$wan_mac
[
-n
$lan_mac
]
&&
ucidef_
set_interface_mac
addr
lan
$lan_mac
[
-n
$wan_mac
]
&&
ucidef_
set_interface_mac
addr
wan
$wan_mac
}
board
=
$(
ramips_board_name
)
ramips_setup_interfaces
$board
ramips_setup_macs
$board
uci commit network
exit
0
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment