mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-17 01:54:49 +00:00
rc: enable soft updates and TRIM (when available)
This commit is contained in:
parent
75cf7115a0
commit
44b610abb1
17
src/etc/rc
17
src/etc/rc
@ -19,6 +19,23 @@ export HOME PATH
|
||||
|
||||
echo "Mounting filesystems..."
|
||||
|
||||
while read FS_PART FS_MNT FS_TYPE FS_MORE; do
|
||||
# only tune our own file systems
|
||||
if [ "${FS_TYPE}" != "ufs" ]; then
|
||||
continue;
|
||||
fi
|
||||
|
||||
# enables soft updates
|
||||
tunefs -n enable ${FS_PART}
|
||||
|
||||
# enables TRIM
|
||||
FS_DEV=$(echo ${FS_PART} | awk 'match($0, /\/dev\/([a-z]+[0-9]+)/) { print substr( $0, RSTART, RLENGTH )}')
|
||||
FS_TRIM=$(camcontrol identify ${FS_DEV} | grep TRIM | awk '{ print $5; }')
|
||||
if [ "${FS_TRIM}" = "yes" ]; then
|
||||
tunefs -t enable ${FS_PART}
|
||||
fi
|
||||
done < /etc/fstab
|
||||
|
||||
attempts=0
|
||||
while [ ${attempts} -lt 3 ]; do
|
||||
if mount -a 2>/dev/null; then
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user