Skip to content

Commit f897a20

Browse files
committed
adding support for manual network configuration. addressed bug in issue googlecreativelab#51 to fix support for app import on windows.
1 parent 7a6130d commit f897a20

File tree

8 files changed

+250
-0
lines changed

8 files changed

+250
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
coder
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
auto lo
2+
3+
iface lo inet loopback
4+
5+
###
6+
# Set up ethernet to use dhcp
7+
###
8+
iface eth0 inet dhcp
9+
10+
###
11+
# Or comment the above and uncomment these
12+
# lines for a static IP address
13+
###
14+
#auto eth0
15+
#iface eth0 inet static
16+
# address 192.168.1.10
17+
# netmask 255.255.255.0
18+
# network 192.168.1.0
19+
# broadcast 192.168.1.255
20+
# gateway 192.168.1.1
21+
#
22+
23+
24+
allow-hotplug wlan0
25+
iface wlan0 inet manual
26+
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
27+
iface default inet dhcp
28+
29+
iface staticadhoc inet static
30+
address 192.168.0.1
31+
netmask 255.255.255.0
32+
network 192.168.0.0
33+
broadcast 192.168.0.255
34+
post-up /etc/init.d/isc-dhcp-server start
35+
pre-down /etc/init.d/isc-dhcp-server stop
36+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# To reset your coder password, make a copy of
2+
# this file and place it in /coder_settings/reset.txt
3+
4+
# On the next boot, your coder will reset its password
5+
# and start up with the configuration screen. None of your
6+
# programs will be removed.
7+
8+
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
#######################################################
2+
# Use this file to manually configure your Coder's WiFi
3+
# settings. You can also use this to set the config
4+
# network that Coder uses if it can't find a network.
5+
#
6+
# Instructions:
7+
# 1. Make a copy of this file into
8+
# /coder_settings/wpa_supplicant.txt
9+
# 2. Boot Coder with this SD Card. It will copy the
10+
# settings and then delete the file.
11+
#
12+
# NOTE: If you are experimenting, make a backup of
13+
# your changes, as the file will be deleted on boot.
14+
#######################################################
15+
16+
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
17+
update_config=1
18+
19+
20+
#################################
21+
# Default settings
22+
#################################
23+
24+
#####
25+
# This creates a device adhoc network if no connection is found.
26+
# Change ssid to something else to make Coder boot on another
27+
# Ad-hoc network if it can't find a WiFi connection.
28+
#####
29+
network={
30+
ssid="CoderConfig"
31+
mode=1
32+
key_mgmt=NONE
33+
id_str="staticadhoc"
34+
}
35+
36+
37+
38+
39+
40+
41+
42+
#######################################################
43+
# Sample settings for typical networks below
44+
#######################################################
45+
46+
47+
48+
49+
#
50+
# A typical encypted network using WPA
51+
#
52+
network={
53+
ssid="Network Name"
54+
psk="yourpassword"
55+
56+
# Change to 0 to enable
57+
disabled=1
58+
scan_ssid=1
59+
priority=4
60+
}
61+
62+
63+
#
64+
# An unencrypted network
65+
#
66+
network={
67+
ssid="Network Name"
68+
key_mgmt=NONE
69+
70+
# Change to 0 to enable
71+
disabled=1
72+
scan_ssid=1
73+
priority=3
74+
}
75+
76+
#
77+
# Older WEP network
78+
#
79+
network={
80+
ssid="Network Name"
81+
wep_key0="password"
82+
83+
# To use WEP hex code, comment out above and use without quotes
84+
# Example:
85+
# wep_key0=ABCDEF0102
86+
87+
# Change to 0 to enable
88+
disabled=1
89+
scan_ssid=1
90+
key_mgmt=NONE
91+
priority=3
92+
}
93+
94+
95+
96+
#
97+
# Enable to connect to any available open network
98+
#
99+
network={
100+
ssid=""
101+
scan_ssid=1
102+
key_mgmt=NONE
103+
auth_alg=OPEN
104+
priority=2
105+
id_str="anyopen"
106+
107+
# Change to 0 to enable
108+
disabled=1
109+
}
110+
111+
112+
113+
114+
115+

raspbian-addons/etc/init.d/pull-coder-reset

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,19 @@ source_wpa_conf="/etc/wpa_supplicant/wpa_supplicant.conf.reset"
1919
dest_wpa_conf="/etc/wpa_supplicant/wpa_supplicant.conf"
2020
source_device_json="/home/coder/coder-dist/coder-base/device.json.reset"
2121
dest_device_json="/home/coder/coder-dist/coder-base/device.json"
22+
source_net_interfaces="/etc/network/interfaces.reset"
23+
dest_net_interfaces="/etc/network/interfaces"
2224

2325
# copy from source to dest if source exists
2426
if [ -f $reset_file ]; then
2527
echo "-----RESET WPA_SUPPLICANT.CONF-----" | $logger
2628
cp $source_wpa_conf $dest_wpa_conf
2729
chown root:wpaconfig $dest_wpa_conf
2830
chmod 660 $dest_wpa_conf
31+
echo "-----RESET NETWORK INTERFACES-----" | $logger
32+
cp $source_net_interfaces $dest_net_interfaces
33+
chown root:root $dest_net_interfaces
34+
chmod 664 $dest_net_interfaces
2935
echo "-----RESET DEVICE.JSON-----" | $logger
3036
cp $source_device_json $dest_device_json
3137
chown coder $dest_device_json
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/sh
2+
3+
### BEGIN INIT INFO
4+
# Provides: pull-net-interfaces
5+
# Required-Start:
6+
# Required-Stop:
7+
# Should-Start:
8+
# Should-Stop:
9+
# Default-Start: S
10+
# Default-Stop:
11+
# Description: import /etc/network/interfaces from boot partition if it exists
12+
### END INIT INFO
13+
14+
prog=$(basename $0)
15+
logger="logger -t $prog"
16+
17+
source_conf="/boot/coder_settings/net_interfaces.txt"
18+
dest_conf="/etc/network/interfaces"
19+
20+
# copy from source to dest if source exists
21+
if [ -f $source_conf ]; then
22+
echo "-----IMPORTING NET INTERFACES FROM SD-----" | $logger
23+
cp $source_conf $dest_conf
24+
chown root:root $dest_conf
25+
chmod 664 $dest_conf
26+
rm -f $source_conf
27+
fi
28+
29+
30+

raspbian-addons/etc/network/interfaces

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
11
auto lo
22

33
iface lo inet loopback
4+
5+
###
6+
# Set up ethernet to use dhcp
7+
###
48
iface eth0 inet dhcp
59

10+
###
11+
# Or comment the above and uncomment these
12+
# lines for a static IP address
13+
###
14+
#auto eth0
15+
#iface eth0 inet static
16+
# address 192.168.1.10
17+
# netmask 255.255.255.0
18+
# network 192.168.1.0
19+
# broadcast 192.168.1.255
20+
# gateway 192.168.1.1
21+
#
22+
23+
624
allow-hotplug wlan0
725
iface wlan0 inet manual
826
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
auto lo
2+
3+
iface lo inet loopback
4+
5+
###
6+
# Set up ethernet to use dhcp
7+
###
8+
iface eth0 inet dhcp
9+
10+
###
11+
# Or comment the above and uncomment these
12+
# lines for a static IP address
13+
###
14+
#auto eth0
15+
#iface eth0 inet static
16+
# address 192.168.1.10
17+
# netmask 255.255.255.0
18+
# network 192.168.1.0
19+
# broadcast 192.168.1.255
20+
# gateway 192.168.1.1
21+
#
22+
23+
24+
allow-hotplug wlan0
25+
iface wlan0 inet manual
26+
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
27+
iface default inet dhcp
28+
29+
iface staticadhoc inet static
30+
address 192.168.0.1
31+
netmask 255.255.255.0
32+
network 192.168.0.0
33+
broadcast 192.168.0.255
34+
post-up /etc/init.d/isc-dhcp-server start
35+
pre-down /etc/init.d/isc-dhcp-server stop
36+

0 commit comments

Comments
 (0)