| … | |
… | |
| 188 | )) |
188 | )) |
| 189 | (ip_address, broadcast, netmask, gateway, dnsservers, http_proxy, ftp_proxy, rsync_proxy) = data[:-1].split('\n') |
189 | (ip_address, broadcast, netmask, gateway, dnsservers, http_proxy, ftp_proxy, rsync_proxy) = data[:-1].split('\n') |
| 190 | if code != self._DLG_OK: |
190 | if code != self._DLG_OK: |
| 191 | return |
191 | return |
| 192 | #Set the info now that it's all gathered. |
192 | #Set the info now that it's all gathered. |
|
|
193 | if network_type == "dhcp": |
|
|
194 | if dhcp_options: |
|
|
195 | status = GLIUtility.spawn("/sbin/dhcpcd -t 15 " + dhcp_options + " " + interface) |
|
|
196 | else: |
|
|
197 | status = GLIUtility.spawn("/sbin/dhcpcd -t 15 -n " + interface) |
|
|
198 | if not GLIUtility.exitsuccess(status): |
|
|
199 | self._d.msgbox("ERROR: Could not run dhcpcd command!") #FIXME LANGUAGE |
|
|
200 | elif network_type == "static": |
|
|
201 | # Configure the network from the settings they gave. |
|
|
202 | if not GLIUtility.set_ip(interface, ip_address, broadcast, netmask): |
|
|
203 | self._d.msgbox("ERROR: Could not set the IP address!") #FIXME LANGUAGE |
|
|
204 | |
|
|
205 | if not GLIUtility.set_default_route(gateway): |
|
|
206 | self._d.msgbox("ERROR: Could not set the default route!") #FIXME LANGUAGE |
|
|
207 | |
|
|
208 | if dns_servers: |
| 193 | try: |
209 | try: |
| 194 | #FIXME REPLACE WITH REAL NETWORKING CODE |
210 | resolv_conf = open("/etc/resolv.conf", "w") |
| 195 | status = GLIUtility.configure_networking(network_type, interface, ip_address, broadcast, netmask, gateway, dnsservers, dhcp_options, http_proxy, ftp_proxy, rsync_proxy) |
211 | for dns_server in dns_servers: |
| 196 | if not status: |
212 | resolv_conf.write("nameserver " + dns_server + "\n") |
|
|
213 | resolv_conf.close() |
|
|
214 | except: |
|
|
215 | self._d.msgbox("ERROR: Could not set the DNS servers!") #FIXME LANGUAGE |
|
|
216 | |
|
|
217 | if ftp_proxy and ftp_proxy != "": |
|
|
218 | os.environ['ftp_proxy'] = ftp_proxy |
|
|
219 | |
|
|
220 | if http_proxy and http_proxy != "": |
|
|
221 | os.environ['http_proxy'] = http_proxy |
|
|
222 | |
|
|
223 | if rsync_proxy and rsync_proxy != "": |
|
|
224 | os.environ['RSYNC_PROXY'] = rsync_proxy |
|
|
225 | |
|
|
226 | #Test the connection to make sure everything worked. |
|
|
227 | if ping("www.gentoo.org"): |
|
|
228 | return True |
|
|
229 | else: |
| 197 | fatal(_(u"Sorry, but the network could not be set up successfully. Please configure yourself manually and restart the installer.")) |
230 | fatal(_(u"Sorry, but the network could not be set up successfully. Please configure yourself manually and restart the installer.")) |
| 198 | except: |
|
|
| 199 | self._d.msgbox(_(u"ERROR! Could not setup networking!")) |
|
|
| 200 | #FIXME ask if want to networkless or abort. |
|
|
| 201 | |
231 | |
| 202 | def set_enable_ssh(self): |
232 | def set_enable_ssh(self): |
| 203 | #Change the Yes/No buttons back. |
233 | #Change the Yes/No buttons back. |
| 204 | self._d.add_persistent_args(["--yes-label", _(u"Yes")]) |
234 | self._d.add_persistent_args(["--yes-label", _(u"Yes")]) |
| 205 | self._d.add_persistent_args(["--no-label", _(u"No")]) |
235 | self._d.add_persistent_args(["--no-label", _(u"No")]) |
| … | |
… | |
| 1137 | if not self.advanced_mode: |
1167 | if not self.advanced_mode: |
| 1138 | boot_string3 = boot_string3_std + boot_string3 |
1168 | boot_string3 = boot_string3_std + boot_string3 |
| 1139 | if not boot_drive_choices: |
1169 | if not boot_drive_choices: |
| 1140 | self._d.msgbox(_(u"ERROR: No drives set up. Please complete the Partitioning screen first!")) |
1170 | self._d.msgbox(_(u"ERROR: No drives set up. Please complete the Partitioning screen first!")) |
| 1141 | return |
1171 | return |
| 1142 | code, boot_drive_choice = self._d.menu(boot_string3, choices=self._dmenu_list_to_choices(boot_drive_choices), height=16, width=70) |
1172 | code, boot_drive_choice = self._d.menu(boot_string3, choices=boot_drive_choices, height=16, width=70) |
| 1143 | if code != self._DLG_OK: |
1173 | if code != self._DLG_OK: |
| 1144 | return |
1174 | return |
| 1145 | boot_drive_choice = boot_drive_choices[int(boot_drive_choice)-1] |
|
|
| 1146 | try: |
1175 | try: |
| 1147 | self._install_profile.set_boot_device(None,boot_drive_choice,None) |
1176 | self._install_profile.set_boot_device(None,boot_drive_choice,None) |
| 1148 | except: |
1177 | except: |
| 1149 | self._d.msgbox(_(u"ERROR! Could not set the boot device!")+boot_drive_choice) |
1178 | self._d.msgbox(_(u"ERROR! Could not set the boot device!")+boot_drive_choice) |
| 1150 | if self.advanced_mode: |
1179 | if self.advanced_mode: |