diff --git a/Makefile b/Makefile index f4265b92cc..2a8cfffddf 100644 --- a/Makefile +++ b/Makefile @@ -440,6 +440,7 @@ bin_modules-$(CONFIG_FBWHIPTAIL) += fbwhiptail bin_modules-$(CONFIG_HOTPKEY) += hotp-verification bin_modules-$(CONFIG_MSRTOOLS) += msrtools bin_modules-$(CONFIG_NKSTORECLI) += nkstorecli +bin_modules-$(CONFIG_NVMUTIL) += nvmutil $(foreach m, $(bin_modules-y), \ $(call map,initrd_bin_add,$(call bins,$m)) \ @@ -451,7 +452,7 @@ $(foreach m, $(modules-y), \ ) # -# hack to build cbmem from coreboot +# hack to build cbmem and ifdtool from coreboot # this must be built *AFTER* musl, but since coreboot depends on other things # that depend on musl it should be ok. # @@ -460,11 +461,16 @@ ifeq ($(CONFIG_COREBOOT),y) $(eval $(call initrd_bin_add,$(COREBOOT_UTIL_DIR)/cbmem/cbmem)) #$(eval $(call initrd_bin_add,$(COREBOOT_UTIL_DIR)/superiotool/superiotool)) #$(eval $(call initrd_bin_add,$(COREBOOT_UTIL_DIR)/inteltool/inteltool)) +ifeq ($(CONFIG_NVMUTIL),y) +#NVMUTIL(nvm) is applied on ifdtool extracted gbe.bin from a flashrom backup under Heads. We consequently need ifdtool packed under initrd. +$(eval $(call initrd_bin_add,$(COREBOOT_UTIL_DIR)/ifdtool/ifdtool)) +endif endif $(COREBOOT_UTIL_DIR)/cbmem/cbmem \ $(COREBOOT_UTIL_DIR)/superiotool/superiotool \ $(COREBOOT_UTIL_DIR)/inteltool/inteltool \ +$(COREBOOT_UTIL_DIR)/ifdtool/ifdtool \ : $(build)/$(coreboot_base_dir)/.canary musl-cross +$(call do,MAKE,$(notdir $@),\ $(MAKE) -C "$(dir $@)" $(CROSS_TOOLS) \ diff --git a/boards/x230-hotp-maximized/x230-hotp-maximized.config b/boards/x230-hotp-maximized/x230-hotp-maximized.config index 0a03f4c679..8cd8ff95cc 100644 --- a/boards/x230-hotp-maximized/x230-hotp-maximized.config +++ b/boards/x230-hotp-maximized/x230-hotp-maximized.config @@ -20,6 +20,7 @@ CONFIG_LINUX_E1000E=y CONFIG_CRYPTSETUP2=y CONFIG_FLASHROM=y CONFIG_FLASHTOOLS=y +CONFIG_NVMUTIL=y CONFIG_GPG2=y CONFIG_KEXEC=y CONFIG_UTIL_LINUX=y diff --git a/modules/nvmutil b/modules/nvmutil new file mode 100644 index 0000000000..13b6482ce1 --- /dev/null +++ b/modules/nvmutil @@ -0,0 +1,21 @@ +modules-$(CONFIG_NVMUTIL) += nvmutil + +nvmutil_depends := $(musl_dep) + +nvmutil_version := 20220802 +nvmutil_dir := nvmutil-tools-$(nvmutil_version) +nvmutil_tar := $(nvmutil_version).tar.gz +nvmutil_url := https://notabug.org/osboot/nvmutil/archive/$(nvmutil_tar) +nvmutil_hash := 9c82964c073bf38abcd64e9d394308fe88c92f1f828f4a1933284c972818493b + +nvmutil_target := \ + $(CROSS_TOOLS) \ + CFLAGS="-I$(INSTALL)/include" \ + LDFLAGS="-L$(INSTALL)/lib" \ + +nvmutil_output := \ + nvm \ + +nvmutil_libraries := \ + +nvmutil_configure :=