Skip to content

Commit ec7a164

Browse files
jmstriegelCoder daemon
authored and
Coder daemon
committed
boot scripts updated to give sdcard configurable options for setting hostname and config network
1 parent 6a552d6 commit ec7a164

File tree

5 files changed

+139
-10
lines changed

5 files changed

+139
-10
lines changed

raspbian-addons/etc/dhcp/dhcpd.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ log-facility local7;
3131
#}
3232

3333
subnet 192.168.0.0 netmask 255.255.255.0 {
34-
range 192.168.0.20 192.168.0.30;
34+
range 192.168.0.20 192.168.0.200;
3535
}
3636

3737
# This is a very basic subnet declaration.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
prog=$(basename $0)
1515
logger="logger -t $prog"
1616

17-
reset_file="/boot/reset.txt"
17+
reset_file="/boot/coder_settings/reset.txt"
1818
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"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/sh
2+
3+
### BEGIN INIT INFO
4+
# Provides: pull-hostname
5+
# Required-Start:
6+
# Required-Stop:
7+
# Should-Start:
8+
# Should-Stop:
9+
# Default-Start: S
10+
# Default-Stop:
11+
# Description: import hostname 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/hostname.txt"
18+
dest_conf="/etc/hostname"
19+
20+
21+
# copy from source to dest if source exists
22+
if [ -f $source_conf ]; then
23+
echo "-----IMPORTING WPA_SUPPLICANT.CONF FROM SD-----" | $logger
24+
cp $source_conf $dest_conf
25+
chown root:root $dest_conf
26+
chmod 644 $dest_conf
27+
28+
HOSTNAME="$(cat /etc/hostname)"
29+
hostname "$HOSTNAME"
30+
31+
# Should we delete or re-import every time?
32+
# Opting to import every time.
33+
# rm -f $source_conf
34+
fi
35+
36+
37+

raspbian-addons/etc/init.d/pull-wpa-supplicant

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
prog=$(basename $0)
1515
logger="logger -t $prog"
1616

17-
source_conf="/boot/wpa_supplicant.conf"
17+
source_conf="/boot/coder_settings/wpa_supplicant.txt"
1818
dest_conf="/etc/wpa_supplicant/wpa_supplicant.conf"
1919

2020
# copy from source to dest if source exists
Lines changed: 99 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,116 @@
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+
116
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
217
update_config=1
318

419

20+
#################################
21+
# Default settings
22+
#################################
523

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+
#####
629
network={
7-
ssid=""
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
858
scan_ssid=1
59+
priority=4
60+
}
61+
62+
63+
#
64+
# An unencrypted network
65+
#
66+
network={
67+
ssid="Network Name"
968
key_mgmt=NONE
10-
auth_alg=OPEN
11-
priority=2
69+
70+
# Change to 0 to enable
1271
disabled=1
13-
id_str="anyopen"
72+
scan_ssid=1
73+
priority=3
1474
}
1575

76+
#
77+
# Older WEP network
78+
#
1679
network={
17-
ssid="CoderConfig"
18-
mode=1
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
1990
key_mgmt=NONE
20-
id_str="staticadhoc"
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
21109
}
22110

23111

24112

113+
114+
115+
116+

0 commit comments

Comments
 (0)