Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ERROR: unable to proceed with final disk image creation because the interstitial disk image was not found #164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sptrakesh opened this issue Jan 8, 2024 · 6 comments
Assignees
Labels
Milestone

Comments

@sptrakesh
Copy link

Hello,

Getting the above error consistently when attempting to create a DMG using the following invocation (Sonoma 14.2.1, create-dmg installed via brew):

create-dmg \
    --icon background.jpg 144 144 \
    --volname "MoviePlayer Installer" \
    --volicon Icon.icns \
    --filesystem APFS \
    --app-drop-link 416 144 \
    --hdiutil-quiet \
    MoviePlayer.dmg /tmp/make_dmg

The log is as follows:

Creating disk image...
Mounting disk image...
Device name:     /dev/disk4
Searching for mounted interstitial disk image using /dev/disk4s... 
ERROR: unable to proceed with final disk image creation because the interstitial disk image was not found.
The interstitial disk image will likely be mounted and will need to be cleaned up manually.
@emjoseph
Copy link

emjoseph commented Jan 20, 2024

Seeing a similar error as well on Sonoma 14.2.1.
My machine is Macbook Pro (16-inch, 2021, Apple M1 Max)

Code:

create-dmg \
--volname "App Installer" \
--window-pos 200 120 \
--window-size 760 552 \
--icon-size 130 \
--text-size 13 \
--filesystem "APFS" \
--background "background.png" \
--icon "MyApp.app" 130 303 \
--hide-extension "MyApp.app" \
--app-drop-link 630 303 \
--codesign {My Code Sign Info} \
"MyAppInstaller.dmg" \
"./source/"
Creating disk image...
....................................................................................................................................................
created: /Users/emjoseph/MyApp/MacDistribution/rw.14059.MyAppInstaller.dmg
Mounting disk image...
Device name:     /dev/disk4
Searching for mounted interstitial disk image using /dev/disk4s...
ERROR: unable to proceed with final disk image creation because the interstitial disk image was not found.
The interstitial disk image will likely be mounted and will need to be cleaned up manually.

If I switch to HFS+ I see this:

created: /Users/emjoseph/MyApp/MacDistribution/rw.13484.MyAppInstaller.dmg
Mounting disk image...
Device name:     /dev/disk4
Searching for mounted interstitial disk image using /dev/disk4s...
Mount dir:
/Volumes/dmg.agS6je
Copying background file 'background.png'...
mkdir:
/Volumes/dmg.agS6je: No such file or directory

Any thoughts on how to resolve this?

@fsantini
Copy link

I just had the same problem. For some reason, the system started returning a newline before /Volumes/dmg.XXXX. I patched it by changing line 149 of the script (inside find_mount_dir()) to:
echo "${found_dir:1}"
This should probably be written in a portable way (remove characters before the first / in the string?) but it's an easy workaround for the moment.

@gnattu
Copy link

gnattu commented Feb 6, 2024

After looking at it I had some observations but unfortunately no easy fix.

The current hardcoded values for setting DEV_NAME is wrong for APFS disk images. The disk images for APFS does not only have only one, but multiple disks (as APFS Volumes) in it.

More specifically this line:

DEV_NAME=$(hdiutil attach -mountrandom ${MOUNT_RANDOM_PATH} -readwrite -noverify -noautoopen -nobrowse "${DMG_TEMP_NAME}" | grep -E --color=never '^/dev/' | sed 1q | awk '{print $1}')

It assumes the first line will return the disk to be mounted, but it is wrong.

This is probably what you will get for an APFS image:

/dev/disk4	GUID_partition_scheme	
/dev/disk4s1	7C3457EF-0000-11AA-AA11-00306543ECAC	
/dev/disk5	EF57347C-0000-11AA-AA11-00306543ECAC	
/dev/disk5s1	41504653-0000-11AA-AA11-00306543ECAC	/Volumes/dmg.qUZVr1

As you see, from the output above, actually the one that comes from the last line is the one we want to search for.

This also explains what @fsantini found, that in some cases, there is a newline before the actual mount point: because the disk name matching may match a disk without mount point at first, then in the second line, with a disk that have the mount point, hence the newline.

My suggestion would be change the sed 1q to tail -n 1, then remove the s from this line:

MOUNT_DIR=$(find_mount_dir "${DEV_NAME}s")

and then change this for loop to just search for what passed in:

create-dmg/create-dmg

Lines 144 to 152 in b62ae1d

for i in {1..9}; do
# attempt to find the partition
local found_dir
found_dir=$(hdiutil info | grep -E --color=never "${dev_name}" | head -${i} | awk '{print $3}')
if [[ -n "${found_dir}" ]]; then
echo "${found_dir}"
return 0
fi
done

but I'm not very sure if it will work for everyone. It works for me to generate an APFS image.

@mjmeijer
Copy link

mjmeijer commented Mar 6, 2024

Changing from APFS to HFS+ proceeds further, but I get stuck in unmounting the disk:

Done running the AppleScript...
Fixing permissions...
Done fixing permissions
Skipping blessing on sandbox
Deleting .fseventsd
Unmounting disk image...
hdiutil: couldn't unmount "disk10" - Resource busy
Wait a moment...
Unmounting disk image...
hdiutil: couldn't unmount "disk10" - Resource busy
Wait a moment...
Unmounting disk image...
hdiutil: couldn't unmount "disk10" - Resource busy
%

After that I'm left with an unsigned temp dmg.

@PrimozGodec
Copy link

I have the same issue on HFS+ (newline before /Volumes/dmg.XXXX). What would be a generic solution for that? @gnattu, if I understand correctly, your solution is for APFS? Would it be enough to remove any character before the first / (or can this solution have some issue in certain cases)?

@arifali123 arifali123 mentioned this issue May 7, 2024
@aonez
Copy link
Member

aonez commented May 7, 2024

Please check the new release: https://github.com/create-dmg/create-dmg/releases/tag/v1.2.2

@aonez aonez closed this as completed May 7, 2024
@aonez aonez added this to the 1.2.2 milestone May 7, 2024
@aonez aonez self-assigned this May 7, 2024
@aonez aonez added the bug label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants