From ebc9df0362d138529e86df978ee846cc3254f056 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Fri, 8 Aug 2003 18:23:00 +0000 Subject: [PATCH] Add support for automatically computing the required file system size and average inode size. Reviewed by: jhb --- release/scripts/doFS.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/release/scripts/doFS.sh b/release/scripts/doFS.sh index b499e1da5a12..d3e6332636e3 100644 --- a/release/scripts/doFS.sh +++ b/release/scripts/doFS.sh @@ -17,6 +17,18 @@ FSPROTO=$1 ; shift 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.