diff options
Diffstat (limited to 'src/etc/rc')
-rwxr-xr-x | src/etc/rc | 30 |
1 files changed, 16 insertions, 14 deletions
@@ -159,23 +159,25 @@ echo /sbin/conscontrol mute off >/dev/null -if [ "$PLATFORM" = "cdrom" ] ; then - # do nothing for cdrom platform -elif [ "$PLATFORM" = "nanobsd" ] || [ ${USE_MFS_TMPVAR} -gt 0 ]; then - # Ensure that old-style PKG packages can be persistent across reboots - /bin/mkdir -p /root/var/db/pkg - /bin/rm -rf /var/db/pkg - /bin/ln -s /root/var/db/pkg/ /var/db/pkg -else +if [ "$PLATFORM" = "pfSense" ]; then + # If use MFS var is disabled, move files back to place + if [ ${USE_MFS_TMPVAR} -eq 0 -a -d /root/var/db/pkg ]; then + rm -rf /var/db/pkg 2>/dev/null + rm -rf /var/cache/pkg 2>/dev/null + mv /root/var/db/pkg /var/db + mv /root/var/cache/pkg /var/cache + # If use MFS var is enabled, move files to a safe place + elif [ ${USE_MFS_TMPVAR} -gt 0 -a ! -d /root/var/db/pkg ]; then + /bin/mkdir -p /root/var/db /root/var/cache + mv /var/db/pkg /root/var/db + mv /var/cache/pkg /root/var/cache + ln -sf ../../root/var/db/pkg /var/db/pkg + ln -sf ../../root/var/cache/pkg /var/cache/pkg + fi + SWAPDEVICE=`/bin/cat /etc/fstab | /usr/bin/grep swap | /usr/bin/cut -f1` /sbin/swapon -a 2>/dev/null >/dev/null /etc/rc.savecore - - if [ -d /root/var/db/pkg ]; then - # User must have just disabled RAM disks, move these back into place. - /bin/mkdir -p /var/db/pkg - /bin/mv /root/var/db/pkg /var/db/pkg - fi fi if [ "$PLATFORM" = "cdrom" ] ; then |