VirtualBox

Changeset 68706 in vbox for trunk/src/VBox/Installer/linux


Ignore:
Timestamp:
Sep 8, 2017 3:11:42 PM (7 years ago)
Author:
vboxsync
Message:

Linux driver Make files: fix Linux 2.4 module installation.
bugref:4567: Linux kernel driver maintenance

The Guest Additions installer was no longer installing kernel modules on
Linux 2.4-based systems due to a path specification problem which was a
regression from recent clean-ups. Fix this and switch to taking a kernel
version rather than a kernel header path as a parameter for allowing builds
for different kernels.

Location:
trunk/src/VBox/Installer/linux
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/linux/Makefile.include.footer

    r68627 r68706  
    6464install: $(MODULE)
    6565        @mkdir -p $(MODULE_DIR); \
    66         install -m 0644 -o root -g root $(MODULE).$(MODULE_EXT) \
    67         $(INSTALL_MOD_PATH)/$(KERN_DIR)/$(INSTALL_MOD_DIR); \
     66        install -m 0644 -o root -g root $(MODULE).$(MODULE_EXT) $(MODULE_DIR); \
    6867        PATH="$(PATH):/bin:/sbin" depmod -a;
    6968
  • trunk/src/VBox/Installer/linux/Makefile.include.header

    r68627 r68706  
    9191
    9292 # kernel base directory
    93  ifndef KERN_DIR
    94   KERN_DIR := /lib/modules/$(shell uname -r)/build
    95   ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
    96    $(error Error: unable to find the sources of your current Linux kernel. \
    97                    Specify KERN_DIR=<directory> and run Make again)
    98   endif
    99  else
    100   ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
    101    $(error Error: KERN_DIR does not point to a directory)
    102   endif
    103  endif
    104 
    105  # includes
    106  ifndef KERN_INCL
    107   KERN_INCL := $(KERN_DIR)/include
    108  endif
    109  ifneq ($(shell if test -d $(KERN_INCL); then echo yes; fi),yes)
    110   $(error Error: unable to find the include directory for your current Linux \
    111                  kernel. Specify KERN_INCL=<directory> and run Make again)
    112  endif
    113 
    114  # module install dir
    115  INSTALL_MOD_DIR ?= misc
     93 KERN_VER ?= $(shell uname -r)
    11694
    11795 # guess kernel major version (24 or later)
    118  ifeq ($(shell if grep '"2\.4\.' $(KERN_INCL)/linux/version.h > /dev/null 2>&1; then echo yes; fi),yes)
     96 ifeq ($(shell if grep '"2\.4\.' /lib/modules/$(KERN_VER)/build/include/linux/version.h > /dev/null 2>&1; then echo yes; fi),yes)
    11997  KERN_VERSION := 24
    12098 else
     
    135113 endif
    136114
    137  KERN_DIR := /lib/modules/$(KERNELRELEASE)/build
    138  KERN_INCL := $(KERN_DIR)/include
     115 KERN_VER := $(KERNELRELEASE)
    139116
    140117endif # neq($(KERNELRELEASE),)
    141118
     119# Kernel build folder
     120KERN_DIR := /lib/modules/$(KERN_VER)/build
     121ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
     122 $(error Error: unable to find the headers of the Linux kernel to build against. \
     123          Specify KERN_VER=<version> and run Make again)
     124endif
     125# Kernel include folder
     126KERN_INCL := $(KERN_DIR)/include
     127# module install folder
     128INSTALL_MOD_DIR ?= misc
     129MODULE_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KERN_VER)/$(INSTALL_MOD_DIR)
     130
    142131# debug - show guesses.
    143132ifdef DEBUG
     133$(warning dbg: INSTALL_MOD_PATH = $(INSTALL_MOD_PATH))
     134$(warning dbg: INSTALL_MOD_DIR  = $(INSTALL_MOD_DIR))
    144135$(warning dbg: KERN_DIR         = $(KERN_DIR))
    145136$(warning dbg: KERN_INCL        = $(KERN_INCL))
    146 $(warning dbg: INSTALL_MOD_PATH = $(INSTALL_MOD_PATH))
    147 $(warning dbg: INSTALL_MOD_DIR  = $(INSTALL_MOD_DIR))
    148137$(warning dbg: KERN_VERSION     = $(KERN_VERSION))
     138$(warning dbg: MODULE_DIR       = $(MODULE_DIR))
    149139endif
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette