@@ -32,7 +32,7 @@ def bundle
32
32
FileUtils . mkdir_p firmware_target_directory
33
33
bundle_uefi
34
34
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
36
36
execute "tar" , "-C" , architecture_directory , "-c" , "-f" , "#{ qemu_name } -#{ ci_runner . os_name } .tar" , "."
37
37
end
38
38
@@ -63,6 +63,17 @@ def architecture_directory
63
63
def qemu_name
64
64
"qemu-system-#{ name } "
65
65
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
66
77
end
67
78
68
79
class X86_64 < Architecture
@@ -128,7 +139,7 @@ def unpack_uefi
128
139
return unless File . exist? ( archive )
129
140
130
141
FileUtils . rm_f uefi_source_path
131
- execute "bzip2" , "-d" , archive
142
+ unpack_bzip2 archive
132
143
end
133
144
134
145
def bundle_linaro_uefi
@@ -577,4 +588,8 @@ def download_file(url, destination)
577
588
end
578
589
end
579
590
591
+ def unpack_bzip2 ( archive )
592
+ execute "bzip2" , "-d" , archive
593
+ end
594
+
580
595
CIRunner . new . run
0 commit comments