Add support for automatically computing the required file system

size and average inode size.

Reviewed by:	jhb
This commit is contained in:
Ruslan Ermilov 2003-08-08 18:23:00 +00:00
parent c8d9e00aca
commit ebc9df0362
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=118667

View File

@ -17,6 +17,18 @@ FSPROTO=$1 ; shift
FSINODE=$1 ; shift FSINODE=$1 ; shift
FSLABEL=$1 ; shift FSLABEL=$1 ; shift
#
# If we've been told to, compute the required file system size
# and average inode size automatically.
#
if [ ${FSSIZE} -eq 0 -a ${FSLABEL} = "auto" ]; then
roundup() echo $((($1+$2-1)-($1+$2-1)%$2))
nf=$(find ${FSPROTO} |wc -l)
sk=$(du -sk ${FSPROTO} |cut -f1)
FSINODE=$(roundup $(($sk*1024/$nf)) ${FSINODE})
FSSIZE=$(roundup $(($sk*12/10)) 1024)
fi
# #
# We don't have any bootblocks on ia64. Note that -B implies -r, # We don't have any bootblocks on ia64. Note that -B implies -r,
# so we have to specifically specify -r when we don't have -B. # so we have to specifically specify -r when we don't have -B.