Applied a patch by Ingo, to strip the debug info from optional packages.

To note, the reduction of block size from 2048 to 1024 was not applied.
Introduced a new build variable HAIKU_STRIP_DEBUG_FROM_OPTIONAL_PACKAGES,
which will allow users to enable/disable that functionality. In the
alpha-* and nightly-* profiles, it is enabled. Reduced the image size
for alpha-* to 690M. The size for nightly images was left untouched.
+alpha3


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41812 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Matt Madia
2011-05-29 18:02:21 +00:00
parent 105fd85c3a
commit b8c41a1ad8
5 changed files with 44 additions and 2 deletions
+33
View File
@@ -16,6 +16,7 @@ set -o errexit
# dontClearImage
# isVMwareImage
# optionalPackageDescriptions
# stripOptionalPackageDebugSymbols
#
# addattr
# copyattr
@@ -141,6 +142,20 @@ else
fi
stripDebugInfo()
{
file="$1"
# Determine whether the file is an ELF file by checking the ELF signature,
# or at least the printable characters.
elfMarker=`dd "if=$file" bs=1 skip=1 count=3 2> /dev/null`
if [ "$elfMarker" = 'ELF' ]; then
# make user-writable first -- some files aren't
chmod u+w "$file"
strip --strip-debug "$file"
fi
}
extractFile()
{
# extractFile <archive> <directory>
@@ -173,6 +188,24 @@ extractFile()
rm $extractDir/.OptionalPackageDescription
fi
if [ "$stripOptionalPackageDebugSymbols" == "1" ]; then
# strip executables in common/bin
if [ -d $extractDir/common/bin ]; then
for file in `find $extractDir/common/bin -type f -a -perm +100 \
-a -size +1k`; do
stripDebugInfo "$file"
done
fi
# strip libraries in common/lib
if [ -d $extractDir/common/lib ]; then
for file in `find $extractDir/common/lib -type f -a -size +1k \
-a -name lib\*`; do
stripDebugInfo "$file"
done
fi
fi
$cp -r "${sPrefix}$extractDir/$extractedSubDir/." "${tPrefix}$targetExtractedDir"
$rmAttrs -rf "$extractDir"