From: Konrad Rzeszutek Wilk Date: Fri, 19 Jul 2013 18:12:27 +0000 (-0400) Subject: Makefile: Generate initramfs with the early microcode in it. X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=56fc8b49d10478a876c2f4907c8965f15c377726;p=xentesttools%2Fbootstrap.git Makefile: Generate initramfs with the early microcode in it. The microcode blob is prepended right in front of the normal initramfs.cpio.gz Signed-off-by: Konrad Rzeszutek Wilk --- diff --git a/root_image/Makefile b/root_image/Makefile index 2a39043..c64552e 100644 --- a/root_image/Makefile +++ b/root_image/Makefile @@ -998,13 +998,17 @@ root_image-tools-install: userspace-prep .PHONY: initramfs -initramfs: distdir +initramfs: distdir ucode-initrd time sh $(LINUX_SRC)/scripts/gen_initramfs_list.sh \ -u $(shell id -u) -g $(shell id -g) \ {user,module}space/ $(wildcard debugspace/) \ | $(LINUX_DST)/usr/gen_init_cpio /proc/self/fd/0 \ - | gzip -c -f > $(DISTDIR)/common/initramfs.cpio.gz - + | gzip -c -f > $(DISTDIR)/common/_initramfs.cpio.gz + cat $(DISTDIR)/common/ucode_initrd.cpio \ + $(DISTDIR)/common/_initramfs.cpio.gz > \ + $(DISTDIR)/common/initramfs.cpio.gz + @rm -f $(DISTDIR)/common/ucode_initrd.cpio + @rm -f $(DISTDIR)/common/_initramfs.cpio.gz .PHONY: linux-modules-prep @@ -1094,12 +1098,18 @@ local-firmware-install: modulespace-prep if [ -d $(RTL_NIC_PATH) ] ; then \ $(INSTALL_DATA) $(RTL_NIC_PATH)/*.fw modulespace/$(LOCAL_FIRMWARE_PATH)/rtl_nic ; \ fi - if [ -d $(INTEL_UCODE_PATH) ] ; then \ - $(INSTALL_DATA) $(INTEL_UCODE_PATH)/* modulespace/$(LOCAL_FIRMWARE_PATH)/intel-ucode ; \ +.PHONY: ucode-initrd +ucode-initrd: + @mkdir -p ucode_initrd/kernel/x86/microcode + @echo -n "Generating $(DISTDIR)/common/ucode_initrd.cpio .." + @if [ -d $(INTEL_UCODE_PATH) ] ; then \ + cat $(INTEL_UCODE_PATH)/* > ucode_initrd/kernel/x86/microcode/GenuineIntel.bin; \ fi - if [ -d $(AMD_UCODE_PATH) ] ; then \ - $(INSTALL_DATA) $(AMD_UCODE_PATH)/* modulespace/$(LOCAL_FIRMWARE_PATH)/amd-ucode ; \ + @if [ -d $(AMD_UCODE_PATH) ] ; then \ + cat $(AMD_UCODE_PATH)/* > ucode_initrd/kernel/x86/microcode/AuthenticAMD.bin; \ fi + @(cd ucode_initrd;find . | cpio -o -H newc > ../$(DISTDIR)/common/ucode_initrd.cpio) + .PHONY: syslinux-clean syslinux-clean: $(MAKE) -j$$(($(NCPUS) * 2)) -C syslinux/menu clean