Project

General

Profile

« Previous | Next » 

Revision a26d9538

Added by Andrew Thompson about 14 years ago

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.

View differences:

etc/rc
80 80
	fi
81 81
fi
82 82

  
83
# Check to see if a compact flash mountpoint exists
84
# If it fails to mount then run a fsck -fy
85
if grep -q cf /etc/fstab; then
86
	/sbin/mount -w /cf 2>/dev/null
87
    /sbin/mount -uw /cf || \
88
	(/sbin/umount /cf; /sbin/fsck -fy /cf; /sbin/mount -w /cf)
83
if [ ! "$PLATFORM" = "jail" ]; then
84
	# Check to see if a compact flash mountpoint exists
85
	# If it fails to mount then run a fsck -fy
86
	if grep -q cf /etc/fstab; then
87
		/sbin/mount -w /cf 2>/dev/null
88
		/sbin/mount -uw /cf || \
89
			(/sbin/umount /cf; /sbin/fsck -fy /cf; /sbin/mount -w /cf)
90
	fi
89 91
fi
90 92

  
91 93
# sync pw database after mount.
......
109 111
echo "Welcome to ${product} ${version} ${platformbanner} ..."
110 112
echo
111 113

  
112
# Enable console output if its muted.
113
/sbin/conscontrol mute off >/dev/null
114
if [ ! "$PLATFORM" = "jail" ]; then
115
	# Enable console output if its muted.
116
	/sbin/conscontrol mute off >/dev/null
117
fi
114 118

  
115 119
if [ "$PLATFORM" = "cdrom" ] ; then
116 120
	# do nothing for cdrom platform
......
121 125
	/bin/mkdir -p /root/var/db/pkg
122 126
	/bin/rm -rf /var/db/pkg
123 127
	/bin/ln -s /root/var/db/pkg/ /var/db/pkg
128
elif [ "$PLATFORM" = "jail" ]; then
129
	# do nothing for jail platform
124 130
else
125 131
	SWAPDEVICE=`/bin/cat /etc/fstab | /usr/bin/grep swap | /usr/bin/cut -f1`
126 132
	/sbin/swapon -a 2>/dev/null >/dev/null
......
302 308
/bin/chmod 0600 /var/log/*.log
303 309

  
304 310
echo -n "."
305
DEVFS=`/sbin/mount | /usr/bin/grep devfs | /usr/bin/wc -l | /usr/bin/cut -d" " -f8`
306
if [ "$DEVFS" = "0" ]; then
307
    mount_devfs devfs /dev
311
if [ ! "$PLATFORM" = "jail" ]; then
312
	DEVFS=`/sbin/mount | /usr/bin/grep devfs | /usr/bin/wc -l | /usr/bin/cut -d" " -f8`
313
	if [ "$DEVFS" = "0" ]; then
314
		mount_devfs devfs /dev
315
	fi
308 316
fi
309 317

  
310 318
# Create an initial utmp file
......
318 326
    /bin/rm -rf /etc/rc.conf
319 327
fi
320 328

  
321
# Launching kbdmux(4)
322
if [ -f "/dev/kbdmux0" ]; then
323
	echo -n "."
324
	/usr/sbin/kbdcontrol -k /dev/kbdmux0 < /dev/console
325
	[ -c "/dev/atkbd0" ] && kbdcontrol -a atkbd0 < /dev/console
326
	[ -c "/dev/ukbd0" ] && kbdcontrol -a ukbd0 < /dev/console
327
fi
329
if [ ! "$PLATFORM" = "jail" ]; then
330
	# Launching kbdmux(4)
331
	if [ -f "/dev/kbdmux0" ]; then
332
		echo -n "."
333
		/usr/sbin/kbdcontrol -k /dev/kbdmux0 < /dev/console
334
		[ -c "/dev/atkbd0" ] && kbdcontrol -a atkbd0 < /dev/console
335
		[ -c "/dev/ukbd0" ] && kbdcontrol -a ukbd0 < /dev/console
336
	fi
328 337

  
329
# Fire up unionfs if mount points exist.
330
if [ -f /dist/uniondirs ]; then
331
	echo -n "."
332
	/etc/rc.d/unionfs start
338
	# Fire up unionfs if mount points exist.
339
	if [ -f /dist/uniondirs ]; then
340
		echo -n "."
341
		/etc/rc.d/unionfs start
342
	fi
333 343
fi
334 344

  
335 345
echo "done."
......
411 421
/usr/local/bin/beep.sh start 2>&1 >/dev/null
412 422

  
413 423
# Reset the cache.  read-only requires this.
414
/bin/rm /tmp/config.cache
424
/bin/rm -f /tmp/config.cache
415 425

  
416 426
exit 0

Also available in: Unified diff