diff options
author | Mystery Man <unknown@mandriva.org> | 2004-05-11 12:41:07 +0000 |
---|---|---|
committer | Mystery Man <unknown@mandriva.org> | 2004-05-11 12:41:07 +0000 |
commit | f0b2cf434b3a176276e79046eafc71a26d94ca3d (patch) | |
tree | a2f73175aefefa9f630d80119507e1c95868367e /kernel | |
parent | 3e4ad5e1b687f262a1d7cc39a0b905a595ac7f95 (diff) | |
download | drakx-backup-do-not-use-f0b2cf434b3a176276e79046eafc71a26d94ca3d.tar drakx-backup-do-not-use-f0b2cf434b3a176276e79046eafc71a26d94ca3d.tar.gz drakx-backup-do-not-use-f0b2cf434b3a176276e79046eafc71a26d94ca3d.tar.bz2 drakx-backup-do-not-use-f0b2cf434b3a176276e79046eafc71a26d94ca3d.tar.xz drakx-backup-do-not-use-f0b2cf434b3a176276e79046eafc71a26d94ca3d.zip |
This commit was manufactured by cvs2svn to create branch
'MDK-10-update'.
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/list_modules.pm | 2 | ||||
-rwxr-xr-x | kernel/strip_modules | 124 | ||||
-rwxr-xr-x | kernel/update_kernel | 3 |
3 files changed, 3 insertions, 126 deletions
diff --git a/kernel/list_modules.pm b/kernel/list_modules.pm index 613b220d7..2521e72fb 100644 --- a/kernel/list_modules.pm +++ b/kernel/list_modules.pm @@ -112,7 +112,7 @@ our %l = ( { network => [ qw(af_packet nfs lockd sunrpc) ], cdrom => [ qw(isofs) ], - loopback => [ qw(isofs loop), if_($ENV{MOVE}, qw(cryptoloop gzloop supermount)) ], + loopback => [ qw(isofs loop) ], local => [ if_(arch() =~ /^i.86|x86_64/, qw(vfat fat)), if_(arch() =~ /^ppc/, qw(hfs)), diff --git a/kernel/strip_modules b/kernel/strip_modules deleted file mode 100755 index 98e4f4496..000000000 --- a/kernel/strip_modules +++ /dev/null @@ -1,124 +0,0 @@ -#!/bin/sh -# -# Given a list of objects, strip all static symbols except those -# required by insmod. -# -# Copyright Keith Owens <kaos@ocs.com.au>. GPL. -# Sat Feb 1 12:52:17 EST 1997 -# -# Mainly intended for reducing the size of modules to save space -# on emergency and install disks. Be aware that removing the -# static symbols reduces the amount of diagnostic information -# available for oops. Not recommended for normal module usage. -# -# This code requires the modules use MODULE_PARM and EXPORT_. -# Do not strip modules that have not been converted to use -# MODULE_PARM or are using the old method of exporting symbols. -# In particular do not use on modules prior to 2.1.20 (approx). -# -# The objects are stripped in /tmp, only if the strip works is -# the original overwritten. If the command line to strip the -# symbols becomes too long, the strip is done in multiple passes. -# Running strip_module twice on the same object is safe (and a -# waste of time). -# - -sizeofptr="/tmp/$$.sizeofptr" -echo 'int main() { return sizeof(void *); }' | gcc -xc - -o $sizeofptr -$sizeofptr -export SIZEOF_POINTER=$? -rm -f $sizeofptr - -cat > /tmp/$$.awk <<\EOF -BEGIN { - strip = "/usr/bin/objcopy"; - nm = "/usr/bin/nm"; - cp = "/bin/cp"; - mv = "/bin/mv"; - rm = "/bin/rm"; - tmp = "/tmp"; - command_size = 400; # arbitrary but safe - - getline < "/proc/self/stat"; - pid = $1; - tmpcopy = tmp "/" pid ".object"; - nmout = tmp "/" pid ".nmout"; - - for (i = 1; i < ARGC; ++i) - strip_module(ARGV[i]); - - do_command(rm " -f " tmpcopy " " nmout); - - exit(0); -} - -function strip_module(object, - keep_symbol, to_strip, symbol, command, changed) { - do_command(cp " -a " object " " tmpcopy); - do_command(nm " " tmpcopy " > " nmout); - # delete array_name sometimes breaks, internal error, play safe - for (symbol in keep_symbol) - delete keep_symbol[symbol]; - for (symbol in to_strip) - delete to_strip[symbol]; - new_module_format = 0; - ptrskip = 2 + 2 * ENVIRON["SIZEOF_POINTER"]; - while ((getline < nmout) > 0) { - $0 = substr($0, ptrskip); - # b static variable, uninitialised - # d static variable, initialised - # r static array, initialised - # t static label/procedures - if ($1 ~ /[bdrt]/) - to_strip[$2] = ""; - else if ($2 ~ /R __ksymtab_/) - keep_symbol[substr($2, 11)] = ""; - else if ($0 ~ /R __module_parm_/) - keep_symbol[substr($2, 15)] = ""; - else if ($1 != "?") - keep_symbol[$2] = ""; - if ($2 ~ /__module/) - new_module_format = 1; - } - close(nmout); - command = ""; - changed = 0; - failure = 0; - if (new_module_format) { - for (symbol in to_strip) { - if (!(symbol in keep_symbol)) { - changed = 1; - if (length(command) > command_size) { - failure = failure || do_command(strip command " " tmpcopy); - command = ""; - } - command = command " --strip-symbol=" symbol; - } - } - } - if (command != "") { - changed = 1; - failure = failure || do_command(strip command " " tmpcopy); - } - if (changed && !failure) - do_command(mv " " tmpcopy " " object); -} - -function do_command(command) { - if ((ret = system(command)) != 0) { - giveup("command \"" command "\" failed " ret, ret); - return 1; - } - return 0; -} - -function giveup(message, ret) { - print "strip_module: " message > "/dev/stderr"; -# exit(ret); -} -EOF - -awk -f /tmp/$$.awk "$@" -ret=$? -rm -f /tmp/$$.awk -exit $ret diff --git a/kernel/update_kernel b/kernel/update_kernel index 5da807e71..772dd4a55 100755 --- a/kernel/update_kernel +++ b/kernel/update_kernel @@ -79,6 +79,7 @@ function create_modules_mar() { for i in $images; do eval "modules=\$${i}_modules_raw" modules_with_deps=`perl -I $GIBASEDIR/kernel $GIBASEDIR/kernel/dependencies.pl $version modules.dep $modules` + if [ -n "$MOVE" ]; then modules_with_deps="change_loop.o gzloop.o isofs.o zlib_inflate.o supermount.o $modules_with_deps"; fi eval "create_marfile ${i}_modules.mar $modules_with_deps" done echo @@ -163,7 +164,7 @@ for i in $ALL_KERNELS/*; do done cp -f all.modules/$main/modules.description . -l=`MOVE=$MOVE perl modules.pl images` || exit 1 +l=`perl modules.pl images` || exit 1 eval $l for i in $ALL_KERNELS/*; do |