Class: IESD::DMG::InstallESD
- Inherits:
-
HDIUtil::DMG
- Object
- HDIUtil::DMG
- IESD::DMG::InstallESD
- Defined in:
- lib/iesd/InstallESD/InstallESD.dmg.rb
Defined Under Namespace
Classes: BaseSystem
Constant Summary collapse
- PACKAGES =
%w{ Packages }
Instance Attribute Summary
Attributes inherited from HDIUtil::DMG
Instance Method Summary collapse
Methods inherited from HDIUtil::DMG
#edit, #initialize, #show, #update, #valid?
Constructor Details
This class inherits a constructor from HDIUtil::DMG
Instance Method Details
#export(options) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/iesd/InstallESD/InstallESD.dmg.rb', line 6 def export case [:type] when :BaseSystem = { :hdiutil => { :resize => { :grow => 0, } } }.merge() [:hdiutil][:resize][:grow] += ( `#{Utility::HDIUTIL} resize -limits "#{@url}"`.chomp.split.map { |s| s.to_i } ).first show { |installesd| IESD::DMG::BaseSystem.new(File.join(installesd, "BaseSystem.dmg")).export() { |basesystem| installesd_packages = File.join installesd, PACKAGES basesystem_packages = File.join basesystem, *IESD::DMG::BaseSystem::PACKAGES oh1 "Copying #{installesd_packages}" system(Utility::RM, basesystem_packages) system(Utility::DITTO, installesd_packages, basesystem_packages) puts "Copied: #{basesystem_packages}" installesd_mach_kernel = File.join installesd, "mach_kernel" basesystem_mach_kernel = File.join basesystem, "mach_kernel" if File.exist? installesd_mach_kernel oh1 "Copying #{installesd_mach_kernel}" system(Utility::DITTO, installesd_mach_kernel, basesystem_mach_kernel) system(Utility::CHFLAGS, "hidden", basesystem_mach_kernel) puts "Copied: #{basesystem_mach_kernel}" end } } when :InstallESD, nil Dir.mktmpdir { |tmp| HDIUtil.write(@url, (tmpfile = File.join(tmp, File.basename(@url))), [:hdiutil]) { |installesd| [:extensions][:up_to_date] = ([:extensions][:remove].empty? and [:extensions][:install].empty?) [:mach_kernel] = File.exist? File.join(installesd, "mach_kernel") if [:mach_kernel].nil? yield installesd if block_given? pre_update_extension installesd, = .clone [:input] = [:output] = File.join(installesd, "BaseSystem.dmg") basesystem_flags = `#{Utility::LS} -lO "#{basesystem_options[:input]}"`.split[4] IESD::DMG::InstallESD::BaseSystem.new(File.join([:input])).export() { |basesystem| installesd_mach_kernel = File.join installesd, "mach_kernel" basesystem_mach_kernel = File.join basesystem, "mach_kernel" if File.exist? installesd_mach_kernel oh1 "Copying #{installesd_mach_kernel}" system(Utility::DITTO, installesd_mach_kernel, basesystem_mach_kernel) system(Utility::CHFLAGS, "hidden", basesystem_mach_kernel) puts "Copied: #{basesystem_mach_kernel}" end } system(Utility::CHFLAGS, basesystem_flags, [:output]) unless basesystem_flags == "-" if File.exist? (kextcache = File.join(installesd, "kernelcache")) IESD::DMG::InstallESD::BaseSystem.new(File.join([:output])).show { |basesystem| oh1 "Updating Kextcache" system(Utility::DITTO, File.join(basesystem, *KextCache::KERNELCACHE), kextcache) system(Utility::CHFLAGS, "hidden", kextcache) puts "Updated: #{kextcache}" } end post_update_extension installesd, if [:interactive] oh1 "Starting Interactive Shell" puts "Environment: InstallESD" HDIUtil.shell installesd end } system(Utility::MV, tmpfile, [:output]) } else raise "invalid output type" end end |