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 \
|
--quiet \
|
||||||
-H newc \
|
-H newc \
|
||||||
-o \
|
-o \
|
||||||
) > "$1.tmp" \
|
) \
|
||||||
|
| ./bin/cpio-clean \
|
||||||
|
> "$1.tmp" \
|
||||||
)
|
)
|
||||||
@if ! cmp --quiet "$1.tmp" "$1" ; then \
|
@if ! cmp --quiet "$1.tmp" "$1" ; then \
|
||||||
mv "$1.tmp" "$1" ; \
|
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
|
# The cpio-clean program is used ensure that the files
|
||||||
# always have the same timestamp and appear in the same order.
|
# always have the same timestamp and appear in the same order.
|
||||||
#
|
#
|
||||||
# If there is no /dev/console, initrd can't startup.
|
# The blobs/dev.cpio is also included in the Linux kernel
|
||||||
# We have to force it to be included into the cpio image.
|
# and has a reproducible version of /dev/console.
|
||||||
# Since we are picking up the system's /dev/console, there
|
#
|
||||||
# is a chance the build will not be reproducible (although
|
# The xz parameters are copied from the Linux kernel build scripts.
|
||||||
# unlikely that their device file has a different major/minor)
|
# 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
|
initrd-y += $(pwd)/blobs/dev.cpio
|
||||||
|
@ -138,13 +138,20 @@ for my $filename (sort keys %entries)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Print them in sorted order
|
# Output them in sorted order
|
||||||
for my $filename (sort keys %entries)
|
my $out = join '', map { $entries{$_} } sort keys %entries;
|
||||||
{
|
#for my $filename (sort keys %entries)
|
||||||
my $entry = $entries{$filename};
|
#{
|
||||||
print $entry;
|
#$out .= $entries{$filename};
|
||||||
}
|
#}
|
||||||
|
|
||||||
# Output the trailer to mark the end of the archive
|
# 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__
|
__END__
|
||||||
|
Loading…
Reference in New Issue
Block a user