Skip to content

Commit 3b1ae44

Browse files
Add support for unpacking firmwares
1 parent 8403903 commit 3b1ae44

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

ci.rb

+17-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def bundle
3232
FileUtils.mkdir_p firmware_target_directory
3333
bundle_uefi
3434
FileUtils.cp File.join("qemu", "build", qemu_name), File.join(qemu_target_dir, "qemu")
35-
FileUtils.cp(firmwares.map { File.join(firmware_source_directory, _1) }, firmware_target_directory)
35+
bundle_firmware
3636
execute "tar", "-C", architecture_directory, "-c", "-f", "#{qemu_name}-#{ci_runner.os_name}.tar", "."
3737
end
3838

@@ -63,6 +63,17 @@ def architecture_directory
6363
def qemu_name
6464
"qemu-system-#{name}"
6565
end
66+
67+
def bundle_firmware
68+
firmware_paths = firmwares.map { File.join(firmware_source_directory, _1) }
69+
70+
firmware_paths
71+
.map { _1 + ".bz2" }
72+
.filter { File.exist?(_1) }
73+
.each { unpack_bzip2(_1) }
74+
75+
FileUtils.cp(firmware_paths, firmware_target_directory)
76+
end
6677
end
6778

6879
class X86_64 < Architecture
@@ -128,7 +139,7 @@ def unpack_uefi
128139
return unless File.exist?(archive)
129140

130141
FileUtils.rm_f uefi_source_path
131-
execute "bzip2", "-d", archive
142+
unpack_bzip2 archive
132143
end
133144

134145
def bundle_linaro_uefi
@@ -577,4 +588,8 @@ def download_file(url, destination)
577588
end
578589
end
579590

591+
def unpack_bzip2(archive)
592+
execute "bzip2", "-d", archive
593+
end
594+
580595
CIRunner.new.run

0 commit comments

Comments
 (0)