[LEDE-DEV] [PATCH 2/2] amd64-microcode: create early load microcode image

Tomasz Maciej Nowak tomek_n at o2.pl
Tue Apr 24 05:56:20 PDT 2018


Create initrd image with packed microcode. This'll allow to load it at
early boot stage.

Signed-off-by: Tomasz Maciej Nowak <tomek_n at o2.pl>
---
 package/firmware/amd64-microcode/Makefile | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/package/firmware/amd64-microcode/Makefile b/package/firmware/amd64-microcode/Makefile
index e88b02950f..5eecf24351 100644
--- a/package/firmware/amd64-microcode/Makefile
+++ b/package/firmware/amd64-microcode/Makefile
@@ -35,11 +35,17 @@ define Build/Prepare
 endef
 
 define Build/Compile
+	mkdir -p $(PKG_BUILD_DIR)/kernel/x86/microcode/
+	cat $(PKG_BUILD_DIR)/microcode_amd*.bin \
+		> $(PKG_BUILD_DIR)/kernel/x86/microcode/AuthenticAMD.bin
+	(cd $(PKG_BUILD_DIR); \
+	echo "kernel/x86/microcode/AuthenticAMD.bin" \
+		| cpio -o -H newc --reproducible > amd-ucode.cpio)
 endef
 
 define Package/amd64-microcode/install
-	$(INSTALL_DIR) $(1)/lib/firmware/amd-ucode
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/*.bin $(1)/lib/firmware/amd-ucode
+	$(INSTALL_DIR) $(1)/boot
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/amd-ucode.cpio $(1)/boot/amd-ucode.img
 endef
 
 $(eval $(call BuildPackage,amd64-microcode))
-- 
2.17.0




More information about the Lede-dev mailing list