License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 14:07:57 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
staging: ion: remove from the tree
The ION android code has long been marked to be removed, now that we
dma-buf support merged into the real part of the kernel.
It was thought that we could wait to remove the ion kernel at a later
time, but as the out-of-tree Android fork of the ion code has diverged
quite a bit, and any Android device using the ion interface uses that
forked version and not this in-tree version, the in-tree copy of the
code is abandonded and not used by anyone.
Combine this abandoned codebase with the need to make changes to it in
order to keep the kernel building properly, which then causes merge
issues when merging those changes into the out-of-tree Android code, and
you end up with two different groups of people (the in-kernel-tree
developers, and the Android kernel developers) who are both annoyed at
the current situation. Because of this problem, just drop the in-kernel
copy of the ion code now, as it's not used, and is only causing problems
for everyone involved.
Cc: "Arve Hjønnevåg" <arve@android.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: Christian Brauner <christian@brauner.io>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Hridya Valsaraju <hridya@google.com>
Cc: Joel Fernandes <joel@joelfernandes.org>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Laura Abbott <laura@labbott.name>
Cc: Martijn Coenen <maco@android.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Todd Kjos <tkjos@android.com>
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/r/20200827123627.538189-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-27 12:36:27 +00:00
|
|
|
TARGETS = arm64
|
2017-11-01 17:00:39 +00:00
|
|
|
TARGETS += bpf
|
2016-10-17 12:28:36 +00:00
|
|
|
TARGETS += breakpoints
|
2015-11-17 14:35:42 +00:00
|
|
|
TARGETS += capabilities
|
selftests: cgroup: add memory controller self-tests
Cgroups are used for controlling the physical resource distribution
(memory, CPU, io, etc) and often are used as basic building blocks
for large distributed computing systems. Even small differences
in the actual behavior may lead to significant incidents.
The codebase is under the active development, which will unlikely
stop at any time soon. Also it's scattered over different kernel
subsystems, which makes regressions more probable.
Given that, the lack of any tests is crying.
This patch implements some basic tests for the memory controller,
as well as a minimal required framework. It doesn't pretend for a
very good coverage, but pretends to be a starting point.
Hopefully, any following significant changes will include corresponding
tests.
Tests for CPU and io controllers, as well as cgroup core
are next in the todo list.
Signed-off-by: Roman Gushchin <guro@fb.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: kernel-team@fb.com
Cc: linux-kselftest@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-11 18:03:49 +00:00
|
|
|
TARGETS += cgroup
|
2019-10-14 10:45:38 +00:00
|
|
|
TARGETS += clone3
|
2019-05-20 14:13:28 +00:00
|
|
|
TARGETS += core
|
2017-01-13 06:36:45 +00:00
|
|
|
TARGETS += cpufreq
|
2013-04-30 22:27:06 +00:00
|
|
|
TARGETS += cpu-hotplug
|
2018-11-27 10:33:08 +00:00
|
|
|
TARGETS += drivers/dma-buf
|
2013-04-30 22:27:06 +00:00
|
|
|
TARGETS += efivarfs
|
2014-12-19 00:17:43 +00:00
|
|
|
TARGETS += exec
|
2018-03-13 16:55:27 +00:00
|
|
|
TARGETS += filesystems
|
2019-01-17 11:48:54 +00:00
|
|
|
TARGETS += filesystems/binderfs
|
2019-12-05 00:52:19 +00:00
|
|
|
TARGETS += filesystems/epoll
|
2014-12-19 00:17:43 +00:00
|
|
|
TARGETS += firmware
|
2020-06-18 14:37:37 +00:00
|
|
|
TARGETS += fpu
|
2014-12-19 00:17:43 +00:00
|
|
|
TARGETS += ftrace
|
2015-05-13 04:07:55 +00:00
|
|
|
TARGETS += futex
|
2016-11-21 10:16:11 +00:00
|
|
|
TARGETS += gpio
|
2017-01-11 15:16:07 +00:00
|
|
|
TARGETS += intel_pstate
|
2015-11-17 14:35:43 +00:00
|
|
|
TARGETS += ipc
|
2018-10-16 14:09:31 +00:00
|
|
|
TARGETS += ir
|
2013-02-28 01:05:56 +00:00
|
|
|
TARGETS += kcmp
|
2019-03-13 14:09:10 +00:00
|
|
|
TARGETS += kexec
|
2018-03-27 09:49:19 +00:00
|
|
|
TARGETS += kvm
|
2021-04-22 15:41:20 +00:00
|
|
|
TARGETS += landlock
|
2015-11-07 00:30:32 +00:00
|
|
|
TARGETS += lib
|
2019-01-09 12:43:29 +00:00
|
|
|
TARGETS += livepatch
|
2020-01-10 05:02:06 +00:00
|
|
|
TARGETS += lkdtm
|
2015-09-11 20:07:42 +00:00
|
|
|
TARGETS += membarrier
|
2014-08-08 21:25:32 +00:00
|
|
|
TARGETS += memfd
|
2013-04-30 22:27:06 +00:00
|
|
|
TARGETS += memory-hotplug
|
2020-08-07 06:23:51 +00:00
|
|
|
TARGETS += mincore
|
2014-07-29 22:50:44 +00:00
|
|
|
TARGETS += mount
|
2021-01-21 13:19:55 +00:00
|
|
|
TARGETS += mount_setattr
|
2014-12-19 00:17:43 +00:00
|
|
|
TARGETS += mqueue
|
2021-01-27 13:08:29 +00:00
|
|
|
TARGETS += nci
|
2013-03-20 19:07:56 +00:00
|
|
|
TARGETS += net
|
2021-08-01 07:57:07 +00:00
|
|
|
TARGETS += net/af_unix
|
2020-03-23 14:24:04 +00:00
|
|
|
TARGETS += net/forwarding
|
2020-01-22 00:56:29 +00:00
|
|
|
TARGETS += net/mptcp
|
2018-10-31 17:26:21 +00:00
|
|
|
TARGETS += netfilter
|
2016-09-06 07:47:16 +00:00
|
|
|
TARGETS += nsfs
|
2018-12-29 21:27:33 +00:00
|
|
|
TARGETS += pidfd
|
2020-03-08 16:26:32 +00:00
|
|
|
TARGETS += pid_namespace
|
2014-12-19 00:17:43 +00:00
|
|
|
TARGETS += powerpc
|
2018-04-10 23:31:45 +00:00
|
|
|
TARGETS += proc
|
2015-10-02 11:46:39 +00:00
|
|
|
TARGETS += pstore
|
2013-04-30 22:28:00 +00:00
|
|
|
TARGETS += ptrace
|
2020-01-18 12:08:00 +00:00
|
|
|
TARGETS += openat2
|
2021-04-22 12:27:15 +00:00
|
|
|
TARGETS += rlimits
|
2018-06-02 12:44:08 +00:00
|
|
|
TARGETS += rseq
|
2018-04-19 12:50:29 +00:00
|
|
|
TARGETS += rtc
|
2015-06-16 17:54:14 +00:00
|
|
|
TARGETS += seccomp
|
2020-11-12 22:01:31 +00:00
|
|
|
TARGETS += sgx
|
2016-04-14 20:20:05 +00:00
|
|
|
TARGETS += sigaltstack
|
2014-12-19 00:17:43 +00:00
|
|
|
TARGETS += size
|
2018-04-26 16:54:09 +00:00
|
|
|
TARGETS += sparc64
|
2017-02-19 03:07:24 +00:00
|
|
|
TARGETS += splice
|
2015-09-09 13:06:25 +00:00
|
|
|
TARGETS += static_keys
|
2016-10-19 12:49:48 +00:00
|
|
|
TARGETS += sync
|
2020-11-27 19:32:36 +00:00
|
|
|
TARGETS += syscall_user_dispatch
|
2014-12-19 00:17:43 +00:00
|
|
|
TARGETS += sysctl
|
2020-07-17 21:54:39 +00:00
|
|
|
TARGETS += tc-testing
|
2019-11-12 01:27:17 +00:00
|
|
|
TARGETS += timens
|
2015-06-19 19:13:43 +00:00
|
|
|
ifneq (1, $(quicktest))
|
2013-06-28 00:06:43 +00:00
|
|
|
TARGETS += timers
|
2015-06-19 19:13:43 +00:00
|
|
|
endif
|
2019-03-05 23:49:24 +00:00
|
|
|
TARGETS += tmpfs
|
2019-02-04 13:16:40 +00:00
|
|
|
TARGETS += tpm2
|
2014-01-23 23:54:38 +00:00
|
|
|
TARGETS += user
|
2020-10-26 11:49:41 +00:00
|
|
|
TARGETS += vDSO
|
2014-12-19 00:17:43 +00:00
|
|
|
TARGETS += vm
|
2015-04-07 06:11:06 +00:00
|
|
|
TARGETS += x86
|
2015-08-18 07:01:59 +00:00
|
|
|
TARGETS += zram
|
2014-12-19 00:17:43 +00:00
|
|
|
#Please keep the TARGETS list alphabetically sorted
|
2015-06-19 19:13:43 +00:00
|
|
|
# Run "make quicktest=1 run_tests" or
|
2017-04-13 23:43:16 +00:00
|
|
|
# "make quicktest=1 kselftest" from top level Makefile
|
2012-01-13 01:20:44 +00:00
|
|
|
|
2014-07-02 15:51:38 +00:00
|
|
|
TARGETS_HOTPLUG = cpu-hotplug
|
|
|
|
TARGETS_HOTPLUG += memory-hotplug
|
|
|
|
|
2020-12-10 18:52:33 +00:00
|
|
|
# User can optionally provide a TARGETS skiplist. By default we skip
|
|
|
|
# BPF since it has cutting edge build time dependencies which require
|
|
|
|
# more effort to install.
|
|
|
|
SKIP_TARGETS ?= bpf
|
2019-09-26 17:52:18 +00:00
|
|
|
ifneq ($(SKIP_TARGETS),)
|
|
|
|
TMP := $(filter-out $(SKIP_TARGETS), $(TARGETS))
|
|
|
|
override TARGETS := $(TMP)
|
|
|
|
endif
|
|
|
|
|
2020-02-06 08:40:00 +00:00
|
|
|
# User can set FORCE_TARGETS to 1 to require all targets to be successfully
|
|
|
|
# built; make will fail if any of the targets cannot be built. If
|
|
|
|
# FORCE_TARGETS is not set (the default), make will succeed if at least one
|
|
|
|
# of the targets gets built.
|
|
|
|
FORCE_TARGETS ?=
|
|
|
|
|
2020-07-28 07:32:41 +00:00
|
|
|
# Clear LDFLAGS and MAKEFLAGS when implicit rules are missing. This provides
|
|
|
|
# implicit rules to sub-test Makefiles which avoids build failures in test
|
|
|
|
# Makefile that don't have explicit build rules.
|
|
|
|
ifeq (,$(LINK.c))
|
2015-05-14 19:55:18 +00:00
|
|
|
override LDFLAGS =
|
2015-03-18 17:57:39 +00:00
|
|
|
override MAKEFLAGS =
|
|
|
|
endif
|
|
|
|
|
2020-02-26 22:54:49 +00:00
|
|
|
# Append kselftest to KBUILD_OUTPUT and O to avoid cluttering
|
2019-05-14 20:43:44 +00:00
|
|
|
# KBUILD_OUTPUT with selftest objects and headers installed
|
|
|
|
# by selftests Makefile or lib.mk.
|
2019-07-06 03:07:12 +00:00
|
|
|
ifdef building_out_of_srctree
|
2017-09-08 01:57:43 +00:00
|
|
|
override LDFLAGS =
|
|
|
|
endif
|
|
|
|
|
2019-04-15 21:51:42 +00:00
|
|
|
ifneq ($(O),)
|
2020-02-26 22:54:49 +00:00
|
|
|
BUILD := $(O)/kselftest
|
2019-04-15 21:51:42 +00:00
|
|
|
else
|
|
|
|
ifneq ($(KBUILD_OUTPUT),)
|
2019-11-28 23:03:21 +00:00
|
|
|
BUILD := $(KBUILD_OUTPUT)/kselftest
|
2019-04-15 21:51:42 +00:00
|
|
|
else
|
|
|
|
BUILD := $(shell pwd)
|
|
|
|
DEFAULT_INSTALL_HDR_PATH := 1
|
|
|
|
endif
|
2016-11-29 11:55:52 +00:00
|
|
|
endif
|
|
|
|
|
2019-04-15 21:51:42 +00:00
|
|
|
# Prepare for headers install
|
|
|
|
top_srcdir ?= ../../..
|
|
|
|
include $(top_srcdir)/scripts/subarch.include
|
|
|
|
ARCH ?= $(SUBARCH)
|
|
|
|
export KSFT_KHDR_INSTALL_DONE := 1
|
2016-11-29 11:55:52 +00:00
|
|
|
export BUILD
|
2019-04-15 21:51:42 +00:00
|
|
|
|
|
|
|
# set default goal to all, so make without a target runs all, even when
|
|
|
|
# all isn't the first target in the file.
|
|
|
|
.DEFAULT_GOAL := all
|
|
|
|
|
|
|
|
# Install headers here once for all tests. KSFT_KHDR_INSTALL_DONE
|
|
|
|
# is used to avoid running headers_install from lib.mk.
|
|
|
|
# Invoke headers install with --no-builtin-rules to avoid circular
|
|
|
|
# dependency in "make kselftest" case. In this case, second level
|
|
|
|
# make inherits builtin-rules which will use the rule generate
|
|
|
|
# Makefile.o and runs into
|
|
|
|
# "Circular Makefile.o <- prepare dependency dropped."
|
|
|
|
# and headers_install fails and test compile fails.
|
|
|
|
#
|
|
|
|
# O= KBUILD_OUTPUT cases don't run into this error, since main Makefile
|
|
|
|
# invokes them as sub-makes and --no-builtin-rules is not necessary,
|
|
|
|
# but doesn't cause any failures. Keep it simple and use the same
|
|
|
|
# flags in both cases.
|
|
|
|
# Local build cases: "make kselftest", "make -C" - headers are installed
|
|
|
|
# in the default INSTALL_HDR_PATH usr/include.
|
|
|
|
khdr:
|
|
|
|
ifeq (1,$(DEFAULT_INSTALL_HDR_PATH))
|
2019-08-16 16:06:04 +00:00
|
|
|
$(MAKE) --no-builtin-rules ARCH=$(ARCH) -C $(top_srcdir) headers_install
|
2019-04-15 21:51:42 +00:00
|
|
|
else
|
2019-08-16 16:06:04 +00:00
|
|
|
$(MAKE) --no-builtin-rules INSTALL_HDR_PATH=$$BUILD/usr \
|
2019-04-15 21:51:42 +00:00
|
|
|
ARCH=$(ARCH) -C $(top_srcdir) headers_install
|
|
|
|
endif
|
|
|
|
|
|
|
|
all: khdr
|
2019-12-10 11:44:59 +00:00
|
|
|
@ret=1; \
|
|
|
|
for TARGET in $(TARGETS); do \
|
|
|
|
BUILD_TARGET=$$BUILD/$$TARGET; \
|
|
|
|
mkdir $$BUILD_TARGET -p; \
|
2020-02-06 08:40:00 +00:00
|
|
|
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET \
|
|
|
|
$(if $(FORCE_TARGETS),|| exit); \
|
2019-12-10 11:44:59 +00:00
|
|
|
ret=$$((ret * $$?)); \
|
|
|
|
done; exit $$ret;
|
2012-01-13 01:20:44 +00:00
|
|
|
|
2012-03-28 21:42:54 +00:00
|
|
|
run_tests: all
|
2017-09-18 23:30:50 +00:00
|
|
|
@for TARGET in $(TARGETS); do \
|
2016-11-29 11:55:52 +00:00
|
|
|
BUILD_TARGET=$$BUILD/$$TARGET; \
|
2019-08-16 16:06:04 +00:00
|
|
|
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests;\
|
2012-03-28 21:42:54 +00:00
|
|
|
done;
|
|
|
|
|
2014-07-02 15:51:38 +00:00
|
|
|
hotplug:
|
2017-09-18 23:30:50 +00:00
|
|
|
@for TARGET in $(TARGETS_HOTPLUG); do \
|
2016-11-29 11:55:52 +00:00
|
|
|
BUILD_TARGET=$$BUILD/$$TARGET; \
|
2019-08-16 16:06:04 +00:00
|
|
|
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET;\
|
2014-07-02 15:51:38 +00:00
|
|
|
done;
|
|
|
|
|
|
|
|
run_hotplug: hotplug
|
2017-09-18 23:30:50 +00:00
|
|
|
@for TARGET in $(TARGETS_HOTPLUG); do \
|
2016-11-29 11:55:52 +00:00
|
|
|
BUILD_TARGET=$$BUILD/$$TARGET; \
|
2019-08-16 16:06:04 +00:00
|
|
|
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_full_test;\
|
2014-07-02 15:51:38 +00:00
|
|
|
done;
|
|
|
|
|
|
|
|
clean_hotplug:
|
2017-09-18 23:30:50 +00:00
|
|
|
@for TARGET in $(TARGETS_HOTPLUG); do \
|
2016-11-29 11:55:52 +00:00
|
|
|
BUILD_TARGET=$$BUILD/$$TARGET; \
|
2019-08-16 16:06:04 +00:00
|
|
|
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean;\
|
2014-07-02 15:51:38 +00:00
|
|
|
done;
|
|
|
|
|
2015-10-02 11:46:41 +00:00
|
|
|
run_pstore_crash:
|
2019-08-16 16:06:04 +00:00
|
|
|
$(MAKE) -C pstore run_crash
|
2015-10-02 11:46:41 +00:00
|
|
|
|
2019-05-07 23:44:21 +00:00
|
|
|
# Use $BUILD as the default install root. $BUILD points to the
|
|
|
|
# right output location for the following cases:
|
|
|
|
# 1. output_dir=kernel_src
|
|
|
|
# 2. a separate output directory is specified using O= KBUILD_OUTPUT
|
|
|
|
# 3. a separate output directory is specified using KBUILD_OUTPUT
|
2019-09-26 22:40:14 +00:00
|
|
|
# Avoid conflict with INSTALL_PATH set by the main Makefile
|
2019-05-07 23:44:21 +00:00
|
|
|
#
|
2019-09-26 22:40:14 +00:00
|
|
|
KSFT_INSTALL_PATH ?= $(BUILD)/kselftest_install
|
|
|
|
KSFT_INSTALL_PATH := $(abspath $(KSFT_INSTALL_PATH))
|
|
|
|
# Avoid changing the rest of the logic here and lib.mk.
|
|
|
|
INSTALL_PATH := $(KSFT_INSTALL_PATH)
|
2015-03-11 04:06:00 +00:00
|
|
|
ALL_SCRIPT := $(INSTALL_PATH)/run_kselftest.sh
|
2020-09-28 20:26:48 +00:00
|
|
|
TEST_LIST := $(INSTALL_PATH)/kselftest-list.txt
|
2015-03-11 04:06:00 +00:00
|
|
|
|
2019-05-07 23:44:21 +00:00
|
|
|
install: all
|
2015-03-11 04:06:00 +00:00
|
|
|
ifdef INSTALL_PATH
|
|
|
|
@# Ask all targets to install their files
|
2019-04-24 23:12:31 +00:00
|
|
|
mkdir -p $(INSTALL_PATH)/kselftest
|
2019-10-30 19:45:36 +00:00
|
|
|
install -m 744 kselftest/module.sh $(INSTALL_PATH)/kselftest/
|
2019-04-24 23:12:31 +00:00
|
|
|
install -m 744 kselftest/runner.sh $(INSTALL_PATH)/kselftest/
|
2019-04-24 23:12:35 +00:00
|
|
|
install -m 744 kselftest/prefix.pl $(INSTALL_PATH)/kselftest/
|
2020-09-28 20:26:48 +00:00
|
|
|
install -m 744 run_kselftest.sh $(INSTALL_PATH)/
|
|
|
|
rm -f $(TEST_LIST)
|
2019-12-10 11:44:59 +00:00
|
|
|
@ret=1; \
|
|
|
|
for TARGET in $(TARGETS); do \
|
2016-11-29 11:55:52 +00:00
|
|
|
BUILD_TARGET=$$BUILD/$$TARGET; \
|
2020-02-06 08:40:00 +00:00
|
|
|
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install \
|
|
|
|
$(if $(FORCE_TARGETS),|| exit); \
|
2019-12-10 11:44:59 +00:00
|
|
|
ret=$$((ret * $$?)); \
|
|
|
|
done; exit $$ret;
|
2015-03-11 04:06:00 +00:00
|
|
|
|
|
|
|
|
2020-09-28 20:26:48 +00:00
|
|
|
@# Ask all targets to emit their test scripts
|
|
|
|
@# While building kselftest-list.text skip also non-existent TARGET dirs:
|
2019-09-26 17:52:19 +00:00
|
|
|
@# they could be the result of a build failure and should NOT be
|
|
|
|
@# included in the generated runlist.
|
2015-03-11 04:06:00 +00:00
|
|
|
for TARGET in $(TARGETS); do \
|
2016-11-29 11:55:52 +00:00
|
|
|
BUILD_TARGET=$$BUILD/$$TARGET; \
|
2019-10-22 13:27:17 +00:00
|
|
|
[ ! -d $(INSTALL_PATH)/$$TARGET ] && echo "Skipping non-existent dir: $$TARGET" && continue; \
|
2019-09-26 22:40:14 +00:00
|
|
|
echo -n "Emit Tests for $$TARGET\n"; \
|
2020-09-28 20:26:48 +00:00
|
|
|
$(MAKE) -s --no-print-directory OUTPUT=$$BUILD_TARGET COLLECTION=$$TARGET \
|
|
|
|
-C $$TARGET emit_tests >> $(TEST_LIST); \
|
2015-03-11 04:06:00 +00:00
|
|
|
done;
|
|
|
|
else
|
|
|
|
$(error Error: set INSTALL_PATH to use install)
|
|
|
|
endif
|
|
|
|
|
2020-05-19 20:00:45 +00:00
|
|
|
FORMAT ?= .gz
|
|
|
|
TAR_PATH = $(abspath ${INSTALL_PATH}/kselftest-packages/kselftest.tar${FORMAT})
|
|
|
|
gen_tar: install
|
|
|
|
@mkdir -p ${INSTALL_PATH}/kselftest-packages/
|
|
|
|
@tar caf ${TAR_PATH} --exclude=kselftest-packages -C ${INSTALL_PATH} .
|
|
|
|
@echo "Created ${TAR_PATH}"
|
|
|
|
|
2012-01-13 01:20:44 +00:00
|
|
|
clean:
|
2017-09-18 23:30:50 +00:00
|
|
|
@for TARGET in $(TARGETS); do \
|
2016-11-29 11:55:52 +00:00
|
|
|
BUILD_TARGET=$$BUILD/$$TARGET; \
|
2019-08-16 16:06:04 +00:00
|
|
|
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean;\
|
2012-01-13 01:20:44 +00:00
|
|
|
done;
|
2015-03-11 04:06:00 +00:00
|
|
|
|
2020-05-19 20:00:45 +00:00
|
|
|
.PHONY: khdr all run_tests hotplug run_hotplug clean_hotplug run_pstore_crash install clean gen_tar
|