summaryrefslogtreecommitdiffstats
path: root/etc/rc
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
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')
-rwxr-xr-xetc/rc56
1 files changed, 33 insertions, 23 deletions
diff --git a/etc/rc b/etc/rc
index 0070dff..d8fc9a5 100755
--- a/etc/rc
+++ b/etc/rc
@@ -80,12 +80,14 @@ if [ ! "$PLATFORM" = "cdrom" ] ; then
fi
fi
-# Check to see if a compact flash mountpoint exists
-# If it fails to mount then run a fsck -fy
-if grep -q cf /etc/fstab; then
- /sbin/mount -w /cf 2>/dev/null
- /sbin/mount -uw /cf || \
- (/sbin/umount /cf; /sbin/fsck -fy /cf; /sbin/mount -w /cf)
+if [ ! "$PLATFORM" = "jail" ]; then
+ # Check to see if a compact flash mountpoint exists
+ # If it fails to mount then run a fsck -fy
+ if grep -q cf /etc/fstab; then
+ /sbin/mount -w /cf 2>/dev/null
+ /sbin/mount -uw /cf || \
+ (/sbin/umount /cf; /sbin/fsck -fy /cf; /sbin/mount -w /cf)
+ fi
fi
# sync pw database after mount.
@@ -109,8 +111,10 @@ echo
echo "Welcome to ${product} ${version} ${platformbanner} ..."
echo
-# Enable console output if its muted.
-/sbin/conscontrol mute off >/dev/null
+if [ ! "$PLATFORM" = "jail" ]; then
+ # Enable console output if its muted.
+ /sbin/conscontrol mute off >/dev/null
+fi
if [ "$PLATFORM" = "cdrom" ] ; then
# do nothing for cdrom platform
@@ -121,6 +125,8 @@ elif [ "$PLATFORM" = "nanobsd" ] ; then
/bin/mkdir -p /root/var/db/pkg
/bin/rm -rf /var/db/pkg
/bin/ln -s /root/var/db/pkg/ /var/db/pkg
+elif [ "$PLATFORM" = "jail" ]; then
+ # do nothing for jail platform
else
SWAPDEVICE=`/bin/cat /etc/fstab | /usr/bin/grep swap | /usr/bin/cut -f1`
/sbin/swapon -a 2>/dev/null >/dev/null
@@ -302,9 +308,11 @@ fi
/bin/chmod 0600 /var/log/*.log
echo -n "."
-DEVFS=`/sbin/mount | /usr/bin/grep devfs | /usr/bin/wc -l | /usr/bin/cut -d" " -f8`
-if [ "$DEVFS" = "0" ]; then
- mount_devfs devfs /dev
+if [ ! "$PLATFORM" = "jail" ]; then
+ DEVFS=`/sbin/mount | /usr/bin/grep devfs | /usr/bin/wc -l | /usr/bin/cut -d" " -f8`
+ if [ "$DEVFS" = "0" ]; then
+ mount_devfs devfs /dev
+ fi
fi
# Create an initial utmp file
@@ -318,18 +326,20 @@ if [ -f /etc/rc.conf ]; then
/bin/rm -rf /etc/rc.conf
fi
-# Launching kbdmux(4)
-if [ -f "/dev/kbdmux0" ]; then
- echo -n "."
- /usr/sbin/kbdcontrol -k /dev/kbdmux0 < /dev/console
- [ -c "/dev/atkbd0" ] && kbdcontrol -a atkbd0 < /dev/console
- [ -c "/dev/ukbd0" ] && kbdcontrol -a ukbd0 < /dev/console
-fi
+if [ ! "$PLATFORM" = "jail" ]; then
+ # Launching kbdmux(4)
+ if [ -f "/dev/kbdmux0" ]; then
+ echo -n "."
+ /usr/sbin/kbdcontrol -k /dev/kbdmux0 < /dev/console
+ [ -c "/dev/atkbd0" ] && kbdcontrol -a atkbd0 < /dev/console
+ [ -c "/dev/ukbd0" ] && kbdcontrol -a ukbd0 < /dev/console
+ fi
-# Fire up unionfs if mount points exist.
-if [ -f /dist/uniondirs ]; then
- echo -n "."
- /etc/rc.d/unionfs start
+ # Fire up unionfs if mount points exist.
+ if [ -f /dist/uniondirs ]; then
+ echo -n "."
+ /etc/rc.d/unionfs start
+ fi
fi
echo "done."
@@ -411,6 +421,6 @@ echo "Bootup complete"
/usr/local/bin/beep.sh start 2>&1 >/dev/null
# Reset the cache. read-only requires this.
-/bin/rm /tmp/config.cache
+/bin/rm -f /tmp/config.cache
exit 0
OpenPOWER on IntegriCloud