* [Buildroot] [PATCH v2 1/1] package/chipsec: new package
[not found] <278071935.475100.1635045278560.ref@mail.yahoo.com>
@ 2021-10-24 3:14 ` Tal Lubko via buildroot
0 siblings, 0 replies; only message in thread
From: Tal Lubko via buildroot @ 2021-10-24 3:14 UTC (permalink / raw)
To: buildroot; +Cc: thomas.petazzoni
[-- Attachment #1.1: Type: text/plain, Size: 6549 bytes --]
Hi
The new patch includes the following modifications based on Arnout comments (arnout@mind.be)- extend modules search to match py, pyo and pyc
- fix dependencies- remove setuptools from runtime (unnecessary)- adding documentation
Regarding CHIPSEC_ENV = KSRC=$(LINUX_DIR):I thought that adding: CHIPSEC_MAKE_ENV = $(LINUX_MAKE_FLAGS)will do the job (I used racehound as a reference) but it hasn't.I'm not sure what's the difference between CHIPSEC_ENV and CHIPSEC_MAKE_ENV butCHIPSEC_ENV worked (LKM was built against the correct kernel) and CHIPSEC_MAKE_ENVhasn't.
and in addition
- move the package from libraries-->security to security
- adding host-nasm to dependencies- package version bump to 1.7.2
Regards,Tal
Signed-off-by: Tal Lubko <tallubko@yahoo.com>--- DEVELOPERS | 3 ++ package/Config.in | 1 + ...es-search-to-match-.py-.pyo-and-.pyc.patch | 27 ++++++++++++++ package/chipsec/Config.in | 37 +++++++++++++++++++ package/chipsec/chipsec.hash | 3 ++ package/chipsec/chipsec.mk | 28 ++++++++++++++ 6 files changed, 99 insertions(+) create mode 100644 package/chipsec/0001-extend-modules-search-to-match-.py-.pyo-and-.pyc.patch create mode 100644 package/chipsec/Config.in create mode 100644 package/chipsec/chipsec.hash create mode 100644 package/chipsec/chipsec.mk
diff --git a/DEVELOPERS b/DEVELOPERSindex f864f7ef47..615a272c68 100644--- a/DEVELOPERS+++ b/DEVELOPERS@@ -2585,6 +2585,9 @@ F: package/python-influxdb/ N: Sven Oliver Moll <svolli@svolli.de> F: package/most/ +N: Tal Lubko <tallubko@yahoo.com>+F: package/chipsec/+ N: Theo Debrouwere <t.debrouwere@televic.com> F: board/beagleboardx15/ F: configs/beagleboardx15_defconfigdiff --git a/package/Config.in b/package/Config.inindex d40eb9dabc..e8bb2a5dc4 100644--- a/package/Config.in+++ b/package/Config.in@@ -2397,6 +2397,7 @@ endmenu menu "Security" source "package/apparmor/Config.in" source "package/checkpolicy/Config.in"+ source "package/chipsec/Config.in" source "package/ima-evm-utils/Config.in" source "package/optee-benchmark/Config.in" source "package/optee-client/Config.in"diff --git a/package/chipsec/0001-extend-modules-search-to-match-.py-.pyo-and-.pyc.patch b/package/chipsec/0001-extend-modules-search-to-match-.py-.pyo-and-.pyc.patchnew file mode 100644index 0000000000..104097fa0e--- /dev/null+++ b/package/chipsec/0001-extend-modules-search-to-match-.py-.pyo-and-.pyc.patch@@ -0,0 +1,27 @@+From 5b5a70690b1761e77a595a67f4685eb11f0c8c9c Mon Sep 17 00:00:00 2001+From: Tal Lubko <tallubko@yahoo.com>+Date: Sat, 23 Oct 2021 22:23:24 +0300+Subject: [PATCH 1/1] extend chipsec_main search to both py and pyc++[Upstream: https://github.com/chipsec/chipsec/pull/1289]+Signed-off-by: Tal Lubko <tallubko@yahoo.com>+---+ chipsec_main.py | 2 +-+ 1 file changed, 1 insertion(+), 1 deletion(-)++diff --git a/chipsec_main.py b/chipsec_main.py+index 1aa46ea..8e6f327 100755+--- a/chipsec_main.py++++ b/chipsec_main.py+@@ -215,7 +215,7 @@ class ChipsecMain:+ while len(subdirs) > 0:+ subdirs.pop()+ for modx in mod_fnames:+- if fnmatch.fnmatch( modx, '*.py' ) and not fnmatch.fnmatch( modx, '__init__.py' ):++ if fnmatch.fnmatch( modx, '*.py*' ) and not fnmatch.fnmatch( modx, '__init__.py*' ):+ self.load_module( os.path.join( dirname, modx ), self._module_argv )+ self.Loaded_Modules.sort()+ +-- +2.17.1+diff --git a/package/chipsec/Config.in b/package/chipsec/Config.innew file mode 100644index 0000000000..839204301e--- /dev/null+++ b/package/chipsec/Config.in@@ -0,0 +1,37 @@+config BR2_PACKAGE_CHIPSEC+ bool "chipsec"+ depends on !BR2_PACKAGE_PYTHON # python3+ depends on BR2_USE_WCHAR # python3+ depends on BR2_TOOLCHAIN_HAS_THREADS # python3+ depends on BR2_USE_MMU # python3+ depends on !BR2_STATIC_LIBS # python3+ depends on BR2_i386 || BR2_x86_64 # supported only on x86/x86_64+ depends on BR2_LINUX_KERNEL+ select BR2_PACKAGE_PYTHON3++ help+ CHIPSEC is a framework for analyzing the security of PC+ platforms including hardware, system firmware (BIOS/UEFI),+ and platform components. ++ https://github.com/chipsec/chipsec++comment "chipsec needs a toolchain w/ wchar, threads, dynamic library"+ depends on BR2_USE_MMU+ depends on BR2_i386 || BR2_x86_64+ depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS++comment "chipsec needs a Linux kernel to be built"+ depends on BR2_USE_MMU+ depends on BR2_i386 || BR2_x86_64+ depends on !BR2_LINUX_KERNEL++comment "chipsec is not compatible with python"+ depends on BR2_USE_MMU+ depends on BR2_i386 || BR2_x86_64+ depends on BR2_PACKAGE_PYTHON++comment "chipsec depends on python3"+ depends on BR2_USE_MMU+ depends on BR2_i386 || BR2_x86_64+ depends on !BR2_PACKAGE_PYTHON3diff --git a/package/chipsec/chipsec.hash b/package/chipsec/chipsec.hashnew file mode 100644index 0000000000..05095f2292--- /dev/null+++ b/package/chipsec/chipsec.hash@@ -0,0 +1,3 @@+# Locally calculated+sha256 6806770cdde9633af2e2395fa1e6d769aaab45f54e602a246ed78a02ce238362 chipsec-1.7.2.tar.gz+sha256 4c2ca80f4d3675a53a216a64d67e7b411a81a6e958defd248c6f1ecf44dc6607 COPYINGdiff --git a/package/chipsec/chipsec.mk b/package/chipsec/chipsec.mknew file mode 100644index 0000000000..7ff927f2b4--- /dev/null+++ b/package/chipsec/chipsec.mk@@ -0,0 +1,28 @@+################################################################################+#+# chipsec+#+################################################################################++CHIPSEC_VERSION = 1.7.2+CHIPSEC_SITE = $(call github,chipsec,chipsec,$(CHIPSEC_VERSION))+CHIPSEC_SETUP_TYPE = setuptools+CHIPSEC_LICENSE = GPL-2.0+CHIPSEC_LICENSE_FILES = LICENSE+CHIPSEC_DEPENDENCIES = linux host-nasm++# needed in order to build chipsec's LKM against Buildroot's kernel+CHIPSEC_ENV = KSRC=$(LINUX_DIR)++# build command according to chipsec's manual (chipsec-manual.pdf)+CHIPSEC_BUILD_OPTS = build_ext -i++define CHIPSEC_INSTALL_LKM+ # chipsec's scripts search chipsec.ko in a non-standart location+ $(INSTALL) -m 0644 -D $(@D)/chipsec/helper/linux/chipsec.ko \+ $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/chipsec/helper/linux+endef++CHIPSEC_POST_INSTALL_TARGET_HOOKS += CHIPSEC_INSTALL_LKM++$(eval $(python-package))-- 2.17.1
[-- Attachment #1.2: Type: text/html, Size: 12970 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] only message in thread