From f5bce902167d389b3fd02a773d2abaea8557175a Mon Sep 17 00:00:00 2001 From: Erik van der Kouwe Date: Mon, 17 May 2010 16:52:48 +0000 Subject: [PATCH] Add -M release.sh option to write out a symbol map, either to /usr/src on the image (without -m) or to the tools directory (with -m) --- tools/chrootmake.sh | 3 +++ tools/release.sh | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/tools/chrootmake.sh b/tools/chrootmake.sh index f973782da..eedd4c27a 100755 --- a/tools/chrootmake.sh +++ b/tools/chrootmake.sh @@ -11,6 +11,9 @@ make install cp /boot/image/* /boot/image_big # Make big image accessible by this name cp ../boot/boot /boot/boot cd /usr/src +if [ $MAKEMAP -ne 0 ]; then + find . -type f -perm 755 | xargs nm -n 2> /dev/null > symbols.txt +fi make clean # Let man find the manpages makewhatis /usr/man diff --git a/tools/release.sh b/tools/release.sh index b4cb81aaa..7815683db 100755 --- a/tools/release.sh +++ b/tools/release.sh @@ -131,15 +131,16 @@ SVNREV="" REVTAG="" PACKAGES=1 MINIMAL=0 +MAKEMAP=0 ROOTKB=8192 FILENAMEOUT="" -while getopts "s:pmchu?r:f:" c +while getopts "s:pmMchu?r:f:" c do case "$c" in \?) - echo "Usage: $0 [-p] [-c] [-h] [-m] [-r ] [-u] [-f ] [-s ]" >&2 + echo "Usage: $0 [-p] [-c] [-h] [-m] [-M] [-r ] [-u] [-f ] [-s ]" >&2 exit 1 ;; h) @@ -176,6 +177,8 @@ do ROOTKB=4096 [ ! "$USRMB" ] && USRMB=22 ;; + M) MAKEMAP=1 + ;; esac done @@ -351,7 +354,7 @@ cp $RELEASEDIR/usr/src/etc/mk/* $RELEASEDIR/etc/mk/ chown -R root $RELEASEDIR/etc/mk echo " * Chroot build" cp chrootmake.sh $RELEASEDIR/usr/$SRC/tools/chrootmake.sh -chroot $RELEASEDIR "PATH=/$XBIN sh -x /usr/$SRC/tools/chrootmake.sh" || exit 1 +chroot $RELEASEDIR "PATH=/$XBIN MAKEMAP=$MAKEMAP sh -x /usr/$SRC/tools/chrootmake.sh" || exit 1 # Copy built images for cd booting cp $RELEASEDIR/boot/image_big image echo " * Chroot build done" @@ -372,6 +375,13 @@ fi echo $version_pretty, SVN revision $REVISION, generated `date` >$RELEASEDIR/etc/version if [ $MINIMAL -ne 0 ] then + if [ "$MAKEMAP" -ne 0 ] + then + echo " * Copying symbol map to ${IMG}-symbols.txt" + cp $RELEASEDIR/usr/src/symbols.txt ${IMG}-symbols.txt + $ZIP -f ${IMG}-symbols.txt + fi + echo " * Removing files to create minimal image" rm -rf $RELEASEDIR/boot/image/* $RELEASEDIR/usr/man/man*/* \ $RELEASEDIR/usr/share/zoneinfo* $RELEASEDIR/usr/src \