Class: IESD::Packages::BaseSystemBinaries
- Inherits:
-
PKGUtil::PKG
- Object
- PKGUtil::PKG
- IESD::Packages::BaseSystemBinaries
- Defined in:
- lib/iesd/InstallESD/Packages/BaseSystemBinaries.pkg.rb
Overview
BaseSystemBinaries.pkg
Instance Attribute Summary
Attributes inherited from PKGUtil::PKG
Instance Method Summary collapse
-
#extract_mach_kernel(output) ⇒ Object
Extract the mach_kernel.
Methods inherited from PKGUtil::PKG
#edit, #initialize, #show, #update
Constructor Details
This class inherits a constructor from PKGUtil::PKG
Instance Method Details
#extract_mach_kernel(output) ⇒ Object
Extract the mach_kernel.
output - The String path to the output file.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/iesd/InstallESD/Packages/BaseSystemBinaries.pkg.rb', line 12 def extract_mach_kernel output show { |pkg| payload = "#{pkg}/Payload" cpio = "#{payload}.cpio" ohai "Unarchiving #{payload}" case `/usr/bin/env file --brief --mime-type #{payload.shellescape}`.chomp when "application/x-bzip2" system("/usr/bin/env", "mv", payload, "#{cpio}.bz2") system("/usr/bin/env", "bunzip2", "#{cpio}.bz2") when "application/x-gzip" system("/usr/bin/env", "mv", payload, "#{cpio}.gz") system("/usr/bin/env", "gunzip", "#{cpio}.gz") end puts "Unarchived: #{cpio}" ohai "Extracting /mach_kernel" system("/usr/bin/env cpio -p -d -I #{cpio.shellescape} -- #{payload.shellescape} <<</mach_kernel >/dev/null 2>&1") system("/usr/bin/env", "mv", "#{payload}/mach_kernel", output) puts "Extracted: #{output}" } end |