From bc259fdcc14bb766173c7bd0b82a92cc0e33c79b Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 21 Aug 2012 14:40:48 +0200 Subject: [PATCH] Fix stripping. --- lfs/strip | 3 ++- make.sh | 6 +++--- src/stripper | 28 +++++++++++++++++++++++++--- tools/make-functions | 5 +++-- 4 files changed, 33 insertions(+), 9 deletions(-) diff --git a/lfs/strip b/lfs/strip index 3ae1bde6f..30cb9b33b 100644 --- a/lfs/strip +++ b/lfs/strip @@ -46,4 +46,5 @@ md5 : ############################################################################### $(TARGET) : - STRIP="/tools/bin/strip" $(DIR_SRC)/src/stripper / + STRIP="/tools/bin/strip" $(DIR_SRC)/src/stripper / \ + --exclude=/usr/src --exclude=/tools diff --git a/make.sh b/make.sh index 0f12839eb..b827b6fdb 100755 --- a/make.sh +++ b/make.sh @@ -378,12 +378,12 @@ buildipfire() { # The xen and PAE kernels are only available for x86 if [ "${MACHINE_TYPE}" != "arm" ]; then - ipfiremake linux2 KCFG="-xen" +# ipfiremake linux2 KCFG="-xen" # ipfiremake v4l-dvb KCFG="-xen" # ipfiremake mISDN KCFG="-xen" # ipfiremake dahdi KCFG="-xen" KMOD=1 - ipfiremake cryptodev KCFG="-xen" - ipfiremake compat-wireless KCFG="-xen" +# ipfiremake cryptodev KCFG="-xen" +# ipfiremake compat-wireless KCFG="-xen" # ipfiremake r8169 KCFG="-xen" # ipfiremake r8168 KCFG="-xen" # ipfiremake r8101 KCFG="-xen" diff --git a/src/stripper b/src/stripper index 15fa308fa..2b4feafe9 100755 --- a/src/stripper +++ b/src/stripper @@ -1,10 +1,32 @@ -#!/bin/bash +#!/tools/bin/bash + +dirs="" +excludes="/dev /proc /sys /run" + +while [ $# -gt 0 ]; do + case "${1}" in + --exclude=*) + excludes="${excludes} ${1#*=}" + ;; + *) + dirs="${dirs} ${1}" + ;; + esac + shift +done function _strip() { local file=${1} - local cmd="${STRIP-strip}" + local exclude l + for exclude in ${excludes}; do + l=${#exclude} + if [ "${file:0:${l}}" = "${exclude}" ]; then + return 0 + fi + done + case "$(file -bi ${file})" in application/x-sharedlib*|application/x-archive*) cmd="${cmd} --strip-debug --remove-section=.comment --remove-section=.note" @@ -18,7 +40,7 @@ function _strip() { ${cmd} ${file} } -for dir in $@; do +for dir in ${dirs}; do # Strip shared objects. find ${dir} -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) \ | file -N -f - | sed -n -e 's/^\(.*\):[ ]*.*ELF.*, not stripped/\1/p' | diff --git a/tools/make-functions b/tools/make-functions index a9f8136b4..5af0b4b84 100644 --- a/tools/make-functions +++ b/tools/make-functions @@ -530,8 +530,9 @@ installmake() { CROSSTARGET="${CROSSTARGET}" \ MACHINE="$MACHINE" \ MACHINE_TYPE="$MACHINE_TYPE" \ - /bin/bash -x -c "cd /usr/src/lfs && \ - make -f $* LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1 + LD_LIBRARY_PATH=/tools/lib \ + /tools/bin/bash -x -c "cd /usr/src/lfs && \ + /tools/bin/make -f $* LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1 local COMPILE_SUCCESS=$? local PKG_TIME_END=`date +%s` -- 2.39.2