From 03d21da2681bf649fd71e070d35ea4dc6cda12aa Mon Sep 17 00:00:00 2001 From: Trammell hudson Date: Fri, 22 Sep 2017 15:09:57 -0400 Subject: [PATCH] generate 512-byte padded xz files --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 05b2f96..8d1fb75 100644 --- a/Makefile +++ b/Makefile @@ -358,17 +358,21 @@ initrd.intermediate: initrd.cpio # # Compress the initrd into a xz file that can be included by coreboot. -# The extra options are necessary to let the Linux kernel decompress it. +# The extra options are necessary to let the Linux kernel decompress it +# and the extra padding is to ensure that it can be concatenated to +# other cpio files. # coreboot.intermediate: $(build)/$(coreboot_dir)/initrd.cpio.xz $(build)/$(coreboot_dir)/initrd.cpio.xz: initrd.cpio + +%.xz: % $(call do,COMPRESS,$<,\ xz \ --check=crc32 \ --lzma2=dict=1MiB \ -9 \ < "$<" \ - > "$@" \ + | dd bs=512 conv=sync > "$@" \ ) @sha256sum "$@"