Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WiP change Intel PHYsical mac (gbe) from Heads #1195

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ bin_modules-$(CONFIG_ZSTD) += zstd
bin_modules-$(CONFIG_E2FSPROGS) += e2fsprogs
bin_modules-$(CONFIG_EXFATPROGS) += exfatprogs
bin_modules-$(CONFIG_IOTOOLS) += iotools
bin_modules-$(CONFIG_NVMUTIL) += nvmutil

$(foreach m, $(bin_modules-y), \
$(call map,initrd_bin_add,$(call bins,$m)) \
Expand All @@ -593,7 +594,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.
#
Expand All @@ -602,11 +603,17 @@ 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 with cross-compiler
$(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) \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ CONFIG_LINUX_E1000E=y
CONFIG_CRYPTSETUP=y
CONFIG_FLASHROM=y
CONFIG_FLASHTOOLS=y
CONFIG_NVMUTIL=y
CONFIG_GPG2=y
CONFIG_KEXEC=y
CONFIG_UTIL_LINUX=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,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
Expand Down
1 change: 1 addition & 0 deletions boards/t420-hotp-maximized/t420-hotp-maximized.config
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,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
Expand Down
1 change: 1 addition & 0 deletions boards/t430-hotp-maximized/t430-hotp-maximized.config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions boards/w530-hotp-maximized/w530-hotp-maximized.config
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,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
Expand Down
1 change: 1 addition & 0 deletions boards/x220-hotp-maximized/x220-hotp-maximized.config
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,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
Expand Down
1 change: 1 addition & 0 deletions boards/x230-hotp-maximized/x230-hotp-maximized.config
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export CONFIG_USB_KEYBOARD_REQUIRED=y
CONFIG_CRYPTSETUP2=y
CONFIG_FLASHROM=y
CONFIG_FLASHTOOLS=y
CONFIG_NVMUTIL=y
CONFIG_GPG2=y
CONFIG_KEXEC=y
CONFIG_UTIL_LINUX=y
Expand Down
1 change: 1 addition & 0 deletions boards/x230-maximized/x230-maximized.config
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,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
Expand Down
2 changes: 2 additions & 0 deletions modules/coreboot
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,13 @@ else
$(coreboot-toolchain_module)_target := -f Makefile.nobuild
endif

# We delete ifdtool here so its rebuilt (nvmutil builds it with musl-cross-make to be packed under initrd)
$(coreboot_module)_configure := \
mkdir -p "$(build)/$(coreboot_dir)" \
&& $(call install_config,$(pwd)/$(CONFIG_COREBOOT_CONFIG),$(build)/$(coreboot_dir)/.config) \
&& echo 'CONFIG_LOCALVERSION="$(BRAND_NAME)-$(HEADS_GIT_VERSION)"' >> $(build)/$(coreboot_dir)/.config \
&& echo 'CONFIG_MAINBOARD_SMBIOS_PRODUCT_NAME="$(BOARD)"' >> $(build)/$(coreboot_dir)/.config \
&& rm -rf $(build)/$(coreboot_base_dir)/util/ifdtool/ifdtool \
&& $(MAKE) olddefconfig \
-C "$(build)/$(coreboot_base_dir)" \
obj="$(build)/$(coreboot_dir)" \
Expand Down
24 changes: 24 additions & 0 deletions modules/nvmutil
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
modules-$(CONFIG_NVMUTIL) += nvmutil

nvmutil_depends := $(musl_dep)

nvmutil_version := 20240126
nvmutil_dir := nvmutil-tools-$(nvmutil_version)
nvmutil_tar := $(nvmutil_version).tar.gz
nvmutil_url := https://codeberg.org/libreboot/lbmk/archive/$(nvmutil_tar)
nvmutil_hash := 8708f38c0c41f05bf6637c32a64e2c04ca5cf6fc175ccdde4cbd518e498d55c9

#Ugly hack. We pass two make -C here for nvmutil, only second one is taken into consideration
nvmutil_target := \
$(CROSS_TOOLS) -C $(build)/$(nvmutil_dir)/util/nvmutil \
&& $(CROSS_TOOLS) $(MAKE) -C $(build)/$(coreboot_base_dir)/util/ifdtool \

nvmutil_output := \
util/nvmutil/nvm \

nvmutil_libraries := \

# We remove built ifdtool artifact here so that coreboot/nvmutil module rebuilds it
nvmutil_configure := \
rm -rf $(build)/$(coreboot_base_dir)/util/ifdtool/ifdtool \