summaryrefslogtreecommitdiffstats
path: root/etc/rc.bootup
diff options
context:
space:
mode:
authorAndrew Thompson <andrew@clonedev.co.nz>2011-08-17 14:07:20 +1200
committerAndrew Thompson <andrew@clonedev.co.nz>2011-08-17 14:07:20 +1200
commita26d95383a6146734f67c9db21cd83534052843a (patch)
treeb1d1e008b6bd84f7c76d0e1b4d9a1d478347a9af /etc/rc.bootup
parent487830da860f9ba44c4daf83df2c5903400aaa53 (diff)
downloadpfsense-a26d95383a6146734f67c9db21cd83534052843a.zip
pfsense-a26d95383a6146734f67c9db21cd83534052843a.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