mirror of
https://github.com/linuxboot/heads.git
synced 2024-12-18 20:47:55 +00:00
clean all cpio files and ensure that they are all padded
This commit is contained in:
parent
fadbc77fe8
commit
ac537d0300
17
Makefile
17
Makefile
@ -154,7 +154,9 @@ define do-cpio =
|
||||
--quiet \
|
||||
-H newc \
|
||||
-o \
|
||||
) > "$1.tmp" \
|
||||
) \
|
||||
| ./bin/cpio-clean \
|
||||
> "$1.tmp" \
|
||||
)
|
||||
@if ! cmp --quiet "$1.tmp" "$1" ; then \
|
||||
mv "$1.tmp" "$1" ; \
|
||||
@ -384,11 +386,14 @@ $(COREBOOT_UTIL_DIR)/superiotool/superiotool: zlib.intermediate pciutils.interme
|
||||
# The cpio-clean program is used ensure that the files
|
||||
# always have the same timestamp and appear in the same order.
|
||||
#
|
||||
# If there is no /dev/console, initrd can't startup.
|
||||
# We have to force it to be included into the cpio image.
|
||||
# Since we are picking up the system's /dev/console, there
|
||||
# is a chance the build will not be reproducible (although
|
||||
# unlikely that their device file has a different major/minor)
|
||||
# The blobs/dev.cpio is also included in the Linux kernel
|
||||
# and has a reproducible version of /dev/console.
|
||||
#
|
||||
# The xz parameters are copied from the Linux kernel build scripts.
|
||||
# Without them the kernel will not decompress the initrd.
|
||||
#
|
||||
# The padding is to ensure that if anyone wants to cat another
|
||||
# file onto the initrd then the kernel will be able to find it.
|
||||
#
|
||||
|
||||
initrd-y += $(pwd)/blobs/dev.cpio
|
||||
|
@ -138,13 +138,20 @@ for my $filename (sort keys %entries)
|
||||
}
|
||||
|
||||
|
||||
# Print them in sorted order
|
||||
for my $filename (sort keys %entries)
|
||||
{
|
||||
my $entry = $entries{$filename};
|
||||
print $entry;
|
||||
}
|
||||
# Output them in sorted order
|
||||
my $out = join '', map { $entries{$_} } sort keys %entries;
|
||||
#for my $filename (sort keys %entries)
|
||||
#{
|
||||
#$out .= $entries{$filename};
|
||||
#}
|
||||
|
||||
# Output the trailer to mark the end of the archive
|
||||
print $trailer;
|
||||
$out .= $trailer;
|
||||
|
||||
# Pad to 512-bytes for kernel initrd reasons
|
||||
my $unaligned = length($out) % 512;
|
||||
$out .= chr(0x00) x (512 - $unaligned)
|
||||
if $unaligned != 0;
|
||||
|
||||
print $out;
|
||||
__END__
|
||||
|
Loading…
Reference in New Issue
Block a user