From 21109b09308cb033573c3cbda027a1f9c2a73633 Mon Sep 17 00:00:00 2001 From: Serhei Makarov Date: Mon, 28 Sep 2020 10:51:23 -0400 Subject: [PATCH] tentative fix: update hand-written Makefiles to use KBUILD_EXTMOD= kernel 5.3+ deprecated and then removed the SUBDIRS= flag for building an external module. In conjunction with KDIR=, this led to unpredictable results (i.e. a build failure which would delete the system kernel-devel package's config files (!)). Commit 0126be38d9 counsels to use M= or KBUILD_EXTMOD= instead. No harm in specifying both since newer kernels should ignore SUBDIRS= --- runtime/linux/uprobes/Makefile | 2 +- runtime/linux/uprobes/uprobes.txt | 2 +- testsuite/systemtap.base/stap_hwbkpt_kmod.Makefile | 2 +- testsuite/systemtap.base/stap_kmodule.Makefile | 2 +- testsuite/systemtap.context/makefile1 | 2 +- testsuite/systemtap.context/makefile2 | 2 +- testsuite/systemtap.printf/memory1_module.Makefile | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/runtime/linux/uprobes/Makefile b/runtime/linux/uprobes/Makefile index 286e62c06..d95d3873e 100644 --- a/runtime/linux/uprobes/Makefile +++ b/runtime/linux/uprobes/Makefile @@ -19,7 +19,7 @@ CERTDB = ../../../../etc/systemtap/staprun # owns this build directory. This is so that the stap-server service # can rebuild the module, if necessary. default: - $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules + $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) KBUILD_EXTMOD=$(PWD) modules if test `id -u` = 0 -o `id -un` = stap-server; then \ if test -x $(LIBEXECDIR)/stap-sign-module; then \ stap_dir=${SYSTEMTAP_DIR}; \ diff --git a/runtime/linux/uprobes/uprobes.txt b/runtime/linux/uprobes/uprobes.txt index 98219eb94..444a1560a 100644 --- a/runtime/linux/uprobes/uprobes.txt +++ b/runtime/linux/uprobes/uprobes.txt @@ -522,7 +522,7 @@ obj-m := uprobe_example.o KDIR := /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) default: - $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules + $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) KBUILD_EXTMOD=$(PWD) modules clean: rm -f *.mod.c *.ko *.o .*.cmd rm -rf .tmp_versions diff --git a/testsuite/systemtap.base/stap_hwbkpt_kmod.Makefile b/testsuite/systemtap.base/stap_hwbkpt_kmod.Makefile index b92c0ad53..8e3427373 100644 --- a/testsuite/systemtap.base/stap_hwbkpt_kmod.Makefile +++ b/testsuite/systemtap.base/stap_hwbkpt_kmod.Makefile @@ -2,7 +2,7 @@ obj-m := stap_hwbkpt_kmod.o KDIR := /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) default: - $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules + $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) KBUILD_EXTMOD=$(PWD) modules clean: rm -f *.mod.c stap_hwbkpt_kmod.ko *.o .*.cmd Modules.symvers rm -rf .tmp_versions diff --git a/testsuite/systemtap.base/stap_kmodule.Makefile b/testsuite/systemtap.base/stap_kmodule.Makefile index e834c5214..8ab2676aa 100644 --- a/testsuite/systemtap.base/stap_kmodule.Makefile +++ b/testsuite/systemtap.base/stap_kmodule.Makefile @@ -2,7 +2,7 @@ obj-m := stap_kmodule.o KDIR := /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) default: - $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules + $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) KBUILD_EXTMOD=$(PWD) modules clean: rm -f *.mod.c stap_kmodule.ko *.o .*.cmd Modules.symvers rm -rf .tmp_versions diff --git a/testsuite/systemtap.context/makefile1 b/testsuite/systemtap.context/makefile1 index 73b6f1a2e..05727ab25 100644 --- a/testsuite/systemtap.context/makefile1 +++ b/testsuite/systemtap.context/makefile1 @@ -2,7 +2,7 @@ obj-m := systemtap_test_module1.o KDIR := /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) default: - $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules + $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) KBUILD_EXTMOD=$(PWD) modules clean: rm -f *.mod.c systemtap_test_module1.ko *.o .*.cmd Modules.symvers rm -rf .tmp_versions diff --git a/testsuite/systemtap.context/makefile2 b/testsuite/systemtap.context/makefile2 index de87cc90d..d1ebb8246 100644 --- a/testsuite/systemtap.context/makefile2 +++ b/testsuite/systemtap.context/makefile2 @@ -2,7 +2,7 @@ obj-m := systemtap_test_module2.o KDIR := /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) default: - $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules + $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) KBUILD_EXTMOD=$(PWD) modules clean: rm -f *.mod.c systemtap_test_module2.ko *.o .*.cmd Modules.symvers rm -rf .tmp_versions diff --git a/testsuite/systemtap.printf/memory1_module.Makefile b/testsuite/systemtap.printf/memory1_module.Makefile index 2a306f8a9..e3a42d4fe 100644 --- a/testsuite/systemtap.printf/memory1_module.Makefile +++ b/testsuite/systemtap.printf/memory1_module.Makefile @@ -2,7 +2,7 @@ obj-m := memory1_module.o KDIR := /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) default: - $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules + $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) KBUILD_EXTMOD=$(PWD) modules clean: rm -f *.mod.c memory1_module.ko *.o .*.cmd Modules.symvers rm -rf .tmp_versions -- 2.43.5