Fix generation of the SBU-DU stats:
The "create-sbu_du.sh" script expects all the logs containing "Totalseconds" also contains two lines starting with "KB:" with disk usage stats. Generates those lines for all the logs. Hopefully, the stats are fairly accurate now...
This commit is contained in:
parent
3b14992061
commit
5451eaeb9e
1 changed files with 45 additions and 38 deletions
41
LFS/lfs.xsl
41
LFS/lfs.xsl
|
@ -171,11 +171,9 @@
|
||||||
<xsl:text>set -e
</xsl:text>
|
<xsl:text>set -e
</xsl:text>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<xsl:text>
</xsl:text>
|
<xsl:text>
</xsl:text>
|
||||||
<xsl:if test="sect2[@role='installation']">
|
|
||||||
<xsl:call-template name="start-script">
|
<xsl:call-template name="start-script">
|
||||||
<xsl:with-param name="order" select="$order"/>
|
<xsl:with-param name="order" select="$order"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:if>
|
|
||||||
<xsl:apply-templates select="sect2[not(@revision) or
|
<xsl:apply-templates select="sect2[not(@revision) or
|
||||||
@revision=$revision] |
|
@revision=$revision] |
|
||||||
screen[(not(@role) or
|
screen[(not(@role) or
|
||||||
|
@ -197,9 +195,7 @@
|
||||||
mode="pkgmngt"/>
|
mode="pkgmngt"/>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<xsl:text>echo -e "\n\nTotalseconds: $SECONDS\n"
</xsl:text>
|
<xsl:text>echo -e "\n\nTotalseconds: $SECONDS\n"
</xsl:text>
|
||||||
<xsl:if test="sect2[@role='installation']">
|
|
||||||
<xsl:call-template name="end-script"/>
|
<xsl:call-template name="end-script"/>
|
||||||
</xsl:if>
|
|
||||||
<xsl:text>exit
</xsl:text>
|
<xsl:text>exit
</xsl:text>
|
||||||
</exsl:document>
|
</exsl:document>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
|
@ -1151,16 +1147,22 @@ LOGLEVEL="</xsl:text>
|
||||||
|
|
||||||
<xsl:template name="start-script">
|
<xsl:template name="start-script">
|
||||||
<xsl:param name="order" select="'073'"/>
|
<xsl:param name="order" select="'073'"/>
|
||||||
<!-- get the location of the system root -->
|
|
||||||
<xsl:text>
|
<xsl:text>
|
||||||
|
<!-- save the timer, so that unpacking, and du is not counted -->
|
||||||
|
PREV_SEC=${SECONDS}
|
||||||
|
<!-- get the location of the system root -->
|
||||||
if [ -h /tools ]; then
|
if [ -h /tools ]; then
|
||||||
ROOT=$(dirname $(readlink /tools))/
|
ROOT=$(dirname $(readlink /tools))/
|
||||||
else
|
else
|
||||||
ROOT=/
|
ROOT=/
|
||||||
fi
|
fi
|
||||||
|
SCRIPT_ROOT=</xsl:text>
|
||||||
|
<xsl:copy-of select="$script-root"/>
|
||||||
|
<xsl:text>
|
||||||
|
</xsl:text>
|
||||||
|
<xsl:if test="sect2[@role='installation']">
|
||||||
|
<xsl:text>
|
||||||
SRC_DIR=${ROOT}sources
|
SRC_DIR=${ROOT}sources
|
||||||
<!-- save the timer, so that unpacking, and du is not counted -->
|
|
||||||
PREV_SEC=${SECONDS}
|
|
||||||
<!-- Set variables, for use by the Makefile and package manager -->
|
<!-- Set variables, for use by the Makefile and package manager -->
|
||||||
VERSION=</xsl:text><!-- needed for Makefile, and may be used in PackInstall-->
|
VERSION=</xsl:text><!-- needed for Makefile, and may be used in PackInstall-->
|
||||||
<xsl:copy-of select=".//sect1info/productnumber/text()"/>
|
<xsl:copy-of select=".//sect1info/productnumber/text()"/>
|
||||||
|
@ -1175,11 +1177,6 @@ PACKAGE=</xsl:text>
|
||||||
<xsl:call-template name="basename">
|
<xsl:call-template name="basename">
|
||||||
<xsl:with-param name="path" select=".//sect1info/address/text()"/>
|
<xsl:with-param name="path" select=".//sect1info/address/text()"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
<xsl:text>
|
|
||||||
SCRIPT_ROOT=</xsl:text>
|
|
||||||
<xsl:copy-of select="$script-root"/>
|
|
||||||
<xsl:text>
|
|
||||||
</xsl:text>
|
|
||||||
<xsl:if test = "( ../@id != 'chapter-temporary-tools' or
|
<xsl:if test = "( ../@id != 'chapter-temporary-tools' or
|
||||||
starts-with(@id,'ch-system') ) and $pkgmngt = 'y'">
|
starts-with(@id,'ch-system') ) and $pkgmngt = 'y'">
|
||||||
<xsl:text>
|
<xsl:text>
|
||||||
|
@ -1199,12 +1196,19 @@ export PKGDIR VERSION PKG_DEST
|
||||||
|
|
||||||
if [ -d "$PKGDIR" ]; then rm -rf $PKGDIR; fi
|
if [ -d "$PKGDIR" ]; then rm -rf $PKGDIR; fi
|
||||||
if [ -d "${PKGDIR%-*}-build" ]; then rm -rf ${PKGDIR%-*}-build; fi
|
if [ -d "${PKGDIR%-*}-build" ]; then rm -rf ${PKGDIR%-*}-build; fi
|
||||||
|
</xsl:text>
|
||||||
echo "KB: $(du -skx --exclude=lost+found --exclude=/var/lib --exclude=$SCRIPT_ROOT $ROOT)"
|
</xsl:if>
|
||||||
|
<xsl:text>
|
||||||
|
echo "KB: $(du -skx --exclude=lost+found --exclude=var/lib --exclude=$SCRIPT_ROOT $ROOT)"
|
||||||
|
</xsl:text>
|
||||||
|
<xsl:if test="sect2[@role='installation']">
|
||||||
|
<xsl:text>
|
||||||
<!-- At last unpack and change directory -->
|
<!-- At last unpack and change directory -->
|
||||||
tar -xf $PACKAGE
|
tar -xf $PACKAGE
|
||||||
cd $PKGDIR
|
cd $PKGDIR
|
||||||
SECONDS=${PREV_SEC}
|
</xsl:text>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:text>SECONDS=${PREV_SEC}
|
||||||
|
|
||||||
# Start of LFS book script
|
# Start of LFS book script
|
||||||
</xsl:text>
|
</xsl:text>
|
||||||
|
@ -1214,11 +1218,14 @@ SECONDS=${PREV_SEC}
|
||||||
<xsl:text>
|
<xsl:text>
|
||||||
# End of LFS book script
|
# End of LFS book script
|
||||||
|
|
||||||
echo "KB: $(du -skx --exclude=lost+found --exclude=/var/lib --exclude=$SCRIPT_ROOT $ROOT)"
|
echo "KB: $(du -skx --exclude=lost+found --exclude=var/lib --exclude=$SCRIPT_ROOT $ROOT)"
|
||||||
cd $SRC_DIR
|
</xsl:text>
|
||||||
|
<xsl:if test="sect2[@role='installation']">
|
||||||
|
<xsl:text>cd $SRC_DIR
|
||||||
rm -rf $PKGDIR
|
rm -rf $PKGDIR
|
||||||
if [ -d "${PKGDIR%-*}-build" ]; then rm -rf ${PKGDIR%-*}-build; fi
|
if [ -d "${PKGDIR%-*}-build" ]; then rm -rf ${PKGDIR%-*}-build; fi
|
||||||
</xsl:text>
|
</xsl:text>
|
||||||
|
</xsl:if>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
||||||
|
|
Reference in a new issue