diff options
| -rw-r--r-- | Makefile | 16 | ||||
| -rw-r--r-- | scripts/Makefile.asm-generic | 1 | ||||
| -rwxr-xr-x | scripts/depmod.sh | 48 | ||||
| -rwxr-xr-x | tools/perf/util/PERF-VERSION-GEN | 7 |
4 files changed, 53 insertions, 19 deletions
| @@ -378,7 +378,7 @@ KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds | |||
| 378 | 378 | ||
| 379 | # Read KERNELRELEASE from include/config/kernel.release (if it exists) | 379 | # Read KERNELRELEASE from include/config/kernel.release (if it exists) |
| 380 | KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) | 380 | KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) |
| 381 | KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) | 381 | KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) |
| 382 | 382 | ||
| 383 | export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION | 383 | export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION |
| 384 | export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC | 384 | export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC |
| @@ -1005,7 +1005,7 @@ endef | |||
| 1005 | 1005 | ||
| 1006 | define filechk_version.h | 1006 | define filechk_version.h |
| 1007 | (echo \#define LINUX_VERSION_CODE $(shell \ | 1007 | (echo \#define LINUX_VERSION_CODE $(shell \ |
| 1008 | expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + $(SUBLEVEL)); \ | 1008 | expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 0$(SUBLEVEL)); \ |
| 1009 | echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';) | 1009 | echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';) |
| 1010 | endef | 1010 | endef |
| 1011 | 1011 | ||
| @@ -1110,11 +1110,6 @@ modules_install: _modinst_ _modinst_post | |||
| 1110 | 1110 | ||
| 1111 | PHONY += _modinst_ | 1111 | PHONY += _modinst_ |
| 1112 | _modinst_: | 1112 | _modinst_: |
| 1113 | @if [ -z "`$(DEPMOD) -V 2>/dev/null | grep module-init-tools`" ]; then \ | ||
| 1114 | echo "Warning: you may need to install module-init-tools"; \ | ||
| 1115 | echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt";\ | ||
| 1116 | sleep 1; \ | ||
| 1117 | fi | ||
| 1118 | @rm -rf $(MODLIB)/kernel | 1113 | @rm -rf $(MODLIB)/kernel |
| 1119 | @rm -f $(MODLIB)/source | 1114 | @rm -f $(MODLIB)/source |
| 1120 | @mkdir -p $(MODLIB)/kernel | 1115 | @mkdir -p $(MODLIB)/kernel |
| @@ -1531,12 +1526,7 @@ quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files)) | |||
| 1531 | 1526 | ||
| 1532 | # Run depmod only if we have System.map and depmod is executable | 1527 | # Run depmod only if we have System.map and depmod is executable |
| 1533 | quiet_cmd_depmod = DEPMOD $(KERNELRELEASE) | 1528 | quiet_cmd_depmod = DEPMOD $(KERNELRELEASE) |
| 1534 | cmd_depmod = \ | 1529 | cmd_depmod = $(srctree)/scripts/depmod.sh $(DEPMOD) $(KERNELRELEASE) |
| 1535 | if [ -r System.map -a -x $(DEPMOD) ]; then \ | ||
| 1536 | $(DEPMOD) -ae -F System.map \ | ||
| 1537 | $(if $(strip $(INSTALL_MOD_PATH)), -b $(INSTALL_MOD_PATH) ) \ | ||
| 1538 | $(KERNELRELEASE); \ | ||
| 1539 | fi | ||
| 1540 | 1530 | ||
| 1541 | # Create temporary dir for module support files | 1531 | # Create temporary dir for module support files |
| 1542 | # clean it up only when building all modules | 1532 | # clean it up only when building all modules |
diff --git a/scripts/Makefile.asm-generic b/scripts/Makefile.asm-generic index 490122c3e2aa..40caf3c26cd5 100644 --- a/scripts/Makefile.asm-generic +++ b/scripts/Makefile.asm-generic | |||
| @@ -17,6 +17,7 @@ quiet_cmd_wrap = WRAP $@ | |||
| 17 | cmd_wrap = echo "\#include <asm-generic/$*.h>" >$@ | 17 | cmd_wrap = echo "\#include <asm-generic/$*.h>" >$@ |
| 18 | 18 | ||
| 19 | all: $(patsubst %, $(obj)/%, $(generic-y)) | 19 | all: $(patsubst %, $(obj)/%, $(generic-y)) |
| 20 | @: | ||
| 20 | 21 | ||
| 21 | $(obj)/%.h: | 22 | $(obj)/%.h: |
| 22 | $(call cmd,wrap) | 23 | $(call cmd,wrap) |
diff --git a/scripts/depmod.sh b/scripts/depmod.sh new file mode 100755 index 000000000000..3b029cba2baf --- /dev/null +++ b/scripts/depmod.sh | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # | ||
| 3 | # A depmod wrapper used by the toplevel Makefile | ||
| 4 | |||
| 5 | if test $# -ne 2; then | ||
| 6 | echo "Usage: $0 /sbin/depmod <kernelrelease>" >&2 | ||
| 7 | exit 1 | ||
| 8 | fi | ||
| 9 | DEPMOD=$1 | ||
| 10 | KERNELRELEASE=$2 | ||
| 11 | |||
| 12 | if ! "$DEPMOD" -V 2>/dev/null | grep -q module-init-tools; then | ||
| 13 | echo "Warning: you may need to install module-init-tools" >&2 | ||
| 14 | echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt" >&2 | ||
| 15 | sleep 1 | ||
| 16 | fi | ||
| 17 | |||
| 18 | if ! test -r System.map -a -x "$DEPMOD"; then | ||
| 19 | exit 0 | ||
| 20 | fi | ||
| 21 | # older versions of depmod require the version string to start with three | ||
| 22 | # numbers, so we cheat with a symlink here | ||
| 23 | depmod_hack_needed=true | ||
| 24 | mkdir -p .tmp_depmod/lib/modules/$KERNELRELEASE | ||
| 25 | if "$DEPMOD" -b .tmp_depmod $KERNELRELEASE 2>/dev/null; then | ||
| 26 | if test -e .tmp_depmod/lib/modules/$KERNELRELEASE/modules.dep -o \ | ||
| 27 | -e .tmp_depmod/lib/modules/$KERNELRELEASE/modules.dep.bin; then | ||
| 28 | depmod_hack_needed=false | ||
| 29 | fi | ||
| 30 | fi | ||
| 31 | if $depmod_hack_needed; then | ||
| 32 | symlink="$INSTALL_MOD_PATH/lib/modules/99.98.$KERNELRELEASE" | ||
| 33 | ln -s "$KERNELRELEASE" "$symlink" | ||
| 34 | KERNELRELEASE=99.98.$KERNELRELEASE | ||
| 35 | fi | ||
| 36 | |||
| 37 | set -- -ae -F System.map | ||
| 38 | if test -n "$INSTALL_MOD_PATH"; then | ||
| 39 | set -- "$@" -b "$INSTALL_MOD_PATH" | ||
| 40 | fi | ||
| 41 | "$DEPMOD" "$@" "$KERNELRELEASE" | ||
| 42 | ret=$? | ||
| 43 | |||
| 44 | if $depmod_hack_needed; then | ||
| 45 | rm -f "$symlink" | ||
| 46 | fi | ||
| 47 | |||
| 48 | exit $ret | ||
diff --git a/tools/perf/util/PERF-VERSION-GEN b/tools/perf/util/PERF-VERSION-GEN index 26d4d3fd6deb..9c5fb4d93824 100755 --- a/tools/perf/util/PERF-VERSION-GEN +++ b/tools/perf/util/PERF-VERSION-GEN | |||
| @@ -23,12 +23,7 @@ if test -d ../../.git -o -f ../../.git && | |||
| 23 | then | 23 | then |
| 24 | VN=$(echo "$VN" | sed -e 's/-/./g'); | 24 | VN=$(echo "$VN" | sed -e 's/-/./g'); |
| 25 | else | 25 | else |
| 26 | eval $(grep '^VERSION[[:space:]]*=' ../../Makefile|tr -d ' ') | 26 | VN=$(make -sC ../.. kernelversion) |
| 27 | eval $(grep '^PATCHLEVEL[[:space:]]*=' ../../Makefile|tr -d ' ') | ||
| 28 | eval $(grep '^SUBLEVEL[[:space:]]*=' ../../Makefile|tr -d ' ') | ||
| 29 | eval $(grep '^EXTRAVERSION[[:space:]]*=' ../../Makefile|tr -d ' ') | ||
| 30 | |||
| 31 | VN="${VERSION}.${PATCHLEVEL}.${SUBLEVEL}${EXTRAVERSION}" | ||
| 32 | fi | 27 | fi |
| 33 | 28 | ||
| 34 | VN=$(expr "$VN" : v*'\(.*\)') | 29 | VN=$(expr "$VN" : v*'\(.*\)') |
