summaryrefslogtreecommitdiffstats
path: root/etc/rc
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-04-05 15:25:42 -0300
committerRenato Botelho <garga@FreeBSD.org>2013-04-05 15:25:42 -0300
commit730790dd972414dc93d687697edd75ab173e0d43 (patch)
treeb13f636e345249737e58ee7b41ae7383b8ddd4b6 /etc/rc
parentceb09a8cd77e5c308a93e7383e9f316f5a645a5f (diff)
downloadpfsense-730790dd972414dc93d687697edd75ab173e0d43.zip
pfsense-730790dd972414dc93d687697edd75ab173e0d43.tar.gz
Only check tunefs status when it's necessary, it avoids errors on iso boot. Fixes #2932
Diffstat (limited to 'etc/rc')
-rwxr-xr-xetc/rc38
1 files changed, 20 insertions, 18 deletions
diff --git a/etc/rc b/etc/rc
index a2f8cf3..7598baf 100755
--- a/etc/rc
+++ b/etc/rc
@@ -39,25 +39,27 @@ if [ -e /root/force_fsck ]; then
fi
fi
-TUNEFS_STATUS=`/sbin/tunefs -p / 2>&1 | /usr/bin/grep trim: | /usr/bin/awk '{print $4;}'`
-if [ -e /root/TRIM_set ] && [ "${TUNEFS_STATUS}" = "disabled" ]; then
- echo "Enabling TRIM support"
- /sbin/tunefs -t enable /
- if [ "$PLATFORM" = "nanobsd" ]; then
- /sbin/tunefs -t enable /cf
- fi
- echo "Rebooting in 5 seconds after enabling TRIM..."
- sleep 5
- /sbin/reboot
-elif [ -e /root/TRIM_unset ] && [ "${TUNEFS_STATUS}" = "enabled" ]; then
- echo "Disabling TRIM support"
- /sbin/tunefs -t disable /
- if [ "$PLATFORM" = "nanobsd" ]; then
- /sbin/tunefs -t disable /cf
+if [ -e /root/TRIM_set -o -e /root/TRIM_unset ]; then
+ TUNEFS_STATUS=`/sbin/tunefs -p / 2>&1 | /usr/bin/grep trim: | /usr/bin/awk '{print $4;}'`
+ if [ -e /root/TRIM_set ] && [ "${TUNEFS_STATUS}" = "disabled" ]; then
+ echo "Enabling TRIM support"
+ /sbin/tunefs -t enable /
+ if [ "$PLATFORM" = "nanobsd" ]; then
+ /sbin/tunefs -t enable /cf
+ fi
+ echo "Rebooting in 5 seconds after enabling TRIM..."
+ sleep 5
+ /sbin/reboot
+ elif [ -e /root/TRIM_unset ] && [ "${TUNEFS_STATUS}" = "enabled" ]; then
+ echo "Disabling TRIM support"
+ /sbin/tunefs -t disable /
+ if [ "$PLATFORM" = "nanobsd" ]; then
+ /sbin/tunefs -t disable /cf
+ fi
+ echo "Rebooting in 5 seconds after disabling TRIM..."
+ sleep 5
+ /sbin/reboot
fi
- echo "Rebooting in 5 seconds after disabling TRIM..."
- sleep 5
- /sbin/reboot
fi
# Mount memory file system if it exists
OpenPOWER on IntegriCloud