Fernando de Oliveira wrote:
>> What it says is "Compilation OK", not that all packages are OK. It's
>> supposed to be a short script to allow the user to visually check the
>> actual installed packages. That's part of the learning process.
>
> Yes, but is it really difficult to drop "Compilation OK" and add
> "Host System Requirements OK/failed" ?
That would require a lot longer script. Every line would need to be
parsed to determine the version and then checked. Since every line is
slightly different, it becomes a much more complicated script.
On the other hand, each line in the script tells the user how to
determine the version. That information is valuable in itself.
>> Perhaps a comment. What is the output when you run
>> /lib/i386-linux-gnu/libc-2.13.so as an executable?
>
> lfs@VMWLFS70:~$ /lib/i386-linux-gnu/libc-2.13.so
> GNU C Library (Ubuntu EGLIBC 2.13-20ubuntu5) stable release version 2.13,
Ahh, EGLIBC. I believe this is supposed to be binary compatible with
glibc. Perhaps the following would work in the script:
find /lib -name 'libc-*.so' -exec {} \; | head -n1 | cut -d, -f1
>>> 3. Binutils-2.22 - Pass 1: I have always missed the ";" in
>> ../binutils-2.22/configure \
>> --target=$LFS_TGT \
>> --prefix=/tools \
>> --disable-nls \
>> --disable-werror &&
>>
>> make &&
>> make install
>> }
>>
>> No semicolons required.
>>
>> -- Bruce
>
> Bruce, thank you very much for the reply and for this example.
Try the scripts below. Change the make script to match the instructions
for each particular package.
-- Bruce
cat /usr/src/stats
#!/bin/bash
function stats()
{
log=$1
tarball=$2
b4=$3
# Change to match your system
base_sbu=101
free_now=`df -k / | grep / | sed -re "s/ {2,}/ /g" | cut -d" " -f3`
buildtime=`tail -n1 $log|cut -f1 -d" "`
sbu=`echo "scale=3; $buildtime / $base_sbu" | bc`
psizeK=`du -k $tarball | cut -f1`
psizeM=`echo "scale=3; $psizeK / 1024" | bc`
bsizeK=`echo "$free_now - $b4" | bc`
bsizeM=`echo "scale=3; $bsizeK / 1024" | bc`
echo "SBU=$sbu" | tee -a $log
echo "$psizeK $tarball size ($psizeM MB)" | tee -a $log
echo "$bsizeK kilobytes build size ($bsizeM MB)" | tee -a $log
(echo -n "md5sum : "; md5sum $tarball) | tee -a $log
(echo -n "sha1sum: "; sha1sum $tarball) | tee -a $log
echo "`date` $tarball" >> /usr/src/packages.log
}
TIMEFMT='%1R Elapsed Time - '
------------
$ cat /usr/src/which/make-which-2.20
#!/bin/bash
source /usr/src/stats
DIR=`pwd`
PROGRAM=which-2.20 # package specific
LOG=$DIR/$PROGRAM.log
TITLE=$PROGRAM
TIMEFORMAT="$TIMEFMT $TITLE"
BUILDDIR=/tmp/which # package specific
DEST=$BUILDDIR/install
rm -rf $BUILDDIR
mkdir $BUILDDIR
cd $BUILDDIR
before=`df -k / | grep / | sed -re "s/ {2,}/ /g" | cut -d' ' -f3`
tar -xf $DIR/$PROGRAM.tar.?z* || exit 1
cd $PROGRAM
{ time \
{
echo Making $TITLE
date
./configure --prefix=/usr &&
make &&
make DESTDIR=$DEST install
#sudo make install
}
} 2>&1 | tee -a $LOG
if [ $PIPESTATUS -ne 0 ]; then exit 1; fi;
stats $LOG $DIR/$PROGRAM.tar.?z* $before
exit 0
--
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page