Modifying Mac OS Sierra system files

Discussion in 'macOS Sierra (10.12)' started by Xbfryfd, May 30, 2017.

  1. Xbfryfd macrumors newbie

    Xbfryfd

    Joined:
    Feb 24, 2016
    #1
    Hi, I was looking one night a few weeks ago about trying to modify Mac OS Sierra's InstallableMachines.plist in the installESD.dmg file. When I noticed it again this morning, I tried messing around with it again, but I still can't add anything. What I want to do is add a Mac Pro 2008 motherboard ID, which I got from browser.primatelabs.com but when I paste it in, it says the file is locked. So I click the unlock button, but it says that the file is on a read-only volume, despite the fact that when I right-click and get info, I have read/write privileges for the file. So I turned off SIP, thinking that that was the culprit, but I still can't edit the file. Then I copied it to my desktop and edited it from there, but when I drag it back into the installESD.dmg, it won't copy. I would like to get any info that people have on this subject.
     
  2. AmazingHenry macrumors 65816

    AmazingHenry

    Joined:
    Jul 6, 2015
    Location:
    Central Michigan
    #2
    The screenshots I'll provide are out-of-date as I'm on an old system, but it works the same in Sierra.

    Go into the folder containing InstallableMachines.plist. Right click an empty space in the folder and choose "Get Info".
    Picture 5.png
    In the get into window, click the lock at the bottom (the lock may be somewhere else in Sierra):
    Picture 7.png

    Type your password to unlock the permissions, then give yourself read+write access.
     
  3. Xbfryfd, May 30, 2017
    Last edited: May 30, 2017

    Xbfryfd thread starter macrumors newbie

    Xbfryfd

    Joined:
    Feb 24, 2016
    #3
    I just tried what you recommended, but it says I have read/write privileges on every level already.
     
  4. AmazingHenry macrumors 65816

    AmazingHenry

    Joined:
    Jul 6, 2015
    Location:
    Central Michigan
    #4
    Go to the Get Info window for InstallESD.dmg. Does it say it's read-only?

    If not, that's all the help I can give. :( I'm not super experienced with Sierra.
     
  5. Xbfryfd thread starter macrumors newbie

    Xbfryfd

    Joined:
    Feb 24, 2016
    #5
    Thanks for the info, but it says that I have read/write
     
  6. foxlet, May 31, 2017
    Last edited: May 31, 2017

    foxlet macrumors regular

    foxlet

    Joined:
    Aug 5, 2016
    #6
    From experience with the macOS Installer, to modify InstallESD.dmg you'll need to make a shadowing file, as that disk image itself is read-only. Once you have made the modifications, you can rewrite it back to InstallESD, then keep that as your master image.

    As taken from my macOS Sierra Legacy Installer build script:
    sudo hdiutil attach -owners on /Applications/Install\ macOS\ Sierra\ Legacy.app/Contents/SharedSupport/InstallESD.dmg -shadow

    hdiutil convert -format UDZO -o ~/InstallESD.dmg InstallESD.dmg -shadow


    It's much easier, however, to write a skeleton InstallESD image on a flash drive or other read/write bootable medium, make your changes, then write the differences back to InstallESD.dmg, since you only have so much extra space to work with without having to create a new filesystem.

    I plan to do a writeup similar to the APFS one on the methods of making custom PowerPC OS X Installers, which might help with that idea.
     
  7. Xbfryfd thread starter macrumors newbie

    Xbfryfd

    Joined:
    Feb 24, 2016
    #7
    Wow! Thanks for all the info. I was wondering how to write a skeleton InstallESD. Do I just copy the InstallESD.dmg to a flash drive, or do I copy the InstallESD disk image?
     
  8. foxlet, May 31, 2017
    Last edited: May 31, 2017

    foxlet macrumors regular

    foxlet

    Joined:
    Aug 5, 2016
    #8
    To create a skeletal bootable image, you need the hidden file BaseSystem.dmg (which is inside of InstallESD.dmg). Once you mount InstallESD.dmg by opening it, you can write BaseSystem it with ASR:

    sudo asr restore -source /Volumes/OS\ X\ Install\ ESD/BaseSystem.dmg -target /Volumes/TARGET erase

    /Volumes/TARGET is the path to your flash drive.

    If you want to copy the remaining 3.5GB or so of installation files that are part os InstallESD.dmg/Packages, you can do so with:

    cp -r /Volumes/OS\ X\ Install\ ESD/Packages /Volumes/OS\ X\ Base\ System/System/Installation/Packages
     
  9. Xbfryfd thread starter macrumors newbie

    Xbfryfd

    Joined:
    Feb 24, 2016
    #9
    I tried doing what you said, I got the hidden file disk image copied to the desktop. Then I opened terminal and copied/pasted what you wrote, changing /volumes/target to my usb drive, and I got this (first image.) then I changed /volumes/OS\X\Install\ESD/BaseSystem.dmg to the path of the disk image on my computer, and I got the same thing (second image.) So I'm not sure what to do. SierraInstall2008 is my USB drive. Screen Shot 2017-05-31 at 6.56.56 PM.png Screen Shot 2017-05-31 at 7.02.15 PM.png
     
  10. foxlet macrumors regular

    foxlet

    Joined:
    Aug 5, 2016
    #10
    You need to put a space between -target and the path.
     

Share This Page