Move sources to subdirectory

Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
Tim Crawford 2025-06-04 13:59:05 -06:00
parent 8b1da5327c
commit c24eadde07
No known key found for this signature in database
GPG Key ID: 68E558D2BBD856E3
11 changed files with 16 additions and 9 deletions

3
Kbuild Normal file
View File

@ -0,0 +1,3 @@
# SPDX-License-Identifier: GPL-2.0-or-later
obj-y += src/

View File

@ -1,4 +1,5 @@
obj-m := system76.o # SPDX-License-Identifier: GPL-2.0-or-later
KERNEL_DIR = /lib/modules/$(shell uname -r)/build KERNEL_DIR = /lib/modules/$(shell uname -r)/build
all: all:

View File

@ -13,7 +13,7 @@ make
# Remove any old instances # Remove any old instances
sudo modprobe -r system76 sudo modprobe -r system76
# Insert the new module # Insert the new module
sudo insmod system76.ko sudo insmod src/system76.ko
# View log messages # View log messages
dmesg | grep system76 dmesg | grep system76
``` ```

4
debian/rules vendored
View File

@ -6,9 +6,9 @@ include /usr/share/dpkg/pkg-info.mk
dh $@ --with dkms dh $@ --with dkms
override_dh_install: override_dh_install:
dh_install Makefile *.c usr/src/system76-$(DEB_VERSION_UPSTREAM)/ dh_install Makefile Kbuild src/Kbuild src/*.c usr/src/system76-$(DEB_VERSION_UPSTREAM)/
override_dh_dkms: override_dh_dkms:
dh_dkms -V $(DEB_VERSION_UPSTREAM) dh_dkms -V $(DEB_VERSION_UPSTREAM)
override_dh_auto_configure override_dh_auto_build override_dh_auto_test override_dh_auto_install override_dh_auto_clean: override_dh_auto_configure override_dh_auto_build override_dh_auto_test override_dh_auto_install override_dh_auto_clean:

3
src/Kbuild Normal file
View File

@ -0,0 +1,3 @@
# SPDX-License-Identifier: GPL-2.0-or-later
obj-m += system76.o

View File

@ -104,11 +104,11 @@ static int s76_wmbb(u32 method_id, u32 arg, u32 *retval) {
return 0; return 0;
} }
#include "system76_ap-led.c" #include "ap-led.c"
#include "system76_input.c" #include "input.c"
#include "system76_kb-led.c" #include "kb-led.c"
#include "system76_hwmon.c" #include "hwmon.c"
#include "system76_nv_hda.c" #include "nv_hda.c"
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,12,0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(6,12,0)
static void s76_wmi_notify(union acpi_object *obj, void *context) { static void s76_wmi_notify(union acpi_object *obj, void *context) {