I've added some script-foo to my build scripts to automatically generate
SBU's, Disk Usage and Installed Files details, and am sharing below.
Something like this might be able to be added to the aLFS stuff, although
I haven't looked at that. Use if you wish ;)
add the following before the package extraction
NOTE: ${LFS} in the scriptlets below should be removed for Chapter 6
===========
# Dump the package\version into log
echo "foo 1.2.3.4" >> ${LFS}/tmp/disk.log
# Create a marker for the find later
touch ${LFS}/tmp/timestamp
# Get the disk usage - this is portable across all LFS
# build stages, and excludes any logs you may be writing to
# Replace ${LFS} with / in Chapter 6
du -sxk --exclude=build.{log,errors} --exclude=disk.log ${LFS} |
awk '{print $1}' >> ${LFS}/tmp/disk.log &&
============
add the following after package extraction
============
date +%s >> {$LFS}/tmp/disk.log
============
add the following after the installation of the package
but before you remove any sources
============
date +%s >> {$LFS}/tmp/disk.log
du -sxk --exclude=build.{log,errors} --exclude=disk.log ${LFS} |
awk '{print $1}' >> ${LFS}/tmp/disk.log &&
# Find foo taken from checkinstall.sh by Gerard
# Not needed for Chapter 5 packages
echo "foo 1.2.3.4" >> /tmp/foo.log
export PRUNEPATH="/sys /dev/pts /proc /root /home /tmp /tools
/usr/src" &&
export PRUNEREGEX=`echo $PRUNEPATH | sed -e 's,^,\\\(^,' -e 's, ,
$\\\)\\\|\\\(^,g' -e 's,$,$\\\),'` &&
find / -regex "$PRUNEREGEX" -prune -o -cnewer /tmp/timestamp -type
f > /tmp/foo.log
=============
After Chapter 6, tar up the ${LFS}/tmp/*.log files - they can be used for
a comparison of files installed during builds of newer packages
After Chapter 6, copy the ${LFS}/disk.log to the same directory as the
following perl script, and run the script to get the SBU and disk Usage
stats.
=============
#! /usr/bin/perl -w
$sbu = 0;
open(DATA,"< disk.log");
while (<DATA>) {
chomp;
my ($package,$version,$crap) = split(/ /,$_,3);
print ("$package - $version\n");
$diskbefore=<DATA>;
$timestart=<DATA>;
$timestop=<DATA>;
$diskafter=<DATA>;
$diskusage=($diskafter - $diskbefore) / 1024;
printf(" Disk: %.2f\n",$diskusage);
$elapsed=($timestop - $timestart);
if ($sbu == 0) {
print " SBU: 1.00 (elapsed: $elapsed)\n";
$sbu=$elapsed;
} else {
$mysbu=($elapsed / $sbu);
printf(" SBU: %.2f (elapsed: $elapsed)\n",$mysbu);
}
}
close (DATA);
=====================
Example results: (Disk in MB, elapsed in seconds)
[EMAIL PROTECTED] ~]$ ./buildstats.pl
binutils - 2.15.94.0.2.2
Disk: 125.90
SBU: 1.00 (elapsed: 326)
gcc - 3.4.3
Disk: 192.30
SBU: 2.56 (elapsed: 833)
linux-libc-headers - 2.6.10.0
Disk: 26.32
SBU: 0.00 (elapsed: 0)
glibc - 2.3.4
Disk: 223.36
SBU: 3.85 (elapsed: 1255)
gcc - 3.4.3
Disk: 148.10
SBU: 2.25 (elapsed: 733)
binutils - 2.15.94.0.2.2
Disk: 91.14
SBU: 1.05 (elapsed: 342)
gawk - 3.1.4
Disk: 14.71
SBU: 0.18 (elapsed: 60)
coreutils - 5.2.1
Disk: 41.46
SBU: 0.51 (elapsed: 167)
....
Might be of use to some - might even make a hint too ;)
-- -
Steve Crosbyt
--
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page