Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFS Gluon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
firmware
FFS Gluon
Commits
6d5e47ee
Commit
6d5e47ee
authored
11 years ago
by
Matthias Schiffer
Browse files
Options
Downloads
Patches
Plain Diff
gluon-config-mode: respect switch configuration
parent
33698020
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
package/gluon-config-mode/files/etc/init.d/gluon-config-mode
+34
-6
34 additions, 6 deletions
package/gluon-config-mode/files/etc/init.d/gluon-config-mode
with
34 additions
and
6 deletions
package/gluon-config-mode/files/etc/init.d/gluon-config-mode
+
34
−
6
View file @
6d5e47ee
...
@@ -3,13 +3,22 @@
...
@@ -3,13 +3,22 @@
START
=
12
START
=
12
config_mode_iface
=
eth0
config_mode_addr
=
192.168.1.1
config_mode_addr
=
192.168.1.1
config_mode_
plen
=
24
config_mode_
netmask
=
255.255.255.0
config_mode_dnsname
=
freifunk
config_mode_dnsname
=
freifunk
config_mode_dhcp_range
=
192.168.1.2,192.168.1.254
config_mode_dhcp_range
=
192.168.1.2,192.168.1.254
.
/lib/functions.sh
.
/lib/gluon/functions/sysconfig.sh
delete_interface
()
{
[
"
$1
"
=
'loopback'
]
||
uci_remove network
"
$1
"
}
check_enable
()
{
check_enable
()
{
config_get enabled
"
$1
"
enabled
config_get enabled
"
$1
"
enabled
config_get configured
"
$1
"
configured
config_get configured
"
$1
"
configured
...
@@ -29,8 +38,27 @@ start() {
...
@@ -29,8 +38,27 @@ start() {
uci
set
'gluon-config-mode.@wizard[0].enabled=0'
uci
set
'gluon-config-mode.@wizard[0].enabled=0'
uci commit gluon-config-mode
uci commit gluon-config-mode
ip addr add
$config_mode_addr
/
$config_mode_plen
dev
$config_mode_iface
mkdir
-p
/var/gluon/config-mode/config
ip
link set
up dev
$config_mode_iface
mount
-o
bind
/etc/config /var/gluon/config-mode/config
touch
/var/gluon/config-mode/wireless
mount
-o
bind
/var/gluon/config-mode/wireless /etc/config/wireless
cp
/etc/config/network /var/gluon/config-mode
mount
-o
bind
/var/gluon/config-mode/network /etc/config/network
config_load network
config_foreach delete_interface interface
uci_add network interface config
uci_set network config ifname
"
$(
sysconfig lan_ifname
||
sysconfig wan_ifname
)
"
uci_set network config
type
'bridge'
uci_set network config proto
'static'
uci_set network config ipaddr
"
$config_mode_addr
"
uci_set network config netmask
"
$config_mode_netmask
"
uci_commit network
/etc/init.d/network start
/usr/sbin/telnetd
-l
/lib/gluon/config-mode/ash-login
/usr/sbin/telnetd
-l
/lib/gluon/config-mode/ash-login
/etc/init.d/dropbear start
/etc/init.d/dropbear start
...
@@ -42,8 +70,8 @@ start() {
...
@@ -42,8 +70,8 @@ start() {
# correctly finish firstboot
# correctly finish firstboot
/etc/init.d/done boot
/etc/init.d/done boot
echo
"
$config_mode_addr
$config_mode_dnsname
"
>
/
tmp/hosts.
gluon
-
config-mode
echo
"
$config_mode_addr
$config_mode_dnsname
"
>
/
var/
gluon
/
config-mode
/hosts
dnsmasq
-h
-H
/
tmp/hosts.
gluon
-
config-mode
-R
-F
interface:
$
config
_mode_iface
,
$config_mode_dhcp_range
-l
/tmp/dhcp.leases
-O
option:router
dnsmasq
-h
-H
/
var/
gluon
/
config-mode
/hosts
-R
-F
interface:
br-
config,
$config_mode_dhcp_range
-l
/tmp/dhcp.leases
-O
option:router
.
/etc/diag.sh
.
/etc/diag.sh
get_status_led
get_status_led
...
...
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