12 Commits

Author SHA1 Message Date
Nathaniel Mitchell 08963cf024 Update asm to support return thunk that is enabled in kernel 6.19
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2026-03-26 13:58:48 -07:00
Nicolas Iooss 643306766e Add FORCE in Linux driver Makefile
Since Linux 5.15 (commit
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e1f86d7b4b2a5213b012c2b4fe3e5b6ad537686e
), `make` now warns about missing `FORCE` prerequisite:

    /var/lib/dkms/chipsec/1.8.1/build/Makefile:39: FORCE prerequisite
    is missing

Fix this issue by adding the required prerequisite.

Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>
2022-02-16 08:24:33 -08:00
Nicolas Iooss 4f6ed29c84 Simplify the Makefile used by Linux kernel module
Several improvements

* Drop the detection of EFI through kallsyms. This detection is no
  longer useful since commit 2c0c4c9fd1 ("Using CONFIG_EFI instead of
  user defined HAS_EFI (#1036)") replaced `HAS_EFI` with `CONFIG_EFI`.

* Use `...-objs-y` and `...-objs-$(CONFIG_...)` logic to choose which
  `cpu.asm` file is being built. This is something that other modules do
  in Linux kernel source.

* Introduce `quiet_cmd_...` and `cmd_...` definition in order to use the
  build system of the kernel to compile `cpu.asm` with NASM. This should
  prevent issues like the one mentioned in 2210002bab ("Fixed build
  error on latest Ubuntu") from happening again. Moreover this makes the
  custom clean command `rm -f ${asm-path}/cpu.o` no longer necessary.

* Remove variables which become unused after these changes. Now, all
  that `Makefile` needs is a kernel directory, specified with `KSRC`.

This change has been tested on a test system running Ubuntu 20.10 and on
GitHub Actions workers running Ubuntu 16.04, 18.04 and 20.04 on Linux
5.4.0-1040-azure. It has also been compile-tested on many other Linux
distributions using a work-in-progress GitHub Actions configuration
(https://github.com/fishilico/chipsec/actions/runs/661200380).
2021-05-27 16:01:25 -07:00
Yves-Alexis Perez fbf45bd56c Support overriding Linux source path
It was previously possible to build Chipsec kernel module for a different Linux
kernel than the running one, and ff4a273 broke that possibility.

Bring that back just by giving a way to override the KSRC variable when calling
the Makefile.

Fix issue #1122
2021-03-25 10:16:05 -07:00
net-wayfarer ff4a27367b Fix Makefile to work with DKMS
drivers/linux/Makefile:
* Replaced KERNEL_SRC_DIR variable with KSRC.
* Added KSRC variable which should enable successful DKMS compilation,
  as opposed to bailing out with "Unable to find the Linux source tree."

This patch has been tested on Black Arch.
2021-02-24 14:47:36 -08:00
Nathaniel Mitchell 2210002bab Fixed build error on latest Ubuntu
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2021-01-26 16:04:06 -08:00
Cr4sh 6d491162bf linux helper HAS_EFI bugfix 2020-04-28 16:07:53 -07:00
BrentHoltsclaw c29769d81a Fix Warning #535 2019-03-01 15:19:44 -08:00
BrentHoltsclaw 0b685ff5fb Linux driver support for legacy BIOS and UEFI-compatibility mode
Issue #186
2019-01-14 09:54:26 -08:00
abazhaniuk 1c09ea5ada fix issue with building driver on 32bit system (#203) 2017-04-21 06:34:25 -10:00
Thiébaud Weksteen 63991da054 Improve build_ext (#115) 2016-11-03 15:27:24 -07:00
abazhaniuk 94fe7f02f1 change setup.py build driver by default. change root directory of chipsec. move WARNING.txt to chipsec. remove PKG-INFO (#107) 2016-10-18 18:19:42 -07:00