Jump to content
i am oz

Scriptable Utility to Create a Mountain Lion USB Installer

3 posts in this topic

Recommended Posts

Mountain Lion USB Installer Creator

 

Creates a USB installer for OS X Mountain Lion.

 

Must be run as root.

 

User is required to supply the path to InstallESD.dmg or have

Install OS X Mountain Lion.app sitting in /Applications.

 

Default kernel is vanilla, use '-c amd' to install AnV RC4 amd_kernel as

mach_kernel.

 

You can modify the kit or use '-k <path>' to customize the installer:

- Chameleon can be updated by replacing the files in Chameleon/i386.

 

- /Extra is copied over from Chameleon/Extra, so files added or changed there

will be copied to the new system for you.

 

- Extensions get copied to /System/Library/Extensions from the Extensions

folder.

 

- Launch daemons are installed from LaunchDaemons to /Library/LaunchDaemons.

 

- Custom actions can be executed at the end of the installation by modifying the

bash script postinstall.sh. The script is sourced by bless, so the

environment includes the log function and various useful variables. See the

script for more information.

 

- If you use the option to install an AMD kernel, you can replace amd_kernel

in the kit and it will get installed as mach_kernel on the installer and the

installed system. That way you can use some other legacy kernel instead

of the stock default.

 

- usr gets copied to /usr on the installer, but not the installed system.

This can still be useful if you want to use a utility in Terminal that

isn't available on the installer by default.

 

- The whole kit gets copied to /opt/kit on the installer. Again, probably only

useful to advanced users.

 

The '-y' option is great when you don't want to sit around watching for any

prompts that might pop up ;) (also for scripts)

 

The '-v' option gives lots of nice progress reporting while copying files,

for those that get paranoid when a utility sits with no output for a while.

 

Give your USB volume a fancy custom label with the '-l' option.

 

Ozlog is some ridiculous display of jumping through hoops to monitor the

bless hijack on the installer, and probably doesn't deserve to be included

with this utility. It may be useful to someone, but consider these options

seriously advanced. It should be harmless, but is generally useless. If you

want to use it, run `netcat -l 1234' on the host specified by '-a' to see

the log. It is only used when bless is called, at the very end of the

install process. Check out the log function at the top of usr/sbin/bless for

an example of how to use the installer side.

 

So, why would you want to monitor bless? Bless is what screws up some

other installer utilities and causes them to say "Installation Failed" at the

end, even though the system is still installed successfully. If you look in

the kit at usr/sbin/, you'll see that there is a bash script there called bless.

This script is the bless hijack, and it tricks the installer into succeeding!

It also installs Chameleon, /Extra, ensures the amd_kernel replaces

mach_kernel, copies over kexts, etc. This script replaces the stock bless

and therefore gets called at the end of the installation. If you had something

special you wanted your installer to do, you could put it in kit/ and modify

bless to call your script or whatever else you can imagine would be neat.

 

Bonus tip: You can use the following command to create a blank dmg.

hdiutil create -size 5g -format UDWR -attach installer.dmg

The output will list a device (like /dev/disk1) that you can use as the

argument to this utility. Then you'll have a .dmg you can keep, and restore

to a USB drive whenever you need it, instead of having to rebuild it with

this program.

 

hack:~ oz$ sudo ./mlusbcreator
Usage: mlusbcreator [-h]
mlusbcreator [-vy] [-k KIT] [-e ESD] [-l LABEL] [-c amd|intel] [-o -a ADDRESS [-p PORT]] target

Options:
-h, --help show this help message and exit
-v, --verbose display more info when copying files
-y, --yes automatically answer yes to all questions (useful for scripting)
-k KIT, --kit=KIT custom path to the hack kit (default: ./kit)
-e ESD, --esd=ESD custom path to InstallESD.dmg (default: /Applications/Install OS X Mountain Lion.app/SharedSupport/InstallESD.dmg)
-l LABEL, --label=LABEL custom label for the USB volume (default: Mountain Lion USB Installer)
-o, --ozlogd enable remote logging of bless hijack, requires -a and -p
-a ADDRESS, --address=ADDRESS ip address to send log messages to
-p PORT, --port=PORT custom port to sent log messages to (default: 1234)
-c CPU, --cpu=CPU explicitly set cpu type of target system (default: intel)

Brought to you by oz and SS01

 

Example usage:

hack:~ oz$ sudo ./mlusbcreator -y --verbose --esd=InstallESD.dmg --cpu=amd /dev/disk1

 

Get the latest version at http://oz.freqlabs.com/osx86/mlusb.zip

Edited by i am oz

Share this post


Link to post
Share on other sites
Advertisement

Congratulations, man!

 

Great tool! I tested when you sent me the link on the chat and - sorry not to tell you before, so many thinks occupying my worries these days - i can confirm it works as described, and now i have a fancy USB AMD ML installer. :D

 

Best regards!

Share this post


Link to post
Share on other sites

I'd like to quickly mention a few more things about this software:

 

The mlusbcreater Python script, as well as the bless and ozlogd bash scripts, are open source under the Apache License, Version 2. See http://www.apache.or...ICENSE-2.0.html for the full license.

 

Secondly, I want to highlight some of the possible ways to use this. You can easily build a kit for a specific hardware configuration by simply copying the kexts to kit/Extensions/, then run the script, or zip it back up and share with others. Or you could go even further and use it as the backend to your own application.

 

I wish I could edit the topic title, I would make it less rhetorcal and a bit more descriptive :) Figured out how to do that.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By guira
      Hey all, im new in Hackintosh world, I managed to install macOS Mojave in ASUS laptop x555LA, WIFI,HDMI,INTEL graphics, touchpad, laptop keyboard, ethernet, sound( barely, have to change it every time i run the laptop) is WORKING (after to much hours :D), also clover starts well without USB connected.
      Now my problem is that in clover, USB mouse and USB keyboard works perfectly but when MacOS load, don't know why, they stop working(just touchpad and lap keyboard working), I tried all to repair this but I can't, anyone can help me? also brightness not working but not a problem, just want USB keyboard and USB mouse working.
      AH and sorry for my English, im trying my best :D.
      btw, USB mouse and keyboard worked  when installing Mojave, but never worked in desktop or in login.
      Thanks so much , if u need more info I will be here!
    • By MaLd0n
      Now have a Olarila app, just download app and clover folder for your Chipset! https://olarila.com/forum/viewtopic.php?f=81&amp;t=6771   Nehalem, SandyBridge, IvyBridge, Haswell, Broadwell     Skylake, Kabylake and Coffeelake is here http://www.insanelymac.com/forum/topic/321872-guide-sierra-on-gigabyte-mobos-serie-200-kabylake-dsdt/   Install MacOS with Olarila Image, Step by Step, Install and Post Install
       
      https://olarila.com/forum/viewtopic.php?f=50&t=8685
        Mojave Full DSDT patch   http://olarila.com/forum/viewtopic.php?f=59&amp;t=6428   First...   ***Update bios to last available version!***   If you need a full patched DSDT...  -Extract tables with F4 key in Clover boot screen! -Run it and send me files! RunMe.app   Installation   --Create a bootable copy of macOS Sierra / High Sierra / Mojave   https://github.com/chris1111/Create-Install-Media/releases   --Install Clover in USB stick   https://sourceforge.net/projects/cloverefiboot/files/Installer/   --Replace with my Clover folder https://olarila.com/files/Clover.Folder/CLOVER.SERIES.CHIPSET.zip   --Install Sierra/High Sierra and boot into system!   Post Installation --Install Clover and replace with my folder   https://olarila.com/forum/viewtopic.php?f=28&t=8222   --Reboot and activate video!   Bingo!   Now you need a fine tune! DSDT time!   --DSDT   Patches -FIX ERRORS AND WARNINGS -HPET -SATA -DMAC -SLPB -DARWIN -LPC -XHCI -PLUGIN TYPE -XXXX to HDEF -HDEF -RTC -IRQs -SBUS -BUS1 -MCHC -ALS0 -SHUTDOWN -LAN -USBX -PMCR -EC -PNLF -HDMI
       
      --Power Management
      - 1 Generation Intel Processors, use Generate P and C States in config.plist
      - 2 and 3 Generations Intel Processors, Generate SSDT with Piker script and drop CpuPm and Cpu0Ist SSDTs
      ssdtPRGen.command.zip
      Credits-https://github.com/Piker-Alpha/ssdtPRGen.sh
      - 4 Generation+ Intel Processors, use PluginType=1 in DSDT, SSDT or Clover config.plist
       
      for check Power, Frequency, Temperature and Utilization, use it
       
      Install Intel Power Gadget.pkg.zip
       
      --Brightness
      Install .app, select the required permission and reboot. Work in F1 / F2 keys!
      NativeDisplayBrightness.app.zip


      https://github.com/Bensge/NativeDisplayBrightness/releases
      *in some cases .app don't work, check patches in config.plist inside Clover folder Post Install
       
      --Clover
       
      https://sourceforge.net/projects/cloverefiboot/files/Installer/
       
      --AUDIO
       
      Use DSDT + AppleAlc
       
      --install Lan driver by Mieze
        -Atheros   http://www.insanelymac.com/forum/files/file/313-atherose2200ethernet/   -Intel   http://www.insanelymac.com/forum/files/file/396-intelmausiethernet/   -Realtek   http://www.insanelymac.com/forum/files/file/88-realtekrtl8111-binary/   --Links   -FakeSMC   https://bitbucket.org/RehabMan/os-x-fakesmc-kozlek   -Audio   https://github.com/vit9696/AppleALC http://www.insanelymac.com/forum/topic/314406-voodoohda-289/   -USB   https://bitbucket.org/RehabMan/os-x-usb-inject-all/downloads   It's time to Rock   -Credits and thanks to the old and new people in the community who developed patches, kexts and bootloaders!   Apple, Slice, Kabyl, usr-sse2, jadran, Blackosx, dmazar, STLVNUB, pcj, apianti, JrCs, pene, FrodoKenny, skoczy, ycr.ru, Oscar09, xsmile, SoThOr, RehabMan, Download-Fritz, Zenit432, cecekpawon, Intel, Oracle, Chameleon Team, crazybirdy, Mieze, Mirone, Oldnapalm, netkas, Elconiglio, artut-pt, ErmaC, Pavo, Toleda, Master Chief and family, bcc9, The King, PMheart, Sherlocks, Micky1979, vit9696, vandroiy2013, Voodoo Team, Pike R. Alpha, lvs1974, Austere.J, CVad and many, many, many others!   We're all here to have fun and learn from each other!  
    • By MaLd0n
      Now have a Olarila app, just download app and clover folder for your Chipset! https://olarila.com/forum/viewtopic.php?f=81&amp;t=6771   Install MacOS with Olarila Image, Step by Step, Install and Post Install
       
      https://olarila.com/forum/viewtopic.php?f=50&t=8685
        First... If you need DSDT edits... -Extract tables with F4 key in Clover boot screen! -Run it and send me files! RunMe.app   Installation --Create a bootable copy of El Capitan /  Sierra / High Sierra / Mojave   https://github.com/chris1111/Create-Install-Media/releases   --Install Clover in USB stick https://sourceforge.net/projects/cloverefiboot/files/Installer/   --Replace with my Clover folder   https://olarila.com/files/Clover.Folder/CLOVER.LGA775.zip   --Install EL Capitan / Sierra / High Sierra and boot into system!     Post Installation   --Install Clover and replace with my folder   https://olarila.com/forum/viewtopic.php?f=28&t=8222     --Reboot and activate video!   Bingo! Now you need a fine tune! DSDT Time!   My DSDT GA P35-DS3   DSDT.MaLd0n.zip     Patches -FIX ERRORS AND WARNINGS -HPET -SATA -SLPB -DARWIN -LPC -HDEF -RTC -EHCI -UHCI -IRQs -SBUS -BUS1 -MCHC -ALS0 -SHUTDOWN -LAN -EC -PNLF --Native Power Management
       
      Use Clover, check Generate P and C States
       
      --Brightness
      Install .app, select the required permission and reboot. Work in F1 / F2 keys!
      NativeDisplayBrightness.app.zip


      https://github.com/Bensge/NativeDisplayBrightness/releases
      *in some cases .app don't work, check patches in config.plist inside Clover folder Post Install
       
      --AUDIO
       
      Device HDEF + AppleAlc + Lilu
       
      --install Lan driver by Mieze
        -Atheros   http://www.insanelymac.com/forum/files/file/313-atherose2200ethernet/   -Intel   http://www.insanelymac.com/forum/files/file/396-intelmausiethernet/   -Realtek   http://www.insanelymac.com/forum/files/file/88-realtekrtl8111-binary/   --Links   -FakeSMC   https://bitbucket.org/RehabMan/os-x-fakesmc-kozlek   -Audio   https://github.com/vit9696/AppleALC http://www.insanelymac.com/forum/topic/293863-applehda-patch-requests/   -Credits and thanks to the old and new people in the community who developed patches, kexts and bootloaders!   Slice, Kabyl, usr-sse2, jadran, Blackosx, dmazar, STLVNUB, pcj, apianti, JrCs, pene, FrodoKenny, skoczy, ycr.ru, Oscar09, xsmile, SoThOr, RehabMan, Download-Fritz, Zenit432, cecekpawon, Intel, Apple, Oracle, Chameleon Team, crazybirdy, Mieze, Mirone, Oldnapalm, netkas, Elconiglio, artut-pt, ErmaC, Pavo, Toleda, Master Chief and family, bcc9, The King, PMheart, Sherlocks, Micky1979, vit9696, vandroiy2013, Voodoo Team, Pike R. Alpha, lvs1974, Austere.J, CVad and many, many, many others!   We're all here to have fun and learn from each other!   ENJOY!  
    • By sierra2600
      The laptop in question: Acer TravelMate 8472 TM8472 (Model: ZQ3)

      The manufacturer specifications:
      Intel Core i5 520M 2.4GHz TurboBoost to 2.93GHz 3MB L3 Cache 14.0" 16:9 HD LED backlit LCD (specifically a AU Optronics AUO313C B140XW03 V1 - Thank you, HWiNFO64 !) with the embedded First Generation Intel HD Graphics IronLake, no nVidia graphics (Dissembling the machine clearly shows where it would be installed for the higher end option) The display resolution issue was resolved by following this guide: https://www.insanelymac.com/forum/topic/286092-guide-1st-generation-intel-hd-graphics-qeci/ The display - AU Optronics AUO313C B140XW03 V1 - was found to be a LVDS by searching for the Product Specification PDF as, again, Debian did not want to do " sudo intel_reg_dumper " and a lot of hopping from safe boot to regular boot through the GRUB2 and Chameleon bootloaders I found that Alternative 1 and 2 1X works but Alternative 1 gives me some really cool looking unintended gitched after effects "You're weird." I know. 4GB DDR3 Memory [it has been swapped out for the maximum that it can handle of 8GB] 320GB HDD (Western Digital, I wouldn't have it any other way...) The original has been swapped out with a same size to preserve the OEM recovery partitions unfortunately both of them are 5400RPM ("Why don't you go SSD?" I know the technology has become better but I still do not have a whole lot of trust in it - If you want to argue about it, sorry, Imma gonna ignore it. If it works, why change it) DVD-Super Multi DL Drive This fine dime will drive you nuts... there is a designated system managed eject button, much like on an actual Mac, that is next to the second wireless switching button. Do not press eject as the laptop is first booting up unless you want it to lockup before or during the BIOS boot screen "Acer Nplify™ 802.11 b/g/n" 6-cell Li-ion battery VERY NICE - NO MATTER WHAT OS I AM RUNNING, IT... FREAKING... LASTS  
      "Okay... what does it really have?" Well, all of the specifications listed above and then:
      "Atheros" Bluetooth; so says Hardware Vendor Detection from the Acer Support website - Broadcom; so says HWiNFO64 from PortableApps.com And then the sticker on the bottom says Foxconn BCM92046 ! ! ! (MAKE UP YOUR MIND!!! FOXCONN, ATHEROS, OR BROADCOM?!?!?! WHICH IS IT?!) Chicony 1.3M Camera (works no matter what if your into that stuff) LAN by Broadcom (BCM57760) WLAN by Broadcom (BCM943225HM) (No cellular modules are applicable to this model, there is a disabled mini PCI-E socket inside that is only good for a fourth expansion board USB port...) Alcor card reader (registers as a regular USB drive/stick to all operating systems unless you install the drivers in Windows, then it registers as whatever you shoved in there) EGISTEC fingerprint reader where a scroll button would be (works only in Windows after you install it) Synaptics TouchPad - TWO FINGER SCROLLING EVERYWHERE, yes can you tell that I actually do like this function? The Trackpad and Keyboard are handled by AppleACPIPS2Nub and ApplePS2Controller kexts I regretfully obtained mine from the other macx86 [I KNOW! I AM SORRY! I AM NOT HAPPY ABOUT IT EITHER!] I cannot help it if mine is just being really picky (at least I am admitting it, besides, they don't seem too friendly over there, they didn't seem to like the matter I installed 10.6 on a Pentium 4 3.4GHz and on an Atom netbook and the result was them just simply deleting my account [just for me to go back and remake it to dissemble their stuff to see what they stole... again...]) Intel 5 Series Audio but Conexant drivers work in Windows, weird. I use VoodooHDA 2.8.7 in Mac OS, anything older seemed to do NOTHING and a freaking telephone modem by Conexant but the Windows drivers are Liteon Did I mention that this thing is from 2010? "Why do you have such an old outdated-?" Because my work gave it to me for free  
      FakeSMC V6 and Plugins to use HWMonitor 6.16.1372 to its full potential  
      (I also have the HFS+ drivers installed so I can read [only] the files on the Mac partition)
       
      "How is it setup right now?"
      It is multibooted with:
      Microsoft Windows 7 Ultimate "That's on its way out very soon!" I have my ways of not being dumb online... I still use Windows XP online (*cough cough* Deepfreeze *cough*) Remix OS, a port of Android-x86 (very discontinued, looking into other versions) Niresh Mac OS X 10.8 with Chameleon "Why?" It's the last version of the big cats. Did you notice that they never did Lynx? Debian Linux KDE   "How did you do all of that?" And with a non-(U)EFI BIOS and no EFI partition, sorry, that is not what this thread is about... it was a metric ton of fun to get to work... LOTS of disk swapping and DBANs... and OSes like to manipulate partitions in each of their own ways and prevent other ones from installing without causing other conflicts like linux making a bunch of partitions because you told the Mac OS installer to format the drive with EFI in mind instead of MBR and so you have Windows, Linux but no Mac because the BIOS is only looking for FOUR partitions only and everything hits the fan including the kitchen sink...  
      "So what are you annoying us for?"
      Good question, because I am usually an introvert and usually just keep looking for answers but I could not find some. Jumping to it...
       
      What does not work and I would like thoughts on Bluetooth does not register, used to on previous installs (sorry, I did not pay attention to see if this was caused by me updating to 10.8.5 but that was necessary for the below functions) (It does not work in Debian either - Ignore) LAN and WLAN  - I have found Kexts (somewhere, I think I just lost them... dang it...) for the WLAN but I have yet to try them, nothing for the LAN I know this is cheating but I read that The NDISulator for FreeBSD (HINT HINT) is a port of NDISwrapper for Linux that runs Windows XP network drivers in Linux or BSD Brightness controls work from the middle down on the "Sun" brightness overlay, I got this far from following this: https://www.insanelymac.com/forum/topic/287133-guide-backlight-brightness-for-intel-80860046-1st-gen-hd-gma-5700mhd/ but I am kind of thinking of trying: https://www.insanelymac.com/forum/topic/287133-guide-backlight-brightness-for-intel-80860046-1st-gen-hd-gma-5700mhd/?do=findComment&comment=2214344 . My "magic number" is: 0xF        I used DSDTEditor in Windows, since I figured all the drivers are loaded, to extract the DSDT and compile something that somewhat works... Wake from sleep issue - I tried the above guide for that but I get no backlight and I can see that the cursor in the password field is not flashing when I use an external light source, but it will reboot when I press Ctrl + Alt + Power "button" (it is actually a slider) and then also clear my freaking CMOS right down to the clock... yeah I have the ACPI fix implmented and it usually works... DVD Player.app reports that no viable vidoe device was found (personally I don't care about the DVD Player.app problem, just wanted to put that out there for the heck of it)  
      Likely causes of: Bluetooth (BCM92046), WIFI (BCM943225HM) - So, I USED TO be able to turn on the WIFI from within Windows then reboot into Mac OS and have it work but I noticed recently that the indicator light for them extinguishes BEFORE it reboots now. When Windows or Android load, it lights up-- "No... really, captain obvious?!" --anyways working "No really Sherlock!" so OBVIOUSLY, the OS has to activate them... and preferably ignore the wireless switching button For the WIFI module, if you omit the 9 and HM in a search, results appear! Brightness - Will get reset to full "Bright light! Bright light!" when a "Load System Defaults" is applied from within the BIOS settings but like the WIFI and Bluetooth the OS will forcefully take control of it LAN (BCM57760) - I dunno...  when I search it, nothing comes up...  
      "Dude, what in the world is the point of this machine?" Cross platform software and driver development...
       
      Any help pertaining to the Bluetooth, WIFI, LAN, bizzar brightness and wake after sleep backlight issue would be wonderful... Thank you for your time and I hope that I helped anyone else out with some of their own issues pertaining to the Acer TravelMate 8472 TM8472 ZQ3 Medium-low model laptop...
       
      (Attached are non-modified extracted DSDT DSL and AML files "with errors according to DSDTEditor" for reference of the machine with a Phoenix BIOS version of 1.28 (07/20/2011))
      dsdt.aml
      dsdt.dsl
    • By irfan67670
      Hi all,
       
         I have a perfectly working Mojave installation on my Dell 3537, i5-4200U, Intel HD4400 Graphics, 8GB RAM. When I tried to upgrade using Catalina, it got stuck on showing '8 hours and 54 minutes remaining' and then the time started increasing instead of decreasing. So I decided to create a bootable USB and when I boot it, it always gets stuck on one of these two lines (sometime one comes before the other..):
        
        apfs_module_start: 1683: load: com.apple.filesystem.apfs, v1412 ....
        OR
        ApplePS2Controller: Notification consumer published: ApplePS2SynapticsTouchPad
       
        Things I have tried already and did nothing:
        - Removing VoodooPS2Controller kext and use external mouse/keyboard,
        - keep only minimal kexts in clover for booting (ethernet, smc etc)
        - clover patch to change ECDV to EC
        - Add SSDT-EC.aml to my patched ACPI folder in clover 

        Next thing will try is removing VirtualSMC and use FakeSMC during installation, if anyone faced same issue and found a solution, please advise.
       
        Thanks
      CLOVER.zip
×