Skip to content

Commit

Permalink
On arm64, attempt to decompress vmlinuz automatically.
Browse files Browse the repository at this point in the history
  • Loading branch information
xnox authored and alfonsosanchezbeato committed Sep 15, 2023
1 parent 35198a0 commit 4a329b5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions bin/ubuntu-core-initramfs
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,17 @@ def create_efi(parser, args):
args.initrd = "-".join([args.initrd, args.kernelver])
args.output = "-".join([args.output, args.kernelver])

if platform.machine() == "aarch64":
import gzip
raw_kernel=tempfile.NamedTemporaryFile(mode='wb')
try:
with gzip.open(args.kernel, 'rb') as comp_kernel:
shutil.copyfileobj(comp_kernel, raw_kernel)
raw_kernel.flush()
args.kernel = raw_kernel.name
except gzip.BadGzipFile:
pass

# kernel.efi sections will be aligned to the page size by llvm-objcopy
# (which is the default value for SectionAlignment in the PE header).
# --set-section-flags are such so added COFF sections have flags:
Expand Down

0 comments on commit 4a329b5

Please sign in to comment.