Fix stripping.
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 21 Aug 2012 12:40:48 +0000 (14:40 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 21 Aug 2012 12:40:48 +0000 (14:40 +0200)
lfs/strip
make.sh
src/stripper
tools/make-functions

index 3ae1bde..30cb9b3 100644 (file)
--- 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 0f12839..b827b6f 100755 (executable)
--- 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"
index 15fa308..2b4feaf 100755 (executable)
@@ -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' |
index a9f8136..5af0b4b 100644 (file)
@@ -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`