diff options
author | Andrew Thompson <andrew@clonedev.co.nz> | 2011-08-17 14:15:18 +1200 |
---|---|---|
committer | Andrew Thompson <andrew@clonedev.co.nz> | 2011-08-17 14:15:18 +1200 |
commit | 7734aea648d609bbdf308d97f85d7d089c831d6f (patch) | |
tree | 44b364f02f771f54a5350c226459886068a3361a /etc/rc | |
parent | 8f9bffbc987a072b7d266011396726489ed92450 (diff) | |
download | pfsense-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')
-rwxr-xr-x | etc/rc | 56 |
1 files changed, 33 insertions, 23 deletions
@@ -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 |