diff options
author | ru <ru@FreeBSD.org> | 2003-08-08 18:23:00 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2003-08-08 18:23:00 +0000 |
commit | ddbdd973e22fb705b0746aa2c73be1e5ce1cd3b0 (patch) | |
tree | e802385a184c8db4015db5e968eafaca21ac098a | |
parent | b75b5bf07af92fab491771b12c2f4d766d519a6b (diff) | |
download | FreeBSD-src-ddbdd973e22fb705b0746aa2c73be1e5ce1cd3b0.zip FreeBSD-src-ddbdd973e22fb705b0746aa2c73be1e5ce1cd3b0.tar.gz |
Add support for automatically computing the required file system
size and average inode size.
Reviewed by: jhb
-rw-r--r-- | release/scripts/doFS.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/release/scripts/doFS.sh b/release/scripts/doFS.sh index b499e1d..d3e6332 100644 --- a/release/scripts/doFS.sh +++ b/release/scripts/doFS.sh @@ -18,6 +18,18 @@ FSINODE=$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, # so we have to specifically specify -r when we don't have -B. # bsdlabel fails otherwise. |