"Fossies" - the Fresh Open Source Software Archive

Member "modutils-2.4.27/depmod/create_syms" (5 Jan 2001, 2572 Bytes) of package /linux/misc/old/modutils-2.4.27.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 #
    3 #
    4 # Copyright 1999 Björn Ekwall <bj0rn@blox.se>
    5 #
    6 # This file is part of the Linux modutils.
    7 #
    8 # This program is free software; you can redistribute it and/or modify it
    9 # under the terms of the GNU General Public License as published by the
   10 # Free Software Foundation; either version 2 of the License, or (at your
   11 # option) any later version.
   12 #
   13 # This program is distributed in the hope that it will be useful, but
   14 # WITHOUT ANY WARRANTY; without even the implied warranty of
   15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   16 # General Public License for more details.
   17 #
   18 # You should have received a copy of the GNU General Public License
   19 # along with this program; if not, write to the Free Software Foundation,
   20 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
   21 #
   22 ##########################################################################
   23 #
   24 # This is a silly little script that creates a list of kernel symbols
   25 # and calls "depmod -F symfile -a Kernel_Version".
   26 #
   27 # You can use it immediately after doing "make modules_install"
   28 # while building the kernel and its modules.
   29 #
   30 # Do a "cd" to the base directory of the kernel source tree
   31 # and execute this script.
   32 #
   33 ##########################################################################
   34 
   35 for i in .config System.map vmlinux Makefile
   36 do
   37     if [ ! -f $i ]
   38     then
   39         echo "Oops, $i is missing! Is this directory really a kernel source directory?" > /dev/tty
   40         exit 1
   41     fi
   42 done
   43 
   44 eval `grep -F 'VERSION =
   45 PATCHLEVEL =
   46 SUBLEVEL =
   47 EXTRAVERSION =
   48 ' Makefile | sed 's/ //g'`
   49 FORCE=${VERSION}.${PATCHLEVEL}.${SUBLEVEL}${EXTRAVERSION}
   50 
   51 OUT=.depmodinfo
   52 rm -f $OUT
   53 
   54 source .config
   55 if [ A$CONFIG_MODVERSIONS = Ay ]
   56 then
   57     echo "Aha! A versioned kernel!" > /dev/tty
   58     echo "I will try to extract the exported versioned symbols." > /dev/tty
   59     echo "I will also fake some unversioned symbols for you," > /dev/tty
   60     echo "although you had better verify that they really exist..." > /dev/tty
   61     echo "...or add some more if 'depmod' below complains..." > /dev/tty
   62     for i in Using_Versions \
   63         __down_failed \
   64         __down_failed_interruptible \
   65         __down_failed_trylock \
   66         __get_user_1 \
   67         __get_user_2 \
   68         __get_user_4 \
   69         __put_user_1 \
   70         __put_user_2 \
   71         __put_user_4 \
   72         __up_wakeup \
   73         up_wakeup \
   74         __do_delay
   75     do
   76         echo $i > /dev/tty
   77         echo "vmlinux T $i" >> $OUT
   78     done
   79 
   80     strings vmlinux | grep "_R[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]$" | sed 's/^/vmlinux T /' >> $OUT
   81 else
   82     grep ' [A-Z] ' System.map >> $OUT
   83 fi
   84 
   85 echo Here we go...
   86 set -x
   87 /sbin/depmod -F $OUT -e -a $FORCE