linamh/sys-boot/elilo/files/elilo.sh-chkspace.patch
geos_one 94b5c1933a add modified elilo
git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/linamh@2734 6952d904-891a-0410-993b-d76249ca496b
2010-11-12 21:15:33 +00:00

16 lines
833 B
Diff

Don't count duplicate files twice when summing bytesneeded
--- elilo/debian/elilo.sh.chkspace 2006-03-16 07:53:00.000000000 -0500
+++ elilo/debian/elilo.sh 2006-03-16 07:53:27.000000000 -0500
@@ -580,7 +580,9 @@
sed 's/.*=[[:space:]]*//' | grep -v ':'`
vmmfiles=`grep '^[[:space:]]*vmm[[:space:]]*=' $bootconf | \
sed 's/.*=[[:space:]]*//' | grep -v ':'`
- bytesneeded=`cat $imagefiles $initrdfiles $vmmfiles 2>/dev/null | wc -c`
+ allfiles=`for f in $imagefiles $initrdfiles $install $bootconf; do \
+ echo $f; done | sort -u`
+ bytesneeded=`cat $allfiles 2>/dev/null | wc -c`
# convert to KB, allowing 5% overhead
kbneeded=$(( bytesneeded / 1024 + bytesneeded / 20480 ))
kbavailable=$(df -P -k $TARGET | sed -n "s|^$boot[[:space:]]\+[0-9]\+[[:space:]]\+[0-9]\+[[:space:]]\+\([0-9]\+\).*$|\1|p")