support XZ initrd, without forcing XZ on initramfs (issue #257)

This commit is contained in:
Trammell hudson 2017-09-22 15:27:10 -04:00
parent 0cc31132d3
commit 90c231623c
Failed to extract signature
3 changed files with 18 additions and 9 deletions

View File

@ -6,12 +6,6 @@
# edk2.intermediate or something like that.
EDK2_DIR := $(build)/$(edk2_dir)/BaseTools/BinWrappers/PosixLike
# This should be done in some sort of automated way
# it is currently a little risk prone...
#initrd: initrd.intermediate
#cat blobs/r630/acpi.cpio initrd.cpio > $(build)/$(linux_dir)/initrd.cpio
GenSec-name = $(EDK2_DIR)/GenSec \
-S EFI_SECTION_USER_INTERFACE \
-o "$1" \
@ -107,8 +101,7 @@ RuntimeDxe.ffs: RuntimeDxe-pe.sec RuntimeDxe-name.sec RuntimeDxe-version.sec nop
# Generate a firmware file with a well known guid
# "initrd.cpio/bios" that contains the real initrd file
#initrd.ffs: initrd.cpio.xz
initrd.ffs: initrd.cpio
initrd.ffs: initrd.cpio.xz
$(call GenSec-name,initrd-name.sec,"initrd")
$(call GenSec-version,initrd-version.sec,"0.0")
$(EDK2_DIR)/GenSec \

View File

@ -152,7 +152,7 @@ CONFIG_INITRAMFS_ROOT_GID=0
# CONFIG_RD_GZIP is not set
# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_LZMA is not set
# CONFIG_RD_XZ is not set
CONFIG_RD_XZ=y
# CONFIG_RD_LZO is not set
# CONFIG_RD_LZ4 is not set
# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set
@ -2718,6 +2718,7 @@ CONFIG_XZ_DEC_ARMTHUMB=y
CONFIG_XZ_DEC_SPARC=y
CONFIG_XZ_DEC_BCJ=y
CONFIG_XZ_DEC_TEST=m
CONFIG_DECOMPRESS_XZ=y
CONFIG_GENERIC_ALLOCATOR=y
CONFIG_REED_SOLOMON=y
CONFIG_REED_SOLOMON_DEC8=y

View File

@ -480,3 +480,18 @@ diff -u --recursive ../clean/linux-4.9.38/init/initramfs.c linux-4.9.38/init/ini
if (initrd_start) {
#ifdef CONFIG_BLK_DEV_RAM
int fd;
diff -u --recursive ../clean/linux-4.9.38/usr/Makefile linux-4.9.38/usr/Makefile
--- ../clean/linux-4.9.38/usr/Makefile 2017-07-15 06:17:55.000000000 -0400
+++ linux-4.9.38/usr/Makefile 2017-09-22 15:16:19.128175394 -0400
@@ -24,6 +24,11 @@
# Gzip
suffix_$(CONFIG_RD_GZIP) = .gz
+# NERF doesn't support compressed initramfs, so it must disable
+# the compression here. The initrd image will be compressed in
+# the EFI firmware, however.
+suffix_y =
+
AFLAGS_initramfs_data.o += -DINITRAMFS_IMAGE="usr/initramfs_data.cpio$(suffix_y)"
# Generate builtin.o based on initramfs_data.o