Running strip-all

Jules Bjørn Colding JuBColding at yorkref.com
Thu Nov 21 02:31:33 PST 2002


Hi,

A variation of the following shell functions could be used:

build_file_list ()
{
    if [ -z $1 ]
	then
	echo "No root definition in argument list for function" 1>&2
	return 1
    fi
    root=$1

    if [ -z $2 ]
	then
	echo "No output file in argument list for function" 1>&2
	return 1
    fi
    files=$2

    # Remove any stale $files file
    if [ -f "$files" ]
	then
	"$RM" -f "$files"
    fi

    "$FIND" "$root" -type f > "$files"

    return 0
}

build_binary_list ()
{
    if [ -z $1 ]
	then
	echo "No input file with file list in argument list for function" 1>&2
	return 1
    fi
    files=$1

    if [ -z $2 ]
	then
	echo "No output file in argument list for function" 1>&2
	return 1
    fi
    bins=$2

    # Remove any stale $bins file
    if [ -f "$bins" ]
	then
	"$RM" -f "$bins"
    fi

    # This regexp will match "*.so", "*.a", "*.so.*" and "*.a.*"
    regexp="\\(\\.so$\\|\\.a$\\|\\.so\\.\\|\\.a\\.\\)"
    "$GREP" -v -e "$regexp" "$files" > "$bins"

    return 0
}


build_library_list ()
{
    if [ -z $1 ]
	then
	echo  "No input file with file list in argument list for function" 1>&2
	return 1
    fi
    files=$1

    if [ -z $2 ]
	then
	echo "No library definition output file in argument list for function"
1>&2
	return 1
    fi
    libs=$2

    # Remove any stale $libs file
    if [ -f "$libs" ]
	then
	"$RM" -f "$libs"
    fi

    # This regexp will match "*.so", "*.a", "*.so.*" and "*.a.*"
    regexp="\\(\\.so$\\|\\.a$\\|\\.so\\.\\|\\.a\\.\\)"
    "$GREP" -e "$regexp" "$files" > "$libs"

    return 0
}


strip_binaries ()
{
    if [ -z $1 ]
	then
	echo "No binary definition file in argument list for function" 1>&2
	return 1
    fi
    bins=$1

    for file in $("$CAT" "$bins")
      do
      "$STRIP" --strip-all "$file"
    done

    return 0
}


strip_libraries ()
{
    if [ -z $1 ]
	then
	echo "No library definition file in argument list for function" 1>&2
	return 1
    fi
    libs=$1

    for file in $("$CAT" "$libs")
      do
      "$STRIP" --strip-debug "$file"
    done

    return 0
}

Regards,
jules

On Tue, 2002-11-19 at 08:53, Graz Bukanoff wrote:
> 
> "Chris Lingard" <chris at stockwith.co.uk> escribió en el mensaje
> news:arh6qn$j8s$1 at quasar.highos.com...
> > Hi both of you
> >
> > Do not do this, you will wreck your system.
> >
> > Just follow the book.  If you do strip  --strip-all on libraries
> > your system will not work
> >
> > Good Luck
> >
> > Chris
> >
> 
> The book doesn't mention any command to run --strip-all. It only says
> how --strip-debug should be run. Would the only difference
> between --strip-all and --strip-debug be that the /lib folder shouldn't be
> included or are there also libraries in /usr, /usr/local, /bin and /sbin?
> 
> Graz
> 
> 
> -- 
> Unsubscribe: send email to listar at linuxfromscratch.org
> and put 'unsubscribe lfs-support' in the subject header of the message
> 
-- 
  jules

-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-support' in the subject header of the message



More information about the lfs-support mailing list