Skip to main content
Bumped by Community user
Bumped by Community user
deleted 25 characters in body
Source Link
Rui F Ribeiro
  • 58k
  • 28
  • 156
  • 238

I hope someone can help. I had problems with my distribution's kernel, so I built a kernel (same version) to build my modules. My modules would be compatible. However, if I install the modules, the script creates a new directory in /lib/modules/ instead of writing into the module directory of the kernel. This looks somehow like this:

/lib/modules/old_kernel
/lib/modules/new_kernel

Is there a way to write into a fixed path like /lib/modules/old_kernel/TARGET1. So far overiding the install pathes only led to very weird behavior. E.g.: /lib/modules/old_kernel/lib/modules/new_kernel/TARGET1

obj-m += rcio_core.o
obj-m += rcio_spi.o
obj-m += rcio_adc.o
obj-m += rcio_pwm.o
obj-m += rcio_rcin.o
obj-m += rcio_status.o

ccflags-y := -std=gnu99

KVERSION ?= $(shell uname -r)
KERNEL_SOURCE ?= /lib/modules/$(KVERSION)/build

all:
  $(MAKE) -C $(KERNEL_SOURCE) M=$(PWD) modules
  /usr/local/bin/dtc -@ -I dts -O dtb rcio-overlay.dts -o rcio-overlay.dtb
  cp rcio-overlay.dtb /boot/overlays

install:
$(MAKE) -C $(KERNEL_SOURCE) M=$(PWD) modules_install

clean:
  $(MAKE) -C $(KERNEL_SOURCE) M=$(PWD) clean
  $(RM) rcio-overlay.dtb

I hope someone can help. I had problems with my distribution's kernel, so I built a kernel (same version) to build my modules. My modules would be compatible. However, if I install the modules, the script creates a new directory in /lib/modules/ instead of writing into the module directory of the kernel. This looks somehow like this:

/lib/modules/old_kernel
/lib/modules/new_kernel

Is there a way to write into a fixed path like /lib/modules/old_kernel/TARGET1. So far overiding the install pathes only led to very weird behavior. E.g.: /lib/modules/old_kernel/lib/modules/new_kernel/TARGET1

obj-m += rcio_core.o
obj-m += rcio_spi.o
obj-m += rcio_adc.o
obj-m += rcio_pwm.o
obj-m += rcio_rcin.o
obj-m += rcio_status.o

ccflags-y := -std=gnu99

KVERSION ?= $(shell uname -r)
KERNEL_SOURCE ?= /lib/modules/$(KVERSION)/build

all:
  $(MAKE) -C $(KERNEL_SOURCE) M=$(PWD) modules
  /usr/local/bin/dtc -@ -I dts -O dtb rcio-overlay.dts -o rcio-overlay.dtb
  cp rcio-overlay.dtb /boot/overlays

install:
$(MAKE) -C $(KERNEL_SOURCE) M=$(PWD) modules_install

clean:
  $(MAKE) -C $(KERNEL_SOURCE) M=$(PWD) clean
  $(RM) rcio-overlay.dtb

I had problems with my distribution's kernel, so I built a kernel (same version) to build my modules. My modules would be compatible. However, if I install the modules, the script creates a new directory in /lib/modules/ instead of writing into the module directory of the kernel. This looks somehow like this:

/lib/modules/old_kernel
/lib/modules/new_kernel

Is there a way to write into a fixed path like /lib/modules/old_kernel/TARGET1. So far overiding the install pathes only led to very weird behavior. E.g.: /lib/modules/old_kernel/lib/modules/new_kernel/TARGET1

obj-m += rcio_core.o
obj-m += rcio_spi.o
obj-m += rcio_adc.o
obj-m += rcio_pwm.o
obj-m += rcio_rcin.o
obj-m += rcio_status.o

ccflags-y := -std=gnu99

KVERSION ?= $(shell uname -r)
KERNEL_SOURCE ?= /lib/modules/$(KVERSION)/build

all:
  $(MAKE) -C $(KERNEL_SOURCE) M=$(PWD) modules
  /usr/local/bin/dtc -@ -I dts -O dtb rcio-overlay.dts -o rcio-overlay.dtb
  cp rcio-overlay.dtb /boot/overlays

install:
$(MAKE) -C $(KERNEL_SOURCE) M=$(PWD) modules_install

clean:
  $(MAKE) -C $(KERNEL_SOURCE) M=$(PWD) clean
  $(RM) rcio-overlay.dtb
added 17 characters in body; edited tags
Source Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 265

I hope someone can help. I had problems with the distromy distribution's kernel, so I buildbuilt a kernel (same version) to build my modules. My modules would be comptiblecompatible. However, if I install the modules, the script creates a new directory in /lib/modules/ instead to writeof writing into the module directory of the kernel. This looks somehow like this:

/lib/modules/old_kernel
/lib/modules/new_kernel

Is there a way to write into a fixed path like /lib/modules/old_kernel/TARGET1. So far overiding the install pathes only led to very weird behavior. E.g.: /lib/modules/old_kernel/lib/modules/new_kernel/TARGET1

obj-m += rcio_core.o
obj-m += rcio_spi.o
obj-m += rcio_adc.o
obj-m += rcio_pwm.o
obj-m += rcio_rcin.o
obj-m += rcio_status.o

ccflags-y := -std=gnu99

KVERSION ?= $(shell uname -r)
KERNEL_SOURCE ?= /lib/modules/$(KVERSION)/build

all:
  $(MAKE) -C $(KERNEL_SOURCE) M=$(PWD) modules
  /usr/local/bin/dtc -@ -I dts -O dtb rcio-overlay.dts -o rcio-overlay.dtb
  cp rcio-overlay.dtb /boot/overlays

install:
$(MAKE) -C $(KERNEL_SOURCE) M=$(PWD) modules_install

clean:
  $(MAKE) -C $(KERNEL_SOURCE) M=$(PWD) clean
  $(RM) rcio-overlay.dtb

I hope someone can help. I had problems with the distro, so I build a kernel (same version) to build my modules. My modules would be comptible. However, if I install the modules, the script creates a new directory in /lib/modules/ instead to write into the module directory of the kernel. This looks somehow like this:

/lib/modules/old_kernel
/lib/modules/new_kernel

Is there a way to write into a fixed path like /lib/modules/old_kernel/TARGET1. So far overiding the install pathes only led to very weird behavior. E.g.: /lib/modules/old_kernel/lib/modules/new_kernel/TARGET1

obj-m += rcio_core.o
obj-m += rcio_spi.o
obj-m += rcio_adc.o
obj-m += rcio_pwm.o
obj-m += rcio_rcin.o
obj-m += rcio_status.o

ccflags-y := -std=gnu99

KVERSION ?= $(shell uname -r)
KERNEL_SOURCE ?= /lib/modules/$(KVERSION)/build

all:
  $(MAKE) -C $(KERNEL_SOURCE) M=$(PWD) modules
  /usr/local/bin/dtc -@ -I dts -O dtb rcio-overlay.dts -o rcio-overlay.dtb
  cp rcio-overlay.dtb /boot/overlays

install:
$(MAKE) -C $(KERNEL_SOURCE) M=$(PWD) modules_install

clean:
  $(MAKE) -C $(KERNEL_SOURCE) M=$(PWD) clean
  $(RM) rcio-overlay.dtb

I hope someone can help. I had problems with my distribution's kernel, so I built a kernel (same version) to build my modules. My modules would be compatible. However, if I install the modules, the script creates a new directory in /lib/modules/ instead of writing into the module directory of the kernel. This looks somehow like this:

/lib/modules/old_kernel
/lib/modules/new_kernel

Is there a way to write into a fixed path like /lib/modules/old_kernel/TARGET1. So far overiding the install pathes only led to very weird behavior. E.g.: /lib/modules/old_kernel/lib/modules/new_kernel/TARGET1

obj-m += rcio_core.o
obj-m += rcio_spi.o
obj-m += rcio_adc.o
obj-m += rcio_pwm.o
obj-m += rcio_rcin.o
obj-m += rcio_status.o

ccflags-y := -std=gnu99

KVERSION ?= $(shell uname -r)
KERNEL_SOURCE ?= /lib/modules/$(KVERSION)/build

all:
  $(MAKE) -C $(KERNEL_SOURCE) M=$(PWD) modules
  /usr/local/bin/dtc -@ -I dts -O dtb rcio-overlay.dts -o rcio-overlay.dtb
  cp rcio-overlay.dtb /boot/overlays

install:
$(MAKE) -C $(KERNEL_SOURCE) M=$(PWD) modules_install

clean:
  $(MAKE) -C $(KERNEL_SOURCE) M=$(PWD) clean
  $(RM) rcio-overlay.dtb
Source Link
dgrat
  • 143
  • 3
  • 8

Build and install kernel module into a defined /lib/module/*kernel directory

I hope someone can help. I had problems with the distro, so I build a kernel (same version) to build my modules. My modules would be comptible. However, if I install the modules, the script creates a new directory in /lib/modules/ instead to write into the module directory of the kernel. This looks somehow like this:

/lib/modules/old_kernel
/lib/modules/new_kernel

Is there a way to write into a fixed path like /lib/modules/old_kernel/TARGET1. So far overiding the install pathes only led to very weird behavior. E.g.: /lib/modules/old_kernel/lib/modules/new_kernel/TARGET1

obj-m += rcio_core.o
obj-m += rcio_spi.o
obj-m += rcio_adc.o
obj-m += rcio_pwm.o
obj-m += rcio_rcin.o
obj-m += rcio_status.o

ccflags-y := -std=gnu99

KVERSION ?= $(shell uname -r)
KERNEL_SOURCE ?= /lib/modules/$(KVERSION)/build

all:
  $(MAKE) -C $(KERNEL_SOURCE) M=$(PWD) modules
  /usr/local/bin/dtc -@ -I dts -O dtb rcio-overlay.dts -o rcio-overlay.dtb
  cp rcio-overlay.dtb /boot/overlays

install:
$(MAKE) -C $(KERNEL_SOURCE) M=$(PWD) modules_install

clean:
  $(MAKE) -C $(KERNEL_SOURCE) M=$(PWD) clean
  $(RM) rcio-overlay.dtb