summaryrefslogtreecommitdiffstats
path: root/etc/rc.bootup
diff options
context:
space:
mode:
authorAndrew Thompson <andrew@clonedev.co.nz>2011-08-17 14:15:18 +1200
committerAndrew Thompson <andrew@clonedev.co.nz>2011-08-17 14:15:18 +1200
commit7734aea648d609bbdf308d97f85d7d089c831d6f (patch)
tree44b364f02f771f54a5350c226459886068a3361a /etc/rc.bootup
parent8f9bffbc987a072b7d266011396726489ed92450 (diff)
downloadpfsense-7734aea648d609bbdf308d97f85d7d089c831d6f.zip
pfsense-7734aea648d609bbdf308d97f85d7d089c831d6f.tar.gz
Make initial changes to allow pfSense to work in a jail.
This mostly avoids starting things that will not work and gets the initial config. Most of the pfSense functionality will not work (pf rules, routing, etc) but it can be used for testing.
Diffstat (limited to 'etc/rc.bootup')
-rwxr-xr-xetc/rc.bootup55
1 files changed, 41 insertions, 14 deletions
diff --git a/etc/rc.bootup b/etc/rc.bootup
index c1749cf..e224519 100755
--- a/etc/rc.bootup
+++ b/etc/rc.bootup
@@ -157,21 +157,48 @@ echo "Loading configuration...";
parse_config_bootup();
echo "done.\n";
-/*
- * Determine if we need to throw a interface exception
- * and ask the user to reassign interfaces. This will
- * avoid a reboot and thats a good thing.
- */
-while(is_interface_mismatch() == true) {
- led_assigninterfaces();
- echo "\nNetwork interface mismatch -- Running interface assignment option.\n";
- $ifaces = get_interface_list();
- if (is_array($ifaces)) {
- foreach($ifaces as $iface => $ifdata)
- interfaces_bring_up($iface);
+if($g['platform'] == "jail") {
+ /* We must determine what network settings have been configured for us */
+ $wanif = "lo0"; /* defaults, if the jail admin hasn't set us up */
+ $ipaddr = "127.0.0.1";
+ $iflist = get_interface_list();
+ foreach ($iflist as $iface => $ifa) {
+ if (isset($ifa['ipaddr'])) {
+ $wanif = $iface;
+ $ipaddr = $ifa['ipaddr'];
+ break;
+ }
+ }
+ $config['interfaces'] = array();
+ $config['interfaces']['lan'] = array();
+ $config['interfaces']['lan']['enable'] = false;
+ $config['interfaces']['wan'] = array();
+ /* XXX, todo */
+ $config['interfaces']['wan']['if'] = $wanif;
+ $config['interfaces']['wan']['ipaddr'] = $ipaddr;
+ $config['interfaces']['wan']['subnet'] = "32"; /* XXX right? */
+ $config['interfaces']['wan']['enable'] = true;
+ if($config['dhcpd']['lan'])
+ unset($config['dhcpd']['lan']['enable']);
+ unlink_if_exists('/conf/trigger_initial_wizard');
+ write_config();
+} else {
+ /*
+ * Determine if we need to throw a interface exception
+ * and ask the user to reassign interfaces. This will
+ * avoid a reboot and thats a good thing.
+ */
+ while(is_interface_mismatch() == true) {
+ led_assigninterfaces();
+ echo "\nNetwork interface mismatch -- Running interface assignment option.\n";
+ $ifaces = get_interface_list();
+ if (is_array($ifaces)) {
+ foreach($ifaces as $iface => $ifdata)
+ interfaces_bring_up($iface);
+ }
+ set_networking_interfaces_ports();
+ led_kitt();
}
- set_networking_interfaces_ports();
- led_kitt();
}
/* convert config and clean backups */
OpenPOWER on IntegriCloud