Jump to content
Welcome to InsanelyMac Forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

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



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



- 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

-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

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 MetalBreaker
      I noticed some weird behavior with macOS High Sierra. This system was working just fine on Sierra 10.12.5, until I decided to update to High Sierra (10.13.3). The upgrade process went mostly fine I guess, but it got stuck in an infinite spinning wheel which would just keep overlapping. I went into verbose mode, and sure enough, I found "IOConsoleUsers: gIOScreenLockState 3, hs 0, bs 0, now 0, sm 0x0" repeating over and over along with ACM errors... I'm really lost right now. I can boot in recovery mode and safe mode just fine, when the graphics drivers aren't loaded. Web drivers aren't installed. I installed NvidiaGraphicsFixup, but it didn't fix the issue. I tried deleting the native graphics drivers from macOS and installing web drivers, but it didn't help.
      SMBIOS: iMac13,1
      Graphics card: ASUS GT630-2GD3 (It's a Fermi card and it needs injection, so I modified my DSDT. Full graphics acceleration worked in Sierra. No Clover injection. I tried using Clover injection instead, I saw no difference.)
      CPU: Intel Core i3-3210, iGPU disabled in UEFI

      All kexts updated to their latest versions, along with Clover.

      For more info, you can refer to the GitHub issue where I posted it. https://github.com/lvs1974/NvidiaGraphicsFixup/issues/3
      Any help would be appreciated.
      Thank you for your time!
    • By ITzTravelInTime
      Questo è il thread in italiano dedicato alla mia app TINU, l'app open source che ho creato per creare chiavetta di installazione di mac utilizzando il metodo "createinstallmedia".
      Il nome è l'acronimo di TINU Is Not U (Per le regole del forum devo censurare, ma la U si riferisce ad un programma che piu o meno svolge lo stesso scopo che che per buoni motivi è bandito su questo sito, il punto del metterlo nel nome sta nel sottolineare che la mia app è totalmente divera)
      L'app è pensata per essere molto semplice ed immediata da usare (con un interfaccia grafica progettata con criteri e metodi usati in ambito professionale per lo sviluppo di applicazioni utente) e per essere molto solida e stabile che funziona sempre al primo colpo (a differenza di altri tool che conosciamo ...)
      A livello funzionale quest'app non è altro che un interfaccia grafica per il metodo da terminale "createinstallmedia" che viene sfrutatto dalla stessa per creare la chiavetta, quindi le chiavette create con TINU sono chiavette al 100% vanilla come se le aveste create dal terminale, a questo l' applicazione aggiunge funzioni utili come la formattazione automatica della chiavetta USB che si sceglie di usare in formato Mac OS Extended (journaled) (detto anche HFS+) con mapatura di partizione GUID.
      Tra gli altri vantaggi troviamo il fatto che permette di creare chiavette utilizzando qualunque applicazione di mac che contiene l'eseguibile "createinstallmedia" inclusi installer delle beta ed installer appena rilasciati, e non richiede di fare cose particolari prima come formattare la chiavetta e cambiare lingua al sistema e puo utilizzare applicazioni di mac che si trovano in vaie directory nel sistema e non solo quelle sche stanno in applicazioni ed hanno un nome specifico (nota che l'applicazione di installazione di mac deve essere quella interacche pesa diversi gb e non quella da pochi mb che l'app store puo scaricare alcune volte e che contiene tutto quello che serve per permettere a createinstallmedia di funzionare)
      l'applicazione è completamente aprta ed open source e trovate qui alcuni link utili:
       - Scarica l'app: https://github.com/ITzTravelInTime/TINU/releases
       - Repo github di TINU: https://github.com/ITzTravelInTime/TINU
       - FAQs (in inglese): https://github.com/ITzTravelInTime/TINU/wiki/FAQs
       - Thread in inglese su tinu (English thread about TINU): http://www.insanelymac.com/forum/topic/326959-tinu-the-macos-install-media-creation-tool-mac-app/
      Qui invece ci sono un paio di guide (Anche se l'app è molto facile da usare):
       - Piccola guida su come usare TINU per un hackintosh: https://www.youtube.com/watch?v=fZOZOUt2ErM
       - Piccola guida su come usare TINU per creare cheiavette per Mac "originali": https://www.youtube.com/watch?v=fZOZOUt2ErM
      Attualemente è in fase di sviluppo una nuova versione di questa app che verrà rilasciata a breve e che include diverse novità e migliorie importanti.
      Per chi se lo chiede, il supporto a clover in TINU è pianificato per una versione futura, anche se dei protipi a livvello codice per renderlo possibile, sono gia stati sperimentati con successo.
      Spero che anche voi del forum italiano aprezzerete questa app come gli utenti del forum inglese, per idee e suggerimenti, siete liberi di esprimervi :-)

    • By hguandl
      I used BCM943602CS for my Hackintosh. On High Sierra, the WiFi works well, however, the bluetooth doesn't work. I cannot find the bluetooth icon on the system preference pane. From the system report, I can see that the Device can be recognized as 'Bluetooth USB Host Controller'. From IORegistryExplorer, I've found that the device for it has a UsbConnector value of 0x0, which is weird. And the IOResources part says the device is not built-in. I don't know whether it has something to do with my MSI B350 Tomahawk (an AMD platform) motherboard. If someone has some advice, please help me out.