Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions buildroot-external/configs/generic_x86_64_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ BR2_PACKAGE_LINUX_FIRMWARE_BNX2X=y
BR2_PACKAGE_LINUX_FIRMWARE_RTL_815X=y
BR2_PACKAGE_LINUX_FIRMWARE_RTL_8169=y
BR2_PACKAGE_LINUX_FIRMWARE_USB_SERIAL_TI=y
BR2_PACKAGE_LINUX_FIRMWARE_AMD_UCODE=y
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This config option doesn't exist yet in 2025.02.x.

BR2_PACKAGE_INTEL_MICROCODE=y
BR2_PACKAGE_DBUS_BROKER=y
BR2_PACKAGE_GPTFDISK=y
BR2_PACKAGE_GPTFDISK_SGDISK=y
Expand Down
23 changes: 23 additions & 0 deletions buildroot-external/external.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,26 @@ linux-check-dotconfig: linux-check-configuration-done
--src-kconfig $(LINUX_SRCDIR)Kconfig \
--actual-config $(LINUX_SRCDIR).config \
$(shell echo $(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE) $(BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES))

# if cpu microcode is required we embed it into the kernel build
ifeq ($(or $(BR2_PACKAGE_INTEL_MICROCODE),$(BR2_PACKAGE_LINUX_FIRMWARE_AMD_UCODE)),y)

UCODE_FRAG := $(BINARIES_DIR)/linux-ucode.fragment

# Hook: Generate fragment before kernel configuration
define GEN_UCODE_FRAGMENT
@echo ">> Generating $(UCODE_FRAG)"
@mkdir -p $(BINARIES_DIR)
@{ \
echo 'CONFIG_EXTRA_FIRMWARE_DIR="$(BINARIES_DIR)"'; \
printf 'CONFIG_EXTRA_FIRMWARE="'; \
( cd $(BINARIES_DIR) 2>/dev/null && \
find intel-ucode amd-ucode -type f \! -name "*README*" \! -name "*.asc" -printf '%p ' 2>/dev/null || true ); \
echo '"'; \
} > $(UCODE_FRAG)
endef

LINUX_PRE_PATCH_HOOKS += GEN_UCODE_FRAGMENT
LINUX_KCONFIG_FRAGMENT_FILES += $(UCODE_FRAG)

endif
4 changes: 4 additions & 0 deletions buildroot-external/scripts/rootfs-layer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ function fix_rootfs() {
find "${TARGET_DIR}/share/locale" -name "grub.mo" -delete
find "${TARGET_DIR}/share/locale" -type d -empty -delete
fi

# Remove unnecessary microcodes in /lib/firmware
rm -rf "${TARGET_DIR}/lib/firmware/intel-ucode"
rm -rf "${TARGET_DIR}/lib/firmware/amd-ucode"
}


Expand Down