OSDN Git Service

Add MS7619SE
[uclinux-h8/uClinux-dist.git] / tools / depmod.sh
1 #!/bin/sh
2 #
3 # So the busybox depmod script is not compatible with the system depmod,  but
4 # the busybox depmod is,  and we want to work with bothe depending on the config, so,
5 # let work around it all here.
6 #
7 # The problem is the kernel depmod wrapper adds /lib/modules to
8 # INSTALL_MOD_PATH,  which kmod depmod does not want,  its wants a basedir
9 # (ie the virtual / dir),  busybox expects /lib/modules to be add.
10 #
11 # Solution,  determine which one we are going to use and then fix
12 # INSTALL_MOD_PATH as needed.
13 #
14
15 . $CONFIG_CONFIG
16 if [ "$CONFIG_USER_KMOD" = "y" ]; then
17         # we are using kmod for modules stuff,  so we must have the
18         # modules.*.bin files or it won't work,  so we are using the system
19         # depmod (/sbin/depmod)
20         INSTALL_MOD_PATH="${INSTALL_MOD_PATH%%/lib/modules}"
21         export INSTALL_MOD_PATH
22         /sbin/depmod "$@"
23 else
24         # make sure we have /lib/modules at the end (but only once)
25         INSTALL_MOD_PATH="${INSTALL_MOD_PATH%%/lib/modules}"
26         INSTALL_MOD_PATH="$INSTALL_MOD_PATH/lib/modules"
27         export INSTALL_MOD_PATH
28         $ROOTDIR/user/busybox/examples/depmod.pl "$@"
29         if [ "$CONFIG_USER_BUSYBOX_FEATURE_MODUTILS_ALIAS" = "y" ]; then
30                 find $ROMFSDIR/lib/modules -type f -name "*o" |
31                         /bin/sh $ROOTDIR/tools/modules-alias.sh $ROMFSDIR/etc/modprobe.conf
32         fi
33 fi