ninxsoft / Mist

A Mac utility that automatically downloads macOS Firmwares / Installers.
MIT License
2.73k stars 107 forks source link

DMG is created but only Read and need Read and Write #130

Closed AnaCarolina1980 closed 2 months ago

AnaCarolina1980 commented 3 months ago

Hi. Nice and fantastic tool. Thanks for that.

DMG is created but only "Read" and need "Read and Write" to edit some things if need. bug Thank you!

grahampugh commented 3 months ago

That's certainly not a bug. I'm struggling to see the use case but I cannot see how it could predicted how much extra space you would need in your DMG to add extra stuff. Therefore in my opinion it would make sense for you to download the installer app in Mist, create your own read/write DMG of whatever size you need, and then copy the app and other stuff into it.

AnaCarolina1980 commented 3 months ago

Sorry, but this is very useful for those who work with this and need to create an image where we can add some more files, copy files to the root of the .dmg, for example.

I think need this line "-format", "UDRW", but I'm not sure.

ninxsoft commented 3 months ago

@AnaCarolina1980 by design Mist attempts to create DMGs / ISOs / PKGs as close to the app installer as possible, without modification where possible.

I propose creating a writable disk image by first creating a standard disk image via Mist or createinstallmedia, then using the hdiutil command to convert said disk image:

hdiutil convert -help

hdiutil convert: convert an image into a different format
Usage:  hdiutil convert -format <format> -o <outfile> <image>
    Image Formats:
        UDRO - read-only
        UDCO - compressed (ADC)
        UDZO - compressed
        UDBZ - compressed (bzip2), deprecated
        ULFO - compressed (lzfse)
        ULMO - compressed (lzma)
        UFBI - entire device
        IPOD - iPod image
        UDSB - sparsebundle
        UDSP - sparse
        UDRW - read/write
        UDTO - DVD/CD master

    Convert options:
        -ov     overwrite target file(s) if it already exists
        -align [<sector alignment>] [4 aka 2K]
        -pmap
        -segmentSize < ?? | ??b | ??k | ??m | ??g | ??t | ??p | ??e > (deprecated)
            (blocks, bytes, kilobytes, megabytes, gigabytes, terabytes, petabytes, exabytes)
        -tasks <task count>     [12]

    Common options:
        -encryption <crypto method>
            AES-128 - 128-bit AES encryption (recommended)
            AES-256 - 256-bit AES encryption (more secure, but slower)
        -stdinpass
        -agentpass
        -certificate <path-to-cert-file>
        -srcimagekey <key>=<value>  (-imagekey is a synonym)
        -tgtimagekey <key>=<value>
        -shadow <shadowfile>
        -insecurehttp
        -cacert <file | dir>
        -plist
        -puppetstrings
        -verbose
        -debug
        -quiet

This will allow you to convert the read-only disk image to read-write :+1:

AnaCarolina1980 commented 2 months ago

Thanks for that!

hdiutil convert -format UDRW xxxx.dmg -o xxxxnew.dmg

Solved!